Skip to contentSkip to conversation

net: Add GSO to vlan_features initialization

RFC PATCH In review Shan Wei 2 participants 4 messages Jun 24, 2011 – Jul 2, 2011

Subsystems (2)
lore
Share & tools
lore

Shan Wei

author
#0 lore raw

RFC PATCH 2/2 net: Add GSO to vlan_features initialization

This patch is not a bug fix.
Just add GSO to vlan_features initialization, and update comments.

---
 net/core/dev.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)
net/core/dev.c +5 -4
index 6b6ef14..becc1e5 100644
@@ -5478,11 +5478,12 @@ int register_netdevice(struct net_device *dev)
 		dev->features |= NETIF_F_NOCACHE_COPY;
 	}
 
-	/* Enable GRO and NETIF_F_HIGHDMA for vlans by default,
-	 * vlan_dev_init() will do the dev->features check, so these features
-	 * are enabled only if supported by underlying device.
+	/* Enable GSO, GRO and NETIF_F_HIGHDMA for vlans by default,
+	 * vlan_dev_fix_features() will do the features check,
+	 * so NETIF_F_HIGHDMA feature is enabled only if supported
+	 * by underlying device.
 	 */
-	dev->vlan_features |= (NETIF_F_GRO | NETIF_F_HIGHDMA);
+	dev->vlan_features |= (NETIF_F_SOFT_FEATURES | NETIF_F_HIGHDMA);
 
 	ret = call_netdevice_notifiers(NETDEV_POST_INIT, dev);
 	ret = notifier_to_errno(ret);
Signature · 1 line
1.7.4.1
#1 lore raw
Quoted 20 lines · Shan Wei

This patch is not a bug fix.
Just add GSO to vlan_features initialization, and update comments.

---
 net/core/dev.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)
net/core/dev.c +0 -3
index 6b6ef14..becc1e5 100644
@@ -5478,11 +5478,12 @@ int register_netdevice(struct net_device *dev)
 		dev->features |= NETIF_F_NOCACHE_COPY;
 	}
 
-	/* Enable GRO and NETIF_F_HIGHDMA for vlans by default,
-	 * vlan_dev_init() will do the dev->features check, so these features
-	 * are enabled only if supported by underlying device.

net/core/dev.c int register_netdevice(struct net_device *dev) · line 5489

Quoted 10 lines
net/core/dev.c +5 -1
+	/* Enable GSO, GRO and NETIF_F_HIGHDMA for vlans by default,
+	 * vlan_dev_fix_features() will do the features check,
+	 * so NETIF_F_HIGHDMA feature is enabled only if supported
+	 * by underlying device.
 	 */
-	dev->vlan_features |= (NETIF_F_GRO | NETIF_F_HIGHDMA);
+	dev->vlan_features |= (NETIF_F_SOFT_FEATURES | NETIF_F_HIGHDMA);
 
 	ret = call_netdevice_notifiers(NETDEV_POST_INIT, dev);
 	ret = notifier_to_errno(ret);

Have you verified that GSO works correctly for VLAN devices if the underlying device does not support VLAN tag insertion? skb_gso_segment() has code to handle this case, but I suspect it's not actually being exercised at the moment.

Ben.

Signature · 3 lines
Ben Hutchings, Senior Software 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.
author
#2 lore raw

Hi Ben:

Ben Hutchings wrote, at 06/25/2011 12:51 AM:

Quoted 2 lines

Have you verified that GSO works correctly for VLAN devices if the underlying device does not support VLAN tag insertion?

OK. I will do some test in future days.
Then report test results.

Signature · 3 lines
Best Regards
-----
Shan Wei
author
#3 lore raw

Hi Ben:

Shan Wei wrote, at 06/28/2011 11:47 AM:

Quoted 8 lines

Hi Ben:

Ben Hutchings wrote, at 06/25/2011 12:51 AM:

Quoted 2 lines

Have you verified that GSO works correctly for VLAN devices if the underlying device does not support VLAN tag insertion?

OK. I will do some test in future days.
Then report test results.

Results is coming....
GSO works correctly for VLAN devices when underlying device is Realtek NIC with 8139too driver.

Network tracepoint shows as following:
<Begin:

       tcpclient-5915  [000]  2114.246780: net_dev_queue: dev=eth1.44 skbaddr=f3051bc0 len=74
       tcpclient-5915  [000]  2114.246790: net_dev_queue: dev=eth1 skbaddr=f3051bc0 len=74
       tcpclient-5915  [000]  2114.246798: net_dev_xmit: dev=eth1 skbaddr=f3051bc0 len=78 rc=0
       tcpclient-5915  [000]  2114.246799: net_dev_xmit: dev=eth1.44 skbaddr=f3051bc0 len=74 rc=0
          <idle>-0     [000]  2114.246905: net_dev_queue: dev=eth1.44 skbaddr=f73cc480 len=66
          <idle>-0     [000]  2114.246908: net_dev_queue: dev=eth1 skbaddr=f73cc480 len=66
          <idle>-0     [000]  2114.246911: net_dev_xmit: dev=eth1 skbaddr=f73cc480 len=70 rc=0
          <idle>-0     [000]  2114.246912: net_dev_xmit: dev=eth1.44 skbaddr=f73cc480 len=66 rc=0
       tcpclient-5915  [000]  2114.247109: net_dev_queue: dev=eth1.44 skbaddr=f3051bc0 len=2962
       tcpclient-5915  [000]  2114.247121: net_dev_queue: dev=eth1 skbaddr=f73cc380 len=1514
       tcpclient-5915  [000]  2114.247130: net_dev_xmit: dev=eth1 skbaddr=f73cc380 len=1518 rc=0
       tcpclient-5915  [000]  2114.247131: net_dev_xmit: dev=eth1.44 skbaddr=f73cc380 len=1514 rc=0
       tcpclient-5915  [000]  2114.247132: net_dev_queue: dev=eth1 skbaddr=f73cc480 len=1514
       tcpclient-5915  [000]  2114.247138: net_dev_xmit: dev=eth1 skbaddr=f73cc480 len=1518 rc=0
       tcpclient-5915  [000]  2114.247139: net_dev_xmit: dev=eth1.44 skbaddr=f73cc480 len=1514 rc=0

end:>

But, test case requires following two patches:
1. Fix broken vlan GSO setting

[PATCH 1/2] net: vlan: enable GSO by default
http://patchwork.ozlabs.org/patch/101714/

2. Fix my 8139too NIC driver that does not initial vlan_features.

drivers/net/8139too.c +1 -1
@@ -993,6 +993,7 @@ static int __devinit rtl8139_init_one (struct pci_dev *pdev,
         * features
         */
        dev->features |= NETIF_F_SG | NETIF_F_HW_CSUM | NETIF_F_HIGHDMA;
+       dev->vlan_features = dev->features;
 
-- 

Best Regards
-----
Shan Wei