ixgbe: add GRO to vlan_features
Subsystems (3)
PATCH 1/1 ixgbe: add GRO to vlan_features
When running a vlan -> bridge -> domU setup I was noticing poor RX performance. It seems ixgbe and other drivers don't have NETIF_F_GRO set in vlan_features and thus GRO is off by default for vlans.
I see no reason why the other drivers shouldn't be fixed. If this is OK I will go off and fix the rest.
--- drivers/net/ixgbe/ixgbe_main.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
drivers/net/ixgbe/ixgbe_main.c +1 -0
@@ -6817,6 +6817,7 @@ static int __devinit ixgbe_probe(struct pci_dev *pdev, netdev->vlan_features |=NETIF_F_IP_CSUM ; netdev->vlan_features |=NETIF_F_IPV6_CSUM ; netdev->vlan_features |=NETIF_F_SG ; + netdev->vlan_features |=NETIF_F_GRO ;if (adapter->flags &IXGBE_FLAG_SRIOV_ENABLED ) adapter->flags &= ~(IXGBE_FLAG_RSS_ENABLED |
Signature · 13 lines
1.7.1 ------------------------------------------------------------------------------ Start uncovering the many advantages of virtual appliances and start using them to simplify application deployment and accelerate your shift to cloud computing. http://p.sf.net/sfu/novell-sfdev2dev _______________________________________________ E1000-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/e1000-devel To learn more about Intel® Ethernet, visit http://communities.intel.com/community/wired
David Miller
maintainerFrom: Brandon Philips <[email protected]>
Date: Tue, 14 Sep 2010 18:50:53 -0700
Quoted 8 lines
When running a vlan -> bridge -> domU setup I was noticing poor RX performance. It seems ixgbe and other drivers don't have
NETIF_F_GROset invlan_featuresand thus GRO is off by default for vlans.I see no reason why the other drivers shouldn't be fixed. If this is OK I will go off and fix the rest.
Signed-off-by Brandon Philips <[email protected]>
I think it should be set, but why don't we do this another way?
This feature is a software feature, essentially, so if it is published in netdev->features we can simply propagate it automatically to netdev->vlan_features at device registry time in the core networking.
------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
E1000-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/e1000-devel
To learn more about Intel® Ethernet, visit http://communities.intel.com/community/wired
PATCH 1/1 vlan: enable GRO if real_dev supports it
Currently vlan devices don't have GRO by default as none of the Ethernet drivers add NETIF_F_GRO to their vlan_features.
As GRO is a software feature just propogate GRO from the real_dev in the vlan core. There is no need to have the drivers each add NETIF_F_GRO to their vlan_features.
--- net/8021q/vlan_dev.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
net/8021q/vlan_dev.c +1 -0
@@ -735,6 +735,7 @@ static int vlan_dev_init(struct net_device *dev) (1<<__LINK_STATE_DORMANT))) | (1 <<__LINK_STATE_PRESENT); + dev->features |= real_dev->features &NETIF_F_GRO ; dev->features |= real_dev->features & real_dev->vlan_features; dev->gso_max_size = real_dev->gso_max_size;
Signature · 1 line
1.7.1
Re: [PATCH] vlan: enable GRO if real_dev supports it
Quoted 17 lines · Brandon Philips
Currently vlan devices don't have GRO by default as none of the Ethernet drivers add
NETIF_F_GROto theirvlan_features.As GRO is a software feature just propogate GRO from the
real_devin the vlan core. There is no need to have the drivers each addNETIF_F_GROto theirvlan_features.Signed-off-by Brandon Philips <[email protected]>--- net/8021q/vlan_dev.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)net/8021q/vlan_dev.c +0
-0
net/8021q/vlan_dev.c static int vlan_dev_init(struct net_device *dev) · line 741
Quoted 7 lines
net/8021q/vlan_dev.c +1
-0@@ -735,6 +735,7 @@ static int vlan_dev_init(struct net_device *dev) (1<<__LINK_STATE_DORMANT))) | (1 <<__LINK_STATE_PRESENT); + dev->features |= real_dev->features &NETIF_F_GRO ; dev->features |= real_dev->features & real_dev->vlan_features; dev->gso_max_size = real_dev->gso_max_size;
Hmm, this is only part of a generic solution.
If I enable gro with "ethtool -K eth0 gro on", should we propagate GRO on vlan eth0.555 ?
David Miller
maintainerRe: [PATCH] vlan: enable GRO if real_dev supports it
From: Eric Dumazet <[email protected]>
Date: Wed, 15 Sep 2010 19:08:40 +0200
Quoted 28 lines · Brandon Philips
Quoted 17 lines
Currently vlan devices don't have GRO by default as none of the Ethernet drivers add
NETIF_F_GROto theirvlan_features.As GRO is a software feature just propogate GRO from the
real_devin the vlan core. There is no need to have the drivers each addNETIF_F_GROto theirvlan_features.Signed-off-by Brandon Philips <[email protected]>--- net/8021q/vlan_dev.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)net/8021q/vlan_dev.c +0
-0net/8021q/vlan_dev.c static int vlan_dev_init(struct net_device *dev) · line 741
Quoted 7 lines
net/8021q/vlan_dev.c +1
-0@@ -735,6 +735,7 @@ static int vlan_dev_init(struct net_device *dev) (1<<__LINK_STATE_DORMANT))) | (1 <<__LINK_STATE_PRESENT); + dev->features |= real_dev->features &NETIF_F_GRO ; dev->features |= real_dev->features & real_dev->vlan_features; dev->gso_max_size = real_dev->gso_max_size;Hmm, this is only part of a generic solution.
Quoted 2 lines
If I enable gro with "ethtool -K eth0 gro on", should we propagate GRO on vlan eth0.555 ?
I think a better way to implement this is to set NETIF_F_GRO in netdev->vlan_features at register_netdev() time if it is set in netdev->features
That is the implementation I was implying earlier in this thread.
Re: [PATCH] vlan: enable GRO if real_dev supports it
Quoted 31 lines · David Miller
From: Eric Dumazet <[email protected]>
Date: Wed, 15 Sep 2010 19:08:40 +0200Quoted 28 lines · Brandon Philips
Quoted 17 lines
Currently vlan devices don't have GRO by default as none of the Ethernet drivers add
NETIF_F_GROto theirvlan_features.As GRO is a software feature just propogate GRO from the
real_devin the vlan core. There is no need to have the drivers each addNETIF_F_GROto theirvlan_features.Signed-off-by Brandon Philips <[email protected]>--- net/8021q/vlan_dev.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)net/8021q/vlan_dev.c +0
-0net/8021q/vlan_dev.c static int vlan_dev_init(struct net_device *dev) · line 741
Quoted 7 lines
net/8021q/vlan_dev.c +1
-0@@ -735,6 +735,7 @@ static int vlan_dev_init(struct net_device *dev) (1<<__LINK_STATE_DORMANT))) | (1 <<__LINK_STATE_PRESENT); + dev->features |= real_dev->features &NETIF_F_GRO ; dev->features |= real_dev->features & real_dev->vlan_features; dev->gso_max_size = real_dev->gso_max_size;Hmm, this is only part of a generic solution.
Quoted 8 lines
Quoted 2 lines
If I enable gro with "ethtool -K eth0 gro on", should we propagate GRO on vlan eth0.555 ?
I think a better way to implement this is to set
NETIF_F_GROinnetdev->vlan_featuresatregister_netdev()time if it is set innetdev->featuresThat is the implementation I was implying earlier in this thread.
We can even add it unconditionally there, since we only ever use dev->features & dev->vlan_features.
Ben.
Signature · 3 lines
Ben Hutchings, Senior Software Engineer, Solarflare Communications Not speaking for my employer; that's the marketing department's job. They asked us to note that Solarflare product names are trademarked.
David Miller
maintainerRe: [PATCH] vlan: enable GRO if real_dev supports it
From: Ben Hutchings <[email protected]>
Date: Wed, 15 Sep 2010 18:24:36 +0100
Quoted 9 lines · David Miller
Quoted 5 lines
I think a better way to implement this is to set
NETIF_F_GROinnetdev->vlan_featuresatregister_netdev()time if it is set innetdev->featuresThat is the implementation I was implying earlier in this thread.
We can even add it unconditionally there, since we only ever use
dev->features&dev->vlan_features.
Good point!
PATCH 1/1 net: enable GRO by default for vlan devices
In reply to Ben HutchingsCurrently vlan devices don't have GRO by default as none of the Ethernet drivers add NETIF_F_GRO to their vlan_features.
As GRO is a software feature add GRO to dev->vlan_features in register_netdevice() and let vlan_dev_init() take care that it gets enabled only when dev->features has NETIF_F_GRO too.
--- net/core/dev.c | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-)
net/core/dev.c +5 -0
@@ -5057,6 +5057,11 @@ int register_netdevice(struct net_device *dev)if (dev->features &NETIF_F_SG ) dev->features |=NETIF_F_GSO ; +/* Enable GRO for vlans by default if dev->features has GRO also. +* vlan_dev_init() will do the dev->features check. +*/ + dev->vlan_features |=NETIF_F_GRO ; + ret =call_netdevice_notifiers (NETDEV_POST_INIT , dev); ret =notifier_to_errno (ret);if (ret)
Signature · 13 lines
1.7.1 ------------------------------------------------------------------------------ Start uncovering the many advantages of virtual appliances and start using them to simplify application deployment and accelerate your shift to cloud computing. http://p.sf.net/sfu/novell-sfdev2dev _______________________________________________ E1000-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/e1000-devel To learn more about Intel® Ethernet, visit http://communities.intel.com/community/wired
Re: [PATCH] net: enable GRO by default for vlan devices
Quoted 9 lines · Brandon Philips
Currently vlan devices don't have GRO by default as none of the Ethernet drivers add
NETIF_F_GROto theirvlan_features.As GRO is a software feature add GRO to
dev->vlan_featuresinregister_netdevice()and letvlan_dev_init()take care that it gets enabled only whendev->featureshasNETIF_F_GROtoo.Signed-off-by Brandon Philips <[email protected]>
Re: [PATCH] net: enable GRO by default for vlan devices
Quoted 4 lines · Eric Dumazet
Quoted 3 lines · Brandon Philips
Currently vlan devices don't have GRO by default as none of the Ethernet drivers add
NETIF_F_GROto theirvlan_features.
Quoted 9 lines
Quoted 6 lines
As GRO is a software feature add GRO to
dev->vlan_featuresinregister_netdevice()and letvlan_dev_init()take care that it gets enabled only whendev->featureshasNETIF_F_GROtoo.Signed-off-by Brandon Philips <[email protected]>Acked-by Eric Dumazet <[email protected]>
BTW, we have a similar problem for bonding ( GRO is disabled )
# ethtool -K bond0 gro off # ethtool -K bond0 gro on Cannot set device GRO settings: Invalid argument
Same for vlans on top of bond0
------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
E1000-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/e1000-devel
To learn more about Intel® Ethernet, visit http://communities.intel.com/community/wired
Re: [PATCH] net: enable GRO by default for vlan devices
Quoted 15 lines · On Thu, 16 Sep 2010 00:28:11 +0200 Eric Dumazet <[email protected]> wrote:
Quoted 4 lines · Eric Dumazet
Quoted 3 lines · Brandon Philips
Currently vlan devices don't have GRO by default as none of the Ethernet drivers add
NETIF_F_GROto theirvlan_features.Quoted 9 lines
Quoted 6 lines
As GRO is a software feature add GRO to
dev->vlan_featuresinregister_netdevice()and letvlan_dev_init()take care that it gets enabled only whendev->featureshasNETIF_F_GROtoo.Signed-off-by Brandon Philips <[email protected]>Acked-by Eric Dumazet <[email protected]>
Quoted 7 lines
BTW, we have a similar problem for bonding ( GRO is disabled )
# ethtool -K bond0 gro off # ethtool -K bond0 gro on Cannot set device GRO settings: Invalid argumentSame for vlans on top of bond0
Bridge has same problem as well.
Signature · 10 lines
------------------------------------------------------------------------------ Start uncovering the many advantages of virtual appliances and start using them to simplify application deployment and accelerate your shift to cloud computing. http://p.sf.net/sfu/novell-sfdev2dev _______________________________________________ E1000-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/e1000-devel To learn more about Intel® Ethernet, visit http://communities.intel.com/community/wired
David Miller
maintainerRe: [E1000-devel] [PATCH] net: enable GRO by default for vlan devices
From: Stephen Hemminger <[email protected]>
Date: Wed, 15 Sep 2010 18:16:16 -0700
Quoted 5 lines
Quoted 2 lines · On Thu, 16 Sep 2010 00:28:11 +0200 Eric Dumazet <[email protected]> wrote:
BTW, we have a similar problem for bonding ( GRO is disabled )
Quoted 7 lines
Quoted 5 lines
# ethtool -K bond0 gro off # ethtool -K bond0 gro on Cannot set device GRO settings: Invalid argumentSame for vlans on top of bond0
Bridge has same problem as well.
Looking this over it should be a simple matter of:
1) Adding the generic get/set gro ethtool ops to bonding and bridge device ops.
2) Set NETIF_F_GRO in bond/bridge device flags
3) Maybe some minor fiddling with netdev_increment_features and the flag macros it uses?
Patches welcome :-)
Re: [E1000-devel] [PATCH] net: enable GRO by default for vlan devices
Quoted 21 lines · On Wed, 15 Sep 2010 22:51:46 -0700 (PDT) David Miller <[email protected]>…
From: Stephen Hemminger <[email protected]>
Date: Wed, 15 Sep 2010 18:16:16 -0700Quoted 5 lines
Quoted 2 lines · On Thu, 16 Sep 2010 00:28:11 +0200 Eric Dumazet <[email protected]> wrote:
BTW, we have a similar problem for bonding ( GRO is disabled )
Quoted 7 lines
Quoted 5 lines
# ethtool -K bond0 gro off # ethtool -K bond0 gro on Cannot set device GRO settings: Invalid argumentSame for vlans on top of bond0
Bridge has same problem as well.
Looking this over it should be a simple matter of:
1) Adding the generic get/set gro ethtool ops to bonding and bridge device ops.
Quoted 6 lines
2) Set
NETIF_F_GROin bond/bridge device flags3) Maybe some minor fiddling with
netdev_increment_featuresand the flag macros it uses?Patches welcome :-)
I think it is more complex than that. GRO is tied to NAPI,
and bridge/bond don't use NAPI directly. They use netif_rx() for receiving because layered drivers can't directly up call because of possible issues with stack depth.
To get GRO working for netif_rx case,
the logic in process_backlog would have to change. But this queue is processing packets from multiple devices so it is not clear if GRO could be used.
David Miller
maintainerRe: [E1000-devel] [PATCH] net: enable GRO by default for vlan devices
From: Stephen Hemminger <[email protected]>
Date: Wed, 15 Sep 2010 23:21:25 -0700
Quoted 9 lines
I think it is more complex than that. GRO is tied to NAPI,
and bridge/bond don't use NAPI directly. They usenetif_rx()for receiving because layered drivers can't directly up call because of possible issues with stack depth.To get GRO working for
netif_rxcase,
the logic inprocess_backlogwould have to change. But this queue is processing packets from multiple devices so it is not clear if GRO could be used.
Bonding's un-layering on RX is done in the normal netif_receive_skb() control flow.
And bridging only uses netif_rx for multicast replication.
Re: [E1000-devel] [PATCH] net: enable GRO by default for vlan devices
Quoted 13 lines · David Miller
From: Stephen Hemminger <[email protected]>
Date: Wed, 15 Sep 2010 23:21:25 -0700Quoted 9 lines
I think it is more complex than that. GRO is tied to NAPI,
and bridge/bond don't use NAPI directly. They usenetif_rx()for receiving because layered drivers can't directly up call because of possible issues with stack depth.To get GRO working for
netif_rxcase,
the logic inprocess_backlogwould have to change. But this queue is processing packets from multiple devices so it is not clear if GRO could be used.
Quoted 4 lines
Bonding's un-layering on RX is done in the normal
netif_receive_skb()control flow.And bridging only uses
netif_rxfor multicast replication.
Yes, bonding case should be easy, I'll take a look today.
PATCH 1/1 ethtool: change ethtool_set_gro() to use ethtool_op_get_rx_csum
Quoted 14 lines · Eric Dumazet
Quoted 13 lines · David Miller
From: Stephen Hemminger <[email protected]>
Date: Wed, 15 Sep 2010 23:21:25 -0700Quoted 9 lines
I think it is more complex than that. GRO is tied to NAPI,
and bridge/bond don't use NAPI directly. They usenetif_rx()for receiving because layered drivers can't directly up call because of possible issues with stack depth.To get GRO working for
netif_rxcase,
the logic inprocess_backlogwould have to change. But this queue is processing packets from multiple devices so it is not clear if GRO could be used.
Quoted 7 lines
Quoted 4 lines
Bonding's un-layering on RX is done in the normal
netif_receive_skb()control flow.And bridging only uses
netif_rxfor multicast replication.Yes, bonding case should be easy, I'll take a look today.
[PATCH] ethtool: change ethtool_set_gro() to use ethtool_op_get_rx_csum
To be able to switch on GRO on a device, ethtool_set_gro() checks this device provides a get_rx_csum() method.
Some devices dont provide this method, while they do support RX checksumming.
This patch allows bonding to support GRO :
ethtool -K bond0 gro on
--- net/core/ethtool.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
net/core/ethtool.c +5 -2
@@ -1175,8 +1175,11 @@ static int ethtool_set_gro(struct net_device *dev, char __user *useraddr)return -EFAULT ;if (edata.data) { -if (!dev->ethtool_ops->get_rx_csum || - !dev->ethtool_ops->get_rx_csum (dev)) +u32 rxcsum = dev->ethtool_ops->get_rx_csum ? + dev->ethtool_ops->get_rx_csum (dev) : +ethtool_op_get_rx_csum (dev); + +if (!rxcsum)return -EINVAL ; dev->features |=NETIF_F_GRO ; }else
Re: [PATCH] ethtool: change ethtool_set_gro() to use ethtool_op_get_rx_csum
From: Eric Dumazet <[email protected]>
Date: Thu, 16 Sep 2010 10:11:03 +0200
Quoted 5 lines
[PATCH] ethtool: change
ethtool_set_gro()to useethtool_op_get_rx_csumTo be able to switch on GRO on a device,
ethtool_set_gro()checks this device provides aget_rx_csum()method.
Quoted 8 lines
Some devices dont provide this method, while they do support RX checksumming.
This patch allows bonding to support GRO :
ethtool -K bond0 gro on
Signed-off-by Eric Dumazet <[email protected]>
Applied, thanks Eric.
Can you do whatever change is needed to get it enabled by default?
Thanks again.
PATCH 1/1 bonding: enable gro by default
Quoted 4 lines · David Miller
Applied, thanks Eric.
Can you do whatever change is needed to get it enabled by default?
Sure ;)
[PATCH] bonding: enable gro by default
gro can be enabled by default on bonding devices.
Actual support depends on the lower devices.
One can still use ethtool to switch off GRO if needed.
--- drivers/net/bonding/bond_main.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/net/bonding/bond_main.c +4 -0
@@ -4678,6 +4678,10 @@ static void bond_setup(struct net_device *bond_dev)NETIF_F_HW_VLAN_RX | NETIF_F_HW_VLAN_FILTER); +/* By default, we enable GRO on bonding devices. +* Actual support requires lowlevel drivers are GRO ready. +*/ + bond_dev->features |=NETIF_F_GRO ; }static void bond_work_cancel_all (struct bonding *bond)
Re: [PATCH] bonding: enable gro by default
From: Eric Dumazet <[email protected]>
Date: Fri, 17 Sep 2010 21:25:07 +0200
Quoted 7 lines
gro can be enabled by default on bonding devices.
Actual support depends on the lower devices.
One can still use ethtool to switch off GRO if needed.
Signed-off-by Eric Dumazet <[email protected]>
Applied, thanks Eric.
------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
E1000-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/e1000-devel
To learn more about Intel® Ethernet, visit http://communities.intel.com/community/wired
Re: [PATCH] net: enable GRO by default for vlan devices
In reply to Eric DumazetFrom: Eric Dumazet <[email protected]>
Date: Thu, 16 Sep 2010 00:03:23 +0200
Quoted 12 lines · Brandon Philips
Quoted 9 lines
Currently vlan devices don't have GRO by default as none of the Ethernet drivers add
NETIF_F_GROto theirvlan_features.As GRO is a software feature add GRO to
dev->vlan_featuresinregister_netdevice()and letvlan_dev_init()take care that it gets enabled only whendev->featureshasNETIF_F_GROtoo.Signed-off-by Brandon Philips <[email protected]>Acked-by Eric Dumazet <[email protected]>
Applied.
Re: [PATCH] vlan: enable GRO if real_dev supports it
In reply to Eric DumazetQuoted 28 lines · Eric Dumazet
Quoted 17 lines · Brandon Philips
Currently vlan devices don't have GRO by default as none of the Ethernet drivers add
NETIF_F_GROto theirvlan_features.As GRO is a software feature just propogate GRO from the
real_devin the vlan core. There is no need to have the drivers each addNETIF_F_GROto theirvlan_features.Signed-off-by Brandon Philips <[email protected]>--- net/8021q/vlan_dev.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)net/8021q/vlan_dev.c +0
-0net/8021q/vlan_dev.c static int vlan_dev_init(struct net_device *dev) · line 741
Quoted 7 lines
net/8021q/vlan_dev.c +1
-0@@ -735,6 +735,7 @@ static int vlan_dev_init(struct net_device *dev) (1<<__LINK_STATE_DORMANT))) | (1 <<__LINK_STATE_PRESENT); + dev->features |= real_dev->features &NETIF_F_GRO ; dev->features |= real_dev->features & real_dev->vlan_features; dev->gso_max_size = real_dev->gso_max_size;Hmm, this is only part of a generic solution.
Quoted 2 lines
If I enable gro with "ethtool -K eth0 gro on", should we propagate GRO on vlan eth0.555 ?
That works fine as far as I can see. I don't think it should go the other way though.
Cheers, Brandon
Quoted 10 lines · David Miller
From: Brandon Philips <[email protected]>
Date: Tue, 14 Sep 2010 18:50:53 -0700Quoted 7 lines
When running a vlan -> bridge -> domU setup I was noticing poor RX performance. It seems ixgbe and other drivers don't have
NETIF_F_GROset invlan_featuresand thus GRO is off by default for vlans.I see no reason why the other drivers shouldn't be fixed. If this is OK I will go off and fix the rest.
Quoted 7 lines
Quoted 1 line
Signed-off-by Brandon Philips <[email protected]>I think it should be set, but why don't we do this another way?
This feature is a software feature, essentially, so if it is published in
netdev->featureswe can simply propagate it automatically tonetdev->vlan_featuresat device registry time in the core networking.
Agreed. I will just send a patch to vlan_dev.c then.