Is there any simple way to increase the number of references to the SKB buffer in the linux kernel so that the hardware does not release it.
I know that with skb_clone the link count is automatically incremented, but I would like to know, without creating a clone, how to increase the SKB link count.
My goal is to send the same packet several times, and I don't want to do skb_clone every time for this operation, since I want to reuse the same memory.
An example of the code that I use for the same SKB is shown below
for (i=0;i<=100;i++) { tmp_skb = skb_get(skb); if (tmp_skb == NULL) { printk ("Clone Failed"); continue; } if ( (err = dev_queue_xmit(tmp_skb)) != NETDEV_TX_OK) { if(unlikely(enable_error)) printk("ERROR - DEV QUEUE FAILED %d\n", err); err = -ENETDOWN; continue; } if (i==100) { printk("Loop is done\n"); kfree_skb(skb); return(len); } }
source share