Skip to contentSkip to conversation

net: use NETIF_F_ALL_TSO for vlan features

PATCH RESEND Dimitris Michailidis 3 participants 5 messages May 11, 2011 – May 13, 2011 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore
#1 lore raw
In reply to a message not in the archive
Quoted 4 lines · Shan Wei

As Dimitris Michailidis suggested, use NETIF_F_ALL_TSO for vlan_features, which is a mask, but not hw_features.

While these changes aren't wrong I don't see a good reason to make them. I am also curious why you're changing only these three drivers.

Quoted 45 lines
---
 drivers/net/bnx2x/bnx2x_main.c     |    2 +-
 drivers/net/cxgb4/cxgb4_main.c     |    2 +-
 drivers/net/cxgb4vf/cxgb4vf_main.c |    2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
drivers/net/bnx2x/bnx2x_main.c +1 -1
index 2762edf..172684b 100644
@@ -9267,7 +9267,7 @@ static int __devinit bnx2x_init_dev(struct pci_dev *pdev,
 		NETIF_F_RXCSUM | NETIF_F_LRO | NETIF_F_HW_VLAN_TX;
 
 	dev->vlan_features = NETIF_F_SG | NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM |
-		NETIF_F_TSO | NETIF_F_TSO_ECN | NETIF_F_TSO6 | NETIF_F_HIGHDMA;
+		NETIF_F_ALL_TSO | NETIF_F_HIGHDMA;
 
 	dev->features |= dev->hw_features | NETIF_F_HW_VLAN_RX;
 	if (bp->flags & USING_DAC_FLAG)
drivers/net/cxgb4/cxgb4_main.c +1 -1
index 7e3cfbe..21a163c 100644
@@ -3528,7 +3528,7 @@ static void free_some_resources(struct adapter *adapter)
 }
 
 #define TSO_FLAGS (NETIF_F_TSO | NETIF_F_TSO6 | NETIF_F_TSO_ECN)
-#define VLAN_FEAT (NETIF_F_SG | NETIF_F_IP_CSUM | TSO_FLAGS | \
+#define VLAN_FEAT (NETIF_F_SG | NETIF_F_IP_CSUM | NETIF_F_ALL_TSO | \
 		   NETIF_F_IPV6_CSUM | NETIF_F_HIGHDMA)
 
 static int __devinit init_one(struct pci_dev *pdev,
drivers/net/cxgb4vf/cxgb4vf_main.c +1 -1
index e71c08e..b55c521 100644
@@ -2604,7 +2604,7 @@ static int __devinit cxgb4vf_pci_probe(struct pci_dev *pdev,
 		netdev->hw_features = NETIF_F_SG | TSO_FLAGS |
 			NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM |
 			NETIF_F_HW_VLAN_TX | NETIF_F_RXCSUM;
-		netdev->vlan_features = NETIF_F_SG | TSO_FLAGS |
+		netdev->vlan_features = NETIF_F_SG | NETIF_F_ALL_TSO |
 			NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM |
 			NETIF_F_HIGHDMA;
 		netdev->features = netdev->hw_features |
#2 lore raw

Dimitris Michailidis wrote, at 2011年05月12日 00:35:

Quoted 7 lines · Shan Wei
Quoted 4 lines

As Dimitris Michailidis suggested, use NETIF_F_ALL_TSO for vlan_features, which is a mask, but not hw_features.

While these changes aren't wrong I don't see a good reason to make them. I am also curious why you're changing only these three drivers.

A personal reason to quickly know what device supports ALL TSO, not to search one by one. :;)

TSO offloads are assigned directly in these three drivers.
Other drivers set vlan_features as hw_features, or set TSO offloads after doing some check.

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

Dimitris Michailidis wrote, at 2011年05月12日 00:35:

Quoted 6 lines · Shan Wei
Quoted 4 lines

As Dimitris Michailidis suggested, use NETIF_F_ALL_TSO for vlan_features, which is a mask, but not hw_features.

While these changes aren't wrong I don't see a good reason to make them. I am also curious why you're changing only these three drivers.

A personal reason to quickly know what device supports ALL TSO, not to search one by one. :;)

But vlan_features doesn't indicate by itself what the device supports, and it is because of this that you can use NETIF_F_ALL_TSO in vlan_features without much future breakage risk. There's still the potential that in the future some additional TSO variant will be added that some of the drivers you're changing support, but not over VLANs, and then they'll need to undo you change.

If you want to know which drivers support all TSOs you really need to look at their features and hw_features. One could set NETIF_F_ALL_TSO in vlan_features of a driver that doesn't support any form of TSO. The way you're checking you'd be misled into thinking that driver supports all TSO.

maintainer
#5 lore raw
In reply to Shan Wei

From: Shan Wei <[email protected]>
Date: Fri, 13 May 2011 10:10:21 +0800

Quoted 6 lines

Dimitris Michailidis wrote, at 2011年05月13日 01:05:

Quoted 1 line

But vlan_features doesn't indicate by itself what the device supports, and it is because of this that you can use NETIF_F_ALL_TSO in vlan_features without much future breakage risk. There's still the potential that in the future some additional TSO variant will be added that some of the drivers you're changing support, but not over VLANs, and then they'll need to undo you change.

For this part.

David, please discard this patch.

Shan I've discarded all of your patches in this series.

#4 lore raw
In reply to Dimitris Michailidis

Dimitris Michailidis wrote, at 2011年05月13日 01:05:

Quoted 1 line

But vlan_features doesn't indicate by itself what the device supports, and it is because of this that you can use NETIF_F_ALL_TSO in vlan_features without much future breakage risk. There's still the potential that in the future some additional TSO variant will be added that some of the drivers you're changing support, but not over VLANs, and then they'll need to undo you change.

For this part.

David, please discard this patch.

Signature · 3 lines
Best Regards
-----
Shan Wei