All of lore.kernel.org
 help / color / mirror / Atom feed
* Regarding skb and skb_frags
@ 2014-05-01 10:42 Pranay Srivastava
  2014-05-01 13:59 ` Valdis.Kletnieks at vt.edu
  2014-05-13  3:04 ` Li Wei
  0 siblings, 2 replies; 7+ messages in thread
From: Pranay Srivastava @ 2014-05-01 10:42 UTC (permalink / raw)
  To: kernelnewbies

I was going through a function

dev_alloc_skb

and it seems that the skb_frags are created only if the data length
passed is > PAGE_SIZE.

My question is that an Ethernet frame won't be bigger than 1500 bytes
[correct?] so there never will be skb_frags for Ethernet frames.
However I've seen skb_frags appeared when sending large data.

I'm not sure how to understand this. Does the driver pokes IP header
to check how many fragments would be coming and decides (on the rcv
side) how much to pass in dev_alloc_skb ?

Thanks
-- 
        ---P.K.S

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

* Regarding skb and skb_frags
  2014-05-01 10:42 Regarding skb and skb_frags Pranay Srivastava
@ 2014-05-01 13:59 ` Valdis.Kletnieks at vt.edu
  2014-05-01 14:09   ` Pranay Srivastava
  2014-05-13  3:04 ` Li Wei
  1 sibling, 1 reply; 7+ messages in thread
From: Valdis.Kletnieks at vt.edu @ 2014-05-01 13:59 UTC (permalink / raw)
  To: kernelnewbies

On Thu, 01 May 2014 16:12:43 +0530, Pranay Srivastava said:

> My question is that an Ethernet frame won't be bigger than 1500 bytes
> [correct?]

Incorrect.  10G and faster ethernet support jumbograms.  We run our HPC 10G
network with an MTU of 9000 (which is 2 pages and a bit more).


-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 848 bytes
Desc: not available
Url : http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20140501/667f8c15/attachment.bin 

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

* Regarding skb and skb_frags
  2014-05-01 13:59 ` Valdis.Kletnieks at vt.edu
@ 2014-05-01 14:09   ` Pranay Srivastava
  2014-05-01 16:20     ` Jeff Haran
  0 siblings, 1 reply; 7+ messages in thread
From: Pranay Srivastava @ 2014-05-01 14:09 UTC (permalink / raw)
  To: kernelnewbies

On Thu, May 1, 2014 at 7:29 PM,  <Valdis.Kletnieks@vt.edu> wrote:
> On Thu, 01 May 2014 16:12:43 +0530, Pranay Srivastava said:
>
>> My question is that an Ethernet frame won't be bigger than 1500 bytes
>> [correct?]
>
> Incorrect.  10G and faster ethernet support jumbograms.  We run our HPC 10G
> network with an MTU of 9000 (which is 2 pages and a bit more).
>
Ok. So in any case the driver won't poke past ethernet header to look
for the size [Correct?].
So it means only when MTU is bigger than page size would there be a
possibility of skb_frags [Correct?].
>

Thanks

-- 
        ---P.K.S

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

* Regarding skb and skb_frags
  2014-05-01 14:09   ` Pranay Srivastava
@ 2014-05-01 16:20     ` Jeff Haran
  2014-05-02  3:16       ` Pranay Srivastava
  0 siblings, 1 reply; 7+ messages in thread
From: Jeff Haran @ 2014-05-01 16:20 UTC (permalink / raw)
  To: kernelnewbies

> -----Original Message-----
> From: kernelnewbies-bounces at kernelnewbies.org [mailto:kernelnewbies-bounces at kernelnewbies.org] On Behalf Of Pranay
> Srivastava
> Sent: Thursday, May 01, 2014 7:10 AM
> To: Valdis.Kletnieks at vt.edu
> Cc: kernelnewbies
> Subject: Re: Regarding skb and skb_frags
> 
> On Thu, May 1, 2014 at 7:29 PM,  <Valdis.Kletnieks@vt.edu> wrote:
> > On Thu, 01 May 2014 16:12:43 +0530, Pranay Srivastava said:
> >
> >> My question is that an Ethernet frame won't be bigger than 1500 bytes
> >> [correct?]
> >
> > Incorrect.  10G and faster ethernet support jumbograms.  We run our HPC 10G
> > network with an MTU of 9000 (which is 2 pages and a bit more).
> >
> Ok. So in any case the driver won't poke past ethernet header to look
> for the size [Correct?].
> So it means only when MTU is bigger than page size would there be a
> possibility of skb_frags [Correct?].

I'm not sure what kernel version you are looking at, but when I do a search for skb_frags in the latest kernel sources at http://lxr.linux.no, I don't see any variables or structure members named skb_frags, though it shows up in comments in one driver.

That being said, I believe skb fragments are also used to implement scatter/gather lists of packet payload data, even in packets less than or equal to the usual 1500 bytes.

On the systems I work with, I've seen this happening in packets originating from the target system, i.e. egress path of local traffic.

Jeff Haran

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

* Regarding skb and skb_frags
  2014-05-01 16:20     ` Jeff Haran
@ 2014-05-02  3:16       ` Pranay Srivastava
  2014-05-02 16:21         ` Jeff Haran
  0 siblings, 1 reply; 7+ messages in thread
From: Pranay Srivastava @ 2014-05-02  3:16 UTC (permalink / raw)
  To: kernelnewbies

On Thu, May 1, 2014 at 9:50 PM, Jeff Haran <Jeff.Haran@citrix.com> wrote:
>> -----Original Message-----
>> From: kernelnewbies-bounces at kernelnewbies.org [mailto:kernelnewbies-bounces at kernelnewbies.org] On Behalf Of Pranay
>> Srivastava
>> Sent: Thursday, May 01, 2014 7:10 AM
>> To: Valdis.Kletnieks at vt.edu
>> Cc: kernelnewbies
>> Subject: Re: Regarding skb and skb_frags
>>
>> On Thu, May 1, 2014 at 7:29 PM,  <Valdis.Kletnieks@vt.edu> wrote:
>> > On Thu, 01 May 2014 16:12:43 +0530, Pranay Srivastava said:
>> >
>> >> My question is that an Ethernet frame won't be bigger than 1500 bytes
>> >> [correct?]
>> >
>> > Incorrect.  10G and faster ethernet support jumbograms.  We run our HPC 10G
>> > network with an MTU of 9000 (which is 2 pages and a bit more).
>> >
>> Ok. So in any case the driver won't poke past ethernet header to look
>> for the size [Correct?].
>> So it means only when MTU is bigger than page size would there be a
>> possibility of skb_frags [Correct?].
>
> I'm not sure what kernel version you are looking at, but when I do a search for skb_frags in the latest kernel sources at http://lxr.linux.no, I don't see any variables or structure members named skb_frags, though it shows up in comments in one driver.
>
> That being said, I believe skb fragments are also used to implement scatter/gather lists of packet payload data, even in packets less than or equal to the usual 1500 bytes.
>
> On the systems I work with, I've seen this happening in packets originating from the target system, i.e. egress path of local traffic.
I think i get it with egress path since you are actually sending out
packet possible via scatter/gather. But this skb won't be allocated by
the driver, it'll be given to the driver by upper networking
subsystem. I'm confused about the inbound packets, would they ever be
having skb fragments [sorry to confuse with skb_frags i wasn'
reffering to structure]?

I'm more inclined to know from a device driver's perspective if it'll
have to create an skb when a packet arrives which is non-linear.
>
> Jeff Haran
>


Thanks again!
-- 
        ---P.K.S

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

* Regarding skb and skb_frags
  2014-05-02  3:16       ` Pranay Srivastava
@ 2014-05-02 16:21         ` Jeff Haran
  0 siblings, 0 replies; 7+ messages in thread
From: Jeff Haran @ 2014-05-02 16:21 UTC (permalink / raw)
  To: kernelnewbies

> -----Original Message-----
> From: Pranay Srivastava [mailto:pranjas at gmail.com]
> Sent: Thursday, May 01, 2014 8:17 PM
> To: Jeff Haran
> Cc: Valdis.Kletnieks at vt.edu; kernelnewbies
> Subject: Re: Regarding skb and skb_frags
> 
> On Thu, May 1, 2014 at 9:50 PM, Jeff Haran <Jeff.Haran@citrix.com> wrote:
> >> -----Original Message-----
> >> From: kernelnewbies-bounces at kernelnewbies.org
> >> [mailto:kernelnewbies-bounces at kernelnewbies.org] On Behalf Of Pranay
> >> Srivastava
> >> Sent: Thursday, May 01, 2014 7:10 AM
> >> To: Valdis.Kletnieks at vt.edu
> >> Cc: kernelnewbies
> >> Subject: Re: Regarding skb and skb_frags
> >>
> >> On Thu, May 1, 2014 at 7:29 PM,  <Valdis.Kletnieks@vt.edu> wrote:
> >> > On Thu, 01 May 2014 16:12:43 +0530, Pranay Srivastava said:
> >> >
> >> >> My question is that an Ethernet frame won't be bigger than 1500
> >> >> bytes [correct?]
> >> >
> >> > Incorrect.  10G and faster ethernet support jumbograms.  We run our
> >> > HPC 10G network with an MTU of 9000 (which is 2 pages and a bit more).
> >> >
> >> Ok. So in any case the driver won't poke past ethernet header to look
> >> for the size [Correct?].
> >> So it means only when MTU is bigger than page size would there be a
> >> possibility of skb_frags [Correct?].
> >
> > I'm not sure what kernel version you are looking at, but when I do a search
> for skb_frags in the latest kernel sources at http://lxr.linux.no, I don't see any
> variables or structure members named skb_frags, though it shows up in
> comments in one driver.
> >
> > That being said, I believe skb fragments are also used to implement
> scatter/gather lists of packet payload data, even in packets less than or equal to
> the usual 1500 bytes.
> >
> > On the systems I work with, I've seen this happening in packets originating
> from the target system, i.e. egress path of local traffic.
> I think i get it with egress path since you are actually sending out packet
> possible via scatter/gather. But this skb won't be allocated by the driver, it'll be
> given to the driver by upper networking subsystem. I'm confused about the
> inbound packets, would they ever be having skb fragments [sorry to confuse
> with skb_frags i wasn'
> reffering to structure]?
> 
> I'm more inclined to know from a device driver's perspective if it'll have to
> create an skb when a packet arrives which is non-linear.

I suppose that will be up to the driver and the hardware it supports. I've never worked with a driver that delivers non-linear packets on ingress, but I don't know of any requirement that they not do so. There's also the case of GRO where multiple ingress packets get combined into a single large skb. In that case it might make perfect sense to deliver non-linear skbs on ingress since the original frames may have been DMA'ed into different memory buffers, though I have to admit I don't know the details of the GRO implementation well enough to say whether this in fact happens.

Jeff Haran

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

* Regarding skb and skb_frags
  2014-05-01 10:42 Regarding skb and skb_frags Pranay Srivastava
  2014-05-01 13:59 ` Valdis.Kletnieks at vt.edu
@ 2014-05-13  3:04 ` Li Wei
  1 sibling, 0 replies; 7+ messages in thread
From: Li Wei @ 2014-05-13  3:04 UTC (permalink / raw)
  To: kernelnewbies



On 05/01/2014 06:42 PM, Pranay Srivastava wrote:
> I was going through a function
> 
> dev_alloc_skb
> 
> and it seems that the skb_frags are created only if the data length
> passed is > PAGE_SIZE.
> 
> My question is that an Ethernet frame won't be bigger than 1500 bytes
> [correct?] so there never will be skb_frags for Ethernet frames.

No, you should consider TSO and GSO things.

Thanks

> However I've seen skb_frags appeared when sending large data.
> 
> I'm not sure how to understand this. Does the driver pokes IP header
> to check how many fragments would be coming and decides (on the rcv
> side) how much to pass in dev_alloc_skb ?
> 
> Thanks
> 

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

end of thread, other threads:[~2014-05-13  3:04 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-05-01 10:42 Regarding skb and skb_frags Pranay Srivastava
2014-05-01 13:59 ` Valdis.Kletnieks at vt.edu
2014-05-01 14:09   ` Pranay Srivastava
2014-05-01 16:20     ` Jeff Haran
2014-05-02  3:16       ` Pranay Srivastava
2014-05-02 16:21         ` Jeff Haran
2014-05-13  3:04 ` Li Wei

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.