Skip to contentSkip to conversation

e1000/e1000e/igb/ixgb/ixgbe: set NETIF_F_HIGHDMA for VLAN feature flags

PATCH Applied Jeff Kirsher 4 participants 10 messages Sep 23, 2010 – Sep 27, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 e1000/e1000e/igb/ixgb/ixgbe: set NETIF_F_HIGHDMA for VLAN feature flags

From: Yi Zou <[email protected]>

If the netdev->features is set with NETIF_F_HIGHDMA, we should set the corresponding netdev->vlan_features as well to allow VLAN netdev created on top of the real netdev to be able to also benefit from HIGHDMA on 32bit system, reducing the performance hit that is caused by __skb_linearize(), particularly for large send. This is fixed in this patch for all Intel e1000, e1000e, igb, ixgbe, and ixgbe drivers since this should be beneficial to all devices supported by these drivers.

---

 drivers/net/e1000/e1000_main.c |    4 +++-
 drivers/net/e1000e/netdev.c    |    4 +++-
 drivers/net/igb/igb_main.c     |    4 +++-
 drivers/net/ixgb/ixgb_main.c   |    4 +++-
 drivers/net/ixgbe/ixgbe_main.c |    4 +++-
 5 files changed, 15 insertions(+), 5 deletions(-)
drivers/net/e1000/e1000_main.c +3 -1
index 8d9269d..a1dacea 100644
@@ -988,8 +988,10 @@ static int __devinit e1000_probe(struct pci_dev *pdev,
 	   (hw->mac_type != e1000_82547))
 		netdev->features |= NETIF_F_TSO;
 
-	if (pci_using_dac)
+	if (pci_using_dac) {
 		netdev->features |= NETIF_F_HIGHDMA;
+		netdev->vlan_features |= NETIF_F_HIGHDMA;
+	}
 
 	netdev->vlan_features |= NETIF_F_TSO;
 	netdev->vlan_features |= NETIF_F_HW_CSUM;
drivers/net/e1000e/netdev.c +3 -1
index e2c7e0d..4630bad 100644
@@ -5683,8 +5683,10 @@ static int __devinit e1000_probe(struct pci_dev *pdev,
 	netdev->vlan_features |= NETIF_F_HW_CSUM;
 	netdev->vlan_features |= NETIF_F_SG;
 
-	if (pci_using_dac)
+	if (pci_using_dac) {
 		netdev->features |= NETIF_F_HIGHDMA;
+		netdev->vlan_features |= NETIF_F_HIGHDMA;
+	}
 
 	if (e1000e_enable_mng_pass_thru(&adapter->hw))
 		adapter->flags |= FLAG_MNG_PT_ENABLED;
drivers/net/igb/igb_main.c +3 -1
index 61892b8..f915e9c 100644
@@ -1858,8 +1858,10 @@ static int __devinit igb_probe(struct pci_dev *pdev,
 	netdev->vlan_features |= NETIF_F_IPV6_CSUM;
 	netdev->vlan_features |= NETIF_F_SG;
 
-	if (pci_using_dac)
+	if (pci_using_dac) {
 		netdev->features |= NETIF_F_HIGHDMA;
+		netdev->vlan_features |= NETIF_F_HIGHDMA;
+	}
 
 	if (hw->mac.type >= e1000_82576)
 		netdev->features |= NETIF_F_SCTP_CSUM;
drivers/net/ixgb/ixgb_main.c +3 -1
index c2f6e71..80e6257 100644
@@ -446,8 +446,10 @@ ixgb_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 			   NETIF_F_HW_VLAN_FILTER;
 	netdev->features |= NETIF_F_TSO;
 
-	if (pci_using_dac)
+	if (pci_using_dac) {
 		netdev->features |= NETIF_F_HIGHDMA;
+		netdev->vlan_features |= NETIF_F_HIGHDMA;
+	}
 
 	/* make sure the EEPROM is good */
 
drivers/net/ixgbe/ixgbe_main.c +3 -1
index d03eef9..0ec4ef2 100644
@@ -6842,8 +6842,10 @@ static int __devinit ixgbe_probe(struct pci_dev *pdev,
 		netdev->vlan_features |= NETIF_F_FCOE_MTU;
 	}
 #endif /* IXGBE_FCOE */
-	if (pci_using_dac)
+	if (pci_using_dac) {
 		netdev->features |= NETIF_F_HIGHDMA;
+		netdev->vlan_features |= NETIF_F_HIGHDMA;
+	}
 
 	if (adapter->flags2 & IXGBE_FLAG2_RSC_ENABLED)
 		netdev->features |= NETIF_F_LRO;
maintainer Applied
#1 lore raw

From: Jeff Kirsher <[email protected]>
Date: Wed, 22 Sep 2010 20:57:58 -0700

Quoted 10 lines

From: Yi Zou <[email protected]>

If the netdev->features is set with NETIF_F_HIGHDMA, we should set the corresponding netdev->vlan_features as well to allow VLAN netdev created on top of the real netdev to be able to also benefit from HIGHDMA on 32bit system, reducing the performance hit that is caused by __skb_linearize(), particularly for large send. This is fixed in this patch for all Intel e1000, e1000e, igb, ixgbe, and ixgbe drivers since this should be beneficial to all devices supported by these drivers.

Quoted 3 lines

Applied.

#2 lore raw
Quoted 13 lines · David Miller

From: Jeff Kirsher <[email protected]>
Date: Wed, 22 Sep 2010 20:57:58 -0700

Quoted 10 lines

From: Yi Zou <[email protected]>

If the netdev->features is set with NETIF_F_HIGHDMA, we should set the corresponding netdev->vlan_features as well to allow VLAN netdev created on top of the real netdev to be able to also benefit from HIGHDMA on 32bit system, reducing the performance hit that is caused by __skb_linearize(), particularly for large send. This is fixed in this patch for all Intel e1000, e1000e, igb, ixgbe, and ixgbe drivers since this should be beneficial to all devices supported by these drivers.

Quoted 5 lines
Quoted 3 lines

Applied.

Maybe this could be done in core network.

maintainer
#3 lore raw

From: Eric Dumazet <[email protected]>
Date: Thu, 23 Sep 2010 07:28:10 +0200

Quoted 14 lines · David Miller
Quoted 13 lines

From: Jeff Kirsher <[email protected]>
Date: Wed, 22 Sep 2010 20:57:58 -0700

Quoted 10 lines

From: Yi Zou <[email protected]>

If the netdev->features is set with NETIF_F_HIGHDMA, we should set the corresponding netdev->vlan_features as well to allow VLAN netdev created on top of the real netdev to be able to also benefit from HIGHDMA on 32bit system, reducing the performance hit that is caused by __skb_linearize(), particularly for large send. This is fixed in this patch for all Intel e1000, e1000e, igb, ixgbe, and ixgbe drivers since this should be beneficial to all devices supported by these drivers.

Quoted 7 lines
Quoted 5 lines
Quoted 3 lines

Applied.

Maybe this could be done in core network.

Indeeed, just as we do for NETIF_F_GRO now.

#4 lore raw
In reply to Eric Dumazet
Quoted 14 lines · Eric Dumazet
Quoted 13 lines · David Miller

From: Jeff Kirsher <[email protected]>
Date: Wed, 22 Sep 2010 20:57:58 -0700

Quoted 10 lines

From: Yi Zou <[email protected]>

If the netdev->features is set with NETIF_F_HIGHDMA, we should set the corresponding netdev->vlan_features as well to allow VLAN netdev created on top of the real netdev to be able to also benefit from HIGHDMA on 32bit system, reducing the performance hit that is caused by __skb_linearize(), particularly for large send. This is fixed in this patch for all Intel e1000, e1000e, igb, ixgbe, and ixgbe drivers since this should be beneficial to all devices supported by these drivers.

Quoted 10 lines
Quoted 5 lines
Quoted 3 lines

Applied.

Maybe this could be done in core network.

Good suggestion! Do you plan on making a patch Eric? Let me know of any assistance
you need with the Intel LAN dirvers.

#5 lore raw
Quoted 3 lines · Jeff Kirsher

Good suggestion! Do you plan on making a patch Eric? Let me know of any assistance
you need with the Intel LAN dirvers.

Yes, I'll do it, no worry :)

Thanks !

#6 lore raw
Quoted 10 lines · Eric Dumazet
Quoted 3 lines · Jeff Kirsher

Good suggestion!  Do you plan on making a patch Eric?  Let me know of any assistance
you need with the Intel LAN dirvers.

Yes, I'll do it, no worry :)

Thanks !

Thank you Eric! I greatly appreciate the work and suggestions.

#7 lore raw

PATCH 1/1 net: propagate NETIF_F_HIGHDMA to vlans

In reply to Eric Dumazet

Automatically allows vlans to get NETIF_F_HIGHDMA if underlying device supports it.

On 32bit arches (and more precisely if CONFIG_HIGHMEM is enabled), it can help to reduce cost of illegal_highdma() and __skb_linearize() calls.

Tested on tg3 , bnx2, bonding, this worked very well.

This is a generalization of a patch provided by Yi Zou & Jeff Kirsher.

---
 net/core/dev.c |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
net/core/dev.c +4 -3
index 2c7934f..e0c0b86 100644
@@ -5058,10 +5058,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.
+	/* 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.
 	 */
-	dev->vlan_features |= NETIF_F_GRO;
+	dev->vlan_features |= (NETIF_F_GRO | NETIF_F_HIGHDMA);
 
 	ret = call_netdevice_notifiers(NETDEV_POST_INIT, dev);
 	ret = notifier_to_errno(ret);
#8 lore raw

RE: [PATCH net-next-2.6] net: propagate NETIF_F_HIGHDMA to vlans

Quoted 31 lines

Automatically allows vlans to get NETIF_F_HIGHDMA if underlying device supports it.

On 32bit arches (and more precisely if CONFIG_HIGHMEM is enabled), it can help to reduce cost of illegal_highdma() and __skb_linearize() calls.

Tested on tg3 , bnx2, bonding, this worked very well.

This is a generalization of a patch provided by Yi Zou & Jeff Kirsher.

---
 net/core/dev.c |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
net/core/dev.c +2 -2
index 2c7934f..e0c0b86 100644
@@ -5058,10 +5058,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.
+	/* Enable GRO and NETIF_F_HIGHDMA for vlans by default,
+	 * vlan_dev_init() will do the dev->features check, so these

features

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

Quoted 7 lines
net/core/dev.c +2 -1
+	 * are enabled only if supported by underlying device.
 	 */
-	dev->vlan_features |= NETIF_F_GRO;
+	dev->vlan_features |= (NETIF_F_GRO | NETIF_F_HIGHDMA);
 
 	ret = call_netdevice_notifiers(NETDEV_POST_INIT, dev);
 	ret = notifier_to_errno(ret);

Cool, thanks for taking care of this, Eric.

-yi

maintainer Applied
#9 lore raw

Re: [PATCH net-next-2.6] net: propagate NETIF_F_HIGHDMA to vlans

In reply to Eric Dumazet

From: Eric Dumazet <[email protected]>
Date: Thu, 23 Sep 2010 12:46:11 +0200

Quoted 7 lines

Automatically allows vlans to get NETIF_F_HIGHDMA if underlying device supports it.

On 32bit arches (and more precisely if CONFIG_HIGHMEM is enabled), it can help to reduce cost of illegal_highdma() and __skb_linearize() calls.

Quoted 5 lines

Tested on tg3 , bnx2, bonding, this worked very well.

This is a generalization of a patch provided by Yi Zou & Jeff Kirsher.

Applied, thanks Eric.