lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 8 Feb 2010 09:35:19 -0800
From:	"Duyck, Alexander H" <alexander.h.duyck@...el.com>
To:	Herbert Xu <herbert@...dor.apana.org.au>,
	Anton Blanchard <anton@...ba.org>
CC:	"Kirsher, Jeffrey T" <jeffrey.t.kirsher@...el.com>,
	"Brandeburg, Jesse" <jesse.brandeburg@...el.com>,
	"Allan, Bruce W" <bruce.w.allan@...el.com>,
	"Waskiewicz Jr, Peter P" <peter.p.waskiewicz.jr@...el.com>,
	"Ronciak, John" <john.ronciak@...el.com>,
	"divy@...lsio.com" <divy@...lsio.com>,
	"netdev@...r.kernel.org" <netdev@...r.kernel.org>
Subject: RE: MAX_SKB_FRAGS and GRO

Herbert Xu wrote:
> On Mon, Feb 08, 2010 at 09:03:07PM +1100, Anton Blanchard wrote:
>> 
>> I was looking through the hardware GRO support in various drivers
>> and I think we have a couple of issues with PAGE_SIZE > 4k. For
>> example, if we have a 64kB page size then MAX_SKB_FRAGS ends up as 3:
>> 
>> #define MAX_SKB_FRAGS (65536/PAGE_SIZE + 2)
>> 
>> This should be fine for hardware and software GSO, but we encounter
>> issues with hardware GRO (not sure about software GRO).
>> 
>> In the ixgbe case we use MAX_SKB_FRAGS to program the max number of
>> GRO descriptors, even though we assemble GRO packets using
>> ->frag_list: 
>> 
>> #if (MAX_SKB_FRAGS > 16)
>>                 rscctrl |= IXGBE_RSCCTL_MAXDESC_16; #elif
>>                 (MAX_SKB_FRAGS > 8) rscctrl |=
>> IXGBE_RSCCTL_MAXDESC_8; #elif (MAX_SKB_FRAGS > 4)
>>                 rscctrl |= IXGBE_RSCCTL_MAXDESC_4;
>> #else
>>                 rscctrl |= IXGBE_RSCCTL_MAXDESC_1;
>> #endif
> 
> First of all this isn't GRO, but RSC.  With GRO we impose extra
> restrictions on what packets can be merged while RSC is more
> permissive.
> 
> In fact I think the ixgbe code may be broken as it is since it's
> not marking RSC packets in any way to prevent them from being
> forwarded through another interface.
> 
> As to your problem with RSC on a 64K page system, I'm sure one
> of the Intel developers would be able to help you out.
> 
>> Thinking out aloud, would setting a pessimistic value for
>> MAX_SKB_FRAGS 
>> be one way to fix this? ie:
>> 
>> #define MAX_SKB_FRAGS (65536/4096 + 2)
> 
> While I can't think of any serious issues with this, as this is
> an entirely ixgbe-specific problem, the fix should probably stay
> there.
> 
> Cheers,

Herbert is 100% correct, this is HW RSC and not GRO.

When we are using packet split mode we don't use the frag_list, we use frags and just append the buffers as pages.  This is why we use MAX_SKB_FRAGS to determine how many descriptors can be used for a single RSC receive.  The reason for doing it this way is because we can then hand it off to a process like GRO to join up to 3 frames together on systems with 64K pages.

In regards to the bridging/forwarding issue I don't think there is a problem there since we use the LRO flag to determine if HW RSC can be enabled and so typically if you put the port into a forwarding/bridging state HW RSC is automatically disabled.  I will recommend that our validation team double check that though.

If you are running in single buffer mode, which is the mode that uses the frag_list, then you can join up to 16 descriptors as I recall.  However we must avoid joining enough descriptors to result in 64K or more bytes per frame so usually we end up getting a max of 32K per RSC context simply due to the fact that everything is based on powers of 2.

Thanks,

Alex--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ