netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* gro vs vlan in myri10ge
@ 2012-11-09  2:20 Andrew Gallatin
  2012-11-09  2:41 ` Eric Dumazet
  0 siblings, 1 reply; 4+ messages in thread
From: Andrew Gallatin @ 2012-11-09  2:20 UTC (permalink / raw)
  To: netdev

Hi,

I've wanted to convert myri10ge from LRO to GRO for quite a while.
The problem I'm facing is that the NIC cannot perform hardware vlan
tag offload, so GRO performance is far below LRO performance when
receiving vlan tagged TCP traffic.

If a vlan tagged frame is passed to lro_receive_frags(), inet_lro will
look at the encapsulated IPv4 frame and TCP aggregation will succeed.
However, it appears that GRO will not do this.  When I patch the
driver to use GRO, and configure a vlan interface, I see high CPU
utilization and poor bandwidth when I'm receiving a netperf TCP stream
on the vlan interface.  If I use LRO in an unpatched driver, then I
see good receive performance in the same scenario.

What is the best way to "fix" this?

Unless I'm just using GRO wrong, it seems that the simplest thing for
me to do is to claim NETIF_F_HW_VLAN_RX, but pop the tags in the
driver so as to allow myri10ge to pass up a non-encapsulated frame the
same way that (nearly?) every other 10GbE NIC does.  I've got a quick
and dirty patch that confirms doing the vtag pop in the driver gives
me roughly the same performance with GRO as I used to have with LRO.

Is this (popping vlan tags in the driver) acceptable, or is it
too much of a layering violation?

Thanks,

Drew

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

* Re: gro vs vlan in myri10ge
  2012-11-09  2:20 gro vs vlan in myri10ge Andrew Gallatin
@ 2012-11-09  2:41 ` Eric Dumazet
  2012-11-09 12:47   ` Andrew Gallatin
  2012-11-15 20:39   ` Ben Hutchings
  0 siblings, 2 replies; 4+ messages in thread
From: Eric Dumazet @ 2012-11-09  2:41 UTC (permalink / raw)
  To: Andrew Gallatin; +Cc: netdev

On Thu, 2012-11-08 at 21:20 -0500, Andrew Gallatin wrote:
> Hi,
> 
> I've wanted to convert myri10ge from LRO to GRO for quite a while.
> The problem I'm facing is that the NIC cannot perform hardware vlan
> tag offload, so GRO performance is far below LRO performance when
> receiving vlan tagged TCP traffic.
> 
> If a vlan tagged frame is passed to lro_receive_frags(), inet_lro will
> look at the encapsulated IPv4 frame and TCP aggregation will succeed.
> However, it appears that GRO will not do this.  When I patch the
> driver to use GRO, and configure a vlan interface, I see high CPU
> utilization and poor bandwidth when I'm receiving a netperf TCP stream
> on the vlan interface.  If I use LRO in an unpatched driver, then I
> see good receive performance in the same scenario.
> 
> What is the best way to "fix" this?
> 
> Unless I'm just using GRO wrong, it seems that the simplest thing for
> me to do is to claim NETIF_F_HW_VLAN_RX, but pop the tags in the
> driver so as to allow myri10ge to pass up a non-encapsulated frame the
> same way that (nearly?) every other 10GbE NIC does.  I've got a quick
> and dirty patch that confirms doing the vtag pop in the driver gives
> me roughly the same performance with GRO as I used to have with LRO.
> 
> Is this (popping vlan tags in the driver) acceptable, or is it
> too much of a layering violation?

Given GRO assumes NIC does hardware vlan offloading, I guess
I would chose to do that.

It seems unfortunate to add vlan decap in GRO path, already very
complex.

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

* Re: gro vs vlan in myri10ge
  2012-11-09  2:41 ` Eric Dumazet
@ 2012-11-09 12:47   ` Andrew Gallatin
  2012-11-15 20:39   ` Ben Hutchings
  1 sibling, 0 replies; 4+ messages in thread
From: Andrew Gallatin @ 2012-11-09 12:47 UTC (permalink / raw)
  To: Eric Dumazet; +Cc: netdev

On 11/08/12 21:41, Eric Dumazet wrote:
> On Thu, 2012-11-08 at 21:20 -0500, Andrew Gallatin wrote:
<...>
>> Is this (popping vlan tags in the driver) acceptable, or is it
>> too much of a layering violation?
>
> Given GRO assumes NIC does hardware vlan offloading, I guess
> I would chose to do that.
>
> It seems unfortunate to add vlan decap in GRO path, already very
> complex.

OK, then I will prepare & run through q/a a real patch that does this.

Thanks again,

Drew

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

* Re: gro vs vlan in myri10ge
  2012-11-09  2:41 ` Eric Dumazet
  2012-11-09 12:47   ` Andrew Gallatin
@ 2012-11-15 20:39   ` Ben Hutchings
  1 sibling, 0 replies; 4+ messages in thread
From: Ben Hutchings @ 2012-11-15 20:39 UTC (permalink / raw)
  To: Eric Dumazet, Andrew Gallatin; +Cc: netdev

On Thu, 2012-11-08 at 18:41 -0800, Eric Dumazet wrote:
> On Thu, 2012-11-08 at 21:20 -0500, Andrew Gallatin wrote:
> > Hi,
> > 
> > I've wanted to convert myri10ge from LRO to GRO for quite a while.
> > The problem I'm facing is that the NIC cannot perform hardware vlan
> > tag offload, so GRO performance is far below LRO performance when
> > receiving vlan tagged TCP traffic.

Thanks for the reminder; I need to deal with this in sfc as well.

> > If a vlan tagged frame is passed to lro_receive_frags(), inet_lro will
> > look at the encapsulated IPv4 frame and TCP aggregation will succeed.
> > However, it appears that GRO will not do this.  When I patch the
> > driver to use GRO, and configure a vlan interface, I see high CPU
> > utilization and poor bandwidth when I'm receiving a netperf TCP stream
> > on the vlan interface.  If I use LRO in an unpatched driver, then I
> > see good receive performance in the same scenario.
> > 
> > What is the best way to "fix" this?
> > 
> > Unless I'm just using GRO wrong, it seems that the simplest thing for
> > me to do is to claim NETIF_F_HW_VLAN_RX, but pop the tags in the
> > driver so as to allow myri10ge to pass up a non-encapsulated frame the
> > same way that (nearly?) every other 10GbE NIC does.  I've got a quick
> > and dirty patch that confirms doing the vtag pop in the driver gives
> > me roughly the same performance with GRO as I used to have with LRO.
> > 
> > Is this (popping vlan tags in the driver) acceptable, or is it
> > too much of a layering violation?
> 
> Given GRO assumes NIC does hardware vlan offloading, I guess
> I would chose to do that.

Really, after all the changes in 2.6.37 to unify behaviour between the
offloaded and non-offloaded paths?

> It seems unfortunate to add vlan decap in GRO path, already very
> complex.

True but can't this be done at the top?

I'll post a patch for this shortly.

Ben.

-- 
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.



-- 
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.

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

end of thread, other threads:[~2012-11-15 20:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-11-09  2:20 gro vs vlan in myri10ge Andrew Gallatin
2012-11-09  2:41 ` Eric Dumazet
2012-11-09 12:47   ` Andrew Gallatin
2012-11-15 20:39   ` Ben Hutchings

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).