All of lore.kernel.org
 help / color / mirror / Atom feed
* A couple of questions about the SKB fragments
@ 2016-05-05  7:40 Ilya Matveychikov
  2016-05-05 11:13 ` Edward Cree
  0 siblings, 1 reply; 4+ messages in thread
From: Ilya Matveychikov @ 2016-05-05  7:40 UTC (permalink / raw)
  To: netdev; +Cc: Aleksey.Baulin

Hello folks,

While working with fragmented SKBs we've got stuck with the following:
- is it possible for an SKB fragment in skb_shinfo(skb)->frag_list to
be fragmented too (i.e. to have SKBs in frag_list)?
- do skb->len and skb->data_len contain the whole SKB length,
including the length of all fragments (not only the paged parts)?

Is there any docs except the kernel sources itself to refer to?

Thanks.

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

* Re: A couple of questions about the SKB fragments
  2016-05-05  7:40 A couple of questions about the SKB fragments Ilya Matveychikov
@ 2016-05-05 11:13 ` Edward Cree
  2016-05-05 12:58   ` Sowmini Varadhan
  2016-05-07  9:21   ` Ilya Matveychikov
  0 siblings, 2 replies; 4+ messages in thread
From: Edward Cree @ 2016-05-05 11:13 UTC (permalink / raw)
  To: matvejchikov, netdev; +Cc: Aleksey.Baulin

On 05/05/16 08:40, Ilya Matveychikov wrote:
> Hello folks,
>
> While working with fragmented SKBs we've got stuck with the following:
> - is it possible for an SKB fragment in skb_shinfo(skb)->frag_list to
> be fragmented too (i.e. to have SKBs in frag_list)?
> - do skb->len and skb->data_len contain the whole SKB length,
> including the length of all fragments (not only the paged parts)?
>
> Is there any docs except the kernel sources itself to refer to?
davem has some docs up at http://vger.kernel.org/~davem/skb.html and
http://vger.kernel.org/~davem/skb_data.html
In particular note the following:
"The frag_list is used to maintain a chain of SKBs organized for
 fragmentation purposes, it is _not_ used for maintaining paged data."
So my reading would suggest there is no way to multiple-layer-fragment
an SKB; the frags are page pointers and offsets, not entire sk_buff
structs in their own right.

-Ed

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

* Re: A couple of questions about the SKB fragments
  2016-05-05 11:13 ` Edward Cree
@ 2016-05-05 12:58   ` Sowmini Varadhan
  2016-05-07  9:21   ` Ilya Matveychikov
  1 sibling, 0 replies; 4+ messages in thread
From: Sowmini Varadhan @ 2016-05-05 12:58 UTC (permalink / raw)
  To: Edward Cree; +Cc: matvejchikov, netdev, Aleksey.Baulin

On (05/05/16 12:13), Edward Cree wrote:
> On 05/05/16 08:40, Ilya Matveychikov wrote:
> >
> > While working with fragmented SKBs we've got stuck with the following:
> > - is it possible for an SKB fragment in skb_shinfo(skb)->frag_list to
> > be fragmented too (i.e. to have SKBs in frag_list)?
> > - do skb->len and skb->data_len contain the whole SKB length,
> > including the length of all fragments (not only the paged parts)?
> >
> > Is there any docs except the kernel sources itself to refer to?
> davem has some docs up at http://vger.kernel.org/~davem/skb.html and
> http://vger.kernel.org/~davem/skb_data.html
> In particular note the following:
> "The frag_list is used to maintain a chain of SKBs organized for
>  fragmentation purposes, it is _not_ used for maintaining paged data."
> So my reading would suggest there is no way to multiple-layer-fragment
> an SKB; the frags are page pointers and offsets, not entire sk_buff
> structs in their own right.

Actually (and perhaps I am mixing up skb_frag_t with the sk_buff in
skb_shinfo(skb)->frag_list) I think it is entirely possible in theory 
for the frag_list to itself both skb_frag_t's as well as more sk_buffs
in the ->frag_list- at least that's why I understand fromcode
that recurses using skb_walk_frags(), such as tcp_md5_hash_skb_data().
AIUI, the statement about page pointers and offsets applies to the 
skb_frag_t's in the skb_shared_info. The len and data_len should be
the sum-total for the whole skb, including skb_frag_t's and ->frag_list.

--Sowmini

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

* Re: A couple of questions about the SKB fragments
  2016-05-05 11:13 ` Edward Cree
  2016-05-05 12:58   ` Sowmini Varadhan
@ 2016-05-07  9:21   ` Ilya Matveychikov
  1 sibling, 0 replies; 4+ messages in thread
From: Ilya Matveychikov @ 2016-05-07  9:21 UTC (permalink / raw)
  To: Edward Cree; +Cc: netdev, Aleksey.Baulin

2016-05-05 14:13 GMT+03:00 Edward Cree <ecree@solarflare.com>:
> On 05/05/16 08:40, Ilya Matveychikov wrote:
> > Is there any docs except the kernel sources itself to refer to?

> davem has some docs up at http://vger.kernel.org/~davem/skb.html and
> http://vger.kernel.org/~davem/skb_data.html
> In particular note the following:
> "The frag_list is used to maintain a chain of SKBs organized for
>  fragmentation purposes, it is _not_ used for maintaining paged data."
> So my reading would suggest there is no way to multiple-layer-fragment
> an SKB; the frags are page pointers and offsets, not entire sk_buff
> structs in their own right.
>

Seems that the docs is slightly outdated. I think the structure of SKB does
not impose any restrictions on the nesting of the fragments. But is there
any of them in the kernel's code?

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

end of thread, other threads:[~2016-05-07  9:21 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-05  7:40 A couple of questions about the SKB fragments Ilya Matveychikov
2016-05-05 11:13 ` Edward Cree
2016-05-05 12:58   ` Sowmini Varadhan
2016-05-07  9:21   ` Ilya Matveychikov

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.