Re: Info regarding Linux Network Buffers.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Apr 14, 2003 at 07:12:37PM +0530, Deepankar Vidyarthi wrote:
> Hi, 
> 
> Require some more clarification to an older question :). 
> I am attaching my original mail too for reference.
> As I understand, Linux first uses skb1->frags array to put data.
> Once it is full, it gets another skb (say skb2), fills its data
> area, 

As far as I can recall, it does NOT fill its data area, only uses its
frags array. Let's see.. 

? then its frags area.
> So data is in this form (order):
> 
> skb1->data, skb1->frags[1-MAX], skb1->fraglist (ie skb2), 
> skb2->data, skb2->frags[1-MAX].

skb1->data, skb1->frags[1-MAX], skb1->fraglist (ie skb2)
            skb2->frags[1-MAX], skb2->fraglist ... 

> Suppose it needs more space, so it creates skb3.
> Now where will it keep skb3.
> It seems to me that it goes as:
> 		skb1->fraglist->next 	(=skb3)
> ie, same as 	skb2->next.		(=skb3)
> Is this fine???

next and prev are used in a completely different context, to have
several skbs on a queue. So, to answer your question, once you add
skb3, you will have skb2->fraglist = skb3, and only the ->frags array
on skb3 will be used. 

> Moreover, it seems to me that Linux uses this type of frag chaining only while it is 
> getting fragments from the network. Does the code handle such sort of chaining if we 
> create packet in that format on the output side?? As far as I could check, it seems 
> this (skb_shared_info) is used only on the input side. I have checked in some flows, 
> just wanted to make sure this is the case for all the output flows.

grepping around for NETIF_F_FRAGLIST in 2.5, it appears that only the
loopback device and ieee1394 use it. 

Hope this helps, 
Muli. 
-- 
Muli Ben-Yehuda
http://www.mulix.org

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/



[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux