All of lore.kernel.org
 help / color / mirror / Atom feed
* Query about skb scatter / gather
@ 2009-03-06 17:17 Amar Mudrankit
  2009-03-06 19:47 ` Brandeburg, Jesse
  0 siblings, 1 reply; 3+ messages in thread
From: Amar Mudrankit @ 2009-03-06 17:17 UTC (permalink / raw)
  To: netdev

Can I have a socket buffer received over network having protocol
headers (IP, TCP/UDP/ICMP) in first page of skb_frags_t array of the
skb?

So, in such a situation the skb->data is almost 0 and all the data
along with headers is in pages listed in skb_frags_t array.

Can linux networking stack handle such socket buffer? Or is it
mandatory that, at least some minimum data should be accessible
through skb->data and rest can be in pages described in skb_frags_t
array?

Also can anyone suggest good pointers for making use of frag_list in
skb_shared_info structure? Is it meant to represent one network packet
as the list of multiple skbs each skb holding part of packet data in
the order they are linked?

I tried finding it in UNDERSTANDING LINUX NETWORK INTERNALS by
CHRISTIAN BENVENUTI, but couldn't find anything conclusive.  As I
understand, it is enabled through NETIF_F_FRAGLIST feature of the
device.

Thanks in Advance.

Regards,
Amar

^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: Query about skb scatter / gather
  2009-03-06 17:17 Query about skb scatter / gather Amar Mudrankit
@ 2009-03-06 19:47 ` Brandeburg, Jesse
  2009-03-09 14:02   ` Rémi Denis-Courmont
  0 siblings, 1 reply; 3+ messages in thread
From: Brandeburg, Jesse @ 2009-03-06 19:47 UTC (permalink / raw)
  To: Amar Mudrankit, netdev

Amar Mudrankit wrote:
> Can I have a socket buffer received over network having protocol
> headers (IP, TCP/UDP/ICMP) in first page of skb_frags_t array of the
> skb?
> 
> So, in such a situation the skb->data is almost 0 and all the data
> along with headers is in pages listed in skb_frags_t array.
> 
> Can linux networking stack handle such socket buffer? Or is it
> mandatory that, at least some minimum data should be accessible
> through skb->data and rest can be in pages described in skb_frags_t
> array?

the answer is yes, but see below.
 
> Also can anyone suggest good pointers for making use of frag_list in
> skb_shared_info structure? Is it meant to represent one network packet
> as the list of multiple skbs each skb holding part of packet data in
> the order they are linked?

frag_list can only be safely used in rare cases where you know that 
the ip defragmentation code will not be called.  It links multiple
skb's together to form one large packet (for receive)
 
> I tried finding it in UNDERSTANDING LINUX NETWORK INTERNALS by
> CHRISTIAN BENVENUTI, but couldn't find anything conclusive.  As I
> understand, it is enabled through NETIF_F_FRAGLIST feature of the
> device.

The Intel ixgbe, igb, and e1000e drivers all support receiving
packets into two buffers, the header into the first buffer and the
data into the first page, second page, etc.

the pages are stored in skb_shinfo(skb)->frags[]

for most working protocols in the kernel the ->data section is populated
if necessary by pskb_may_pull and friends

AFAIK the myri10ge driver receives only into pages and then has to
build a receivable sk_buff (using an open coded pskb_pull_tail)

hope this helps,
  Jesse

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Query about skb scatter / gather
  2009-03-06 19:47 ` Brandeburg, Jesse
@ 2009-03-09 14:02   ` Rémi Denis-Courmont
  0 siblings, 0 replies; 3+ messages in thread
From: Rémi Denis-Courmont @ 2009-03-09 14:02 UTC (permalink / raw)
  To: ext Brandeburg, Jesse; +Cc: Amar Mudrankit, netdev

On Friday 06 March 2009 21:47:22 ext Brandeburg, Jesse wrote:
> frag_list can only be safely used in rare cases where you know that
> the ip defragmentation code will not be called.  It links multiple
> skb's together to form one large packet (for receive)

Uh? Sure, nested fragments do not work.
But... My reading of ip_frag_reasm() is that you can always use fragments 
list. If this happens the defragmentation code will split your skb into two, 
so as to avoid nested fragments. What's the problem with that?

-- 
Rémi Denis-Courmont
Maemo Software, Nokia Devices R&D


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-03-09 14:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-03-06 17:17 Query about skb scatter / gather Amar Mudrankit
2009-03-06 19:47 ` Brandeburg, Jesse
2009-03-09 14:02   ` Rémi Denis-Courmont

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.