Networking Forums

Networking Forums > Computer Networking > Linux Networking > dev_alloc_skb, skb_copy

Reply
Thread Tools Display Modes

dev_alloc_skb, skb_copy

 
 
raj
Guest
Posts: n/a

 
      09-30-2003, 02:26 PM
hi,
I am working on the bridging code.
Came across "Out of Memory" problem.
I don't know what is causing that.
Most importantly I am doing two things:
1) I'm using "dev_alloc_skb" to create new buffer to transmit
new packets using 'br_flood_forward()' but I am not freeing
that assuming that dev_queue_xmit() function will take care
of that, correct me if I am wrong.
2) I'm using "skb_copy" to duplicate the packet and use it
instead of the original, while the original is queued.
something like:

struct sk_buff *skbc = skb_copy(skb, GFP_ATOMIC);

if(skbc==NULL) {
kfree_skb(skb);
return 0;
}
.... do some processing with original 'skb'.....
br_flood_forward(br, skb, 0);

.... do some processing with duplicate, skbc .....
br_flood_forward(br, skbc, 0);
And, I am not freeing the copy either assuming it will be freed
at dev_queue_xmit().

I appreciate if any one can throw me some pointers.

Thanx,

Raj
ROI, PA
 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off




1 2 3 4 5 6 7 8 9 10 11