diff options
author | David S. Miller <davem@davemloft.net> | 2014-03-28 17:17:16 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-03-28 17:17:16 -0400 |
commit | 5f2feca20e0f4878fa16787bd50fcd82fb365be7 (patch) | |
tree | 1761471976beb97edab677ab211326b62a2809ad | |
parent | fc92f745f8d0d3736ce5afb00a905d7cc61f9c46 (diff) | |
parent | 2adb956b084d6d49f519541a4b5f9947e96f8ef7 (diff) |
Merge branch 'vlan_offloads'
Vlad Yasevich says:
====================
Audit all drivers for correct vlan_features.
Some drivers set vlan acceleration features in vlan_features. This causes
issues with Q-in-Q/802.1ad configurations.
Audit all the drivers for correct vlan_features. Fix broken ones.
Add a warning to vlan code to help catch future offenders.
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/ethernet/qlogic/qlge/qlge_main.c | 4 | ||||
-rw-r--r-- | drivers/net/ifb.c | 3 | ||||
-rw-r--r-- | drivers/net/veth.c | 5 | ||||
-rw-r--r-- | include/linux/netdev_features.h | 7 | ||||
-rw-r--r-- | net/8021q/vlan_dev.c | 3 |
5 files changed, 19 insertions, 3 deletions
diff --git a/drivers/net/ethernet/qlogic/qlge/qlge_main.c b/drivers/net/ethernet/qlogic/qlge/qlge_main.c index ce2cfddbed50..656c65ddadb4 100644 --- a/drivers/net/ethernet/qlogic/qlge/qlge_main.c +++ b/drivers/net/ethernet/qlogic/qlge/qlge_main.c | |||
@@ -4765,7 +4765,9 @@ static int qlge_probe(struct pci_dev *pdev, | |||
4765 | ndev->features = ndev->hw_features; | 4765 | ndev->features = ndev->hw_features; |
4766 | ndev->vlan_features = ndev->hw_features; | 4766 | ndev->vlan_features = ndev->hw_features; |
4767 | /* vlan gets same features (except vlan filter) */ | 4767 | /* vlan gets same features (except vlan filter) */ |
4768 | ndev->vlan_features &= ~NETIF_F_HW_VLAN_CTAG_FILTER; | 4768 | ndev->vlan_features &= ~(NETIF_F_HW_VLAN_CTAG_FILTER | |
4769 | NETIF_F_HW_VLAN_CTAG_TX | | ||
4770 | NETIF_F_HW_VLAN_CTAG_RX); | ||
4769 | 4771 | ||
4770 | if (test_bit(QL_DMA64, &qdev->flags)) | 4772 | if (test_bit(QL_DMA64, &qdev->flags)) |
4771 | ndev->features |= NETIF_F_HIGHDMA; | 4773 | ndev->features |= NETIF_F_HIGHDMA; |
diff --git a/drivers/net/ifb.c b/drivers/net/ifb.c index c14d39bf32d0..d7b2e947184b 100644 --- a/drivers/net/ifb.c +++ b/drivers/net/ifb.c | |||
@@ -180,7 +180,8 @@ static void ifb_setup(struct net_device *dev) | |||
180 | dev->tx_queue_len = TX_Q_LIMIT; | 180 | dev->tx_queue_len = TX_Q_LIMIT; |
181 | 181 | ||
182 | dev->features |= IFB_FEATURES; | 182 | dev->features |= IFB_FEATURES; |
183 | dev->vlan_features |= IFB_FEATURES; | 183 | dev->vlan_features |= IFB_FEATURES & ~(NETIF_F_HW_VLAN_CTAG_TX | |
184 | NETIF_F_HW_VLAN_STAG_TX); | ||
184 | 185 | ||
185 | dev->flags |= IFF_NOARP; | 186 | dev->flags |= IFF_NOARP; |
186 | dev->flags &= ~IFF_MULTICAST; | 187 | dev->flags &= ~IFF_MULTICAST; |
diff --git a/drivers/net/veth.c b/drivers/net/veth.c index 5b374370f71c..c0e7c64765ab 100644 --- a/drivers/net/veth.c +++ b/drivers/net/veth.c | |||
@@ -286,7 +286,10 @@ static void veth_setup(struct net_device *dev) | |||
286 | dev->features |= NETIF_F_LLTX; | 286 | dev->features |= NETIF_F_LLTX; |
287 | dev->features |= VETH_FEATURES; | 287 | dev->features |= VETH_FEATURES; |
288 | dev->vlan_features = dev->features & | 288 | dev->vlan_features = dev->features & |
289 | ~(NETIF_F_HW_VLAN_CTAG_TX | NETIF_F_HW_VLAN_STAG_TX); | 289 | ~(NETIF_F_HW_VLAN_CTAG_TX | |
290 | NETIF_F_HW_VLAN_STAG_TX | | ||
291 | NETIF_F_HW_VLAN_CTAG_RX | | ||
292 | NETIF_F_HW_VLAN_STAG_RX); | ||
290 | dev->destructor = veth_dev_free; | 293 | dev->destructor = veth_dev_free; |
291 | 294 | ||
292 | dev->hw_features = VETH_FEATURES; | 295 | dev->hw_features = VETH_FEATURES; |
diff --git a/include/linux/netdev_features.h b/include/linux/netdev_features.h index 1005ebf17575..5a09a48f2658 100644 --- a/include/linux/netdev_features.h +++ b/include/linux/netdev_features.h | |||
@@ -163,4 +163,11 @@ enum { | |||
163 | /* changeable features with no special hardware requirements */ | 163 | /* changeable features with no special hardware requirements */ |
164 | #define NETIF_F_SOFT_FEATURES (NETIF_F_GSO | NETIF_F_GRO) | 164 | #define NETIF_F_SOFT_FEATURES (NETIF_F_GSO | NETIF_F_GRO) |
165 | 165 | ||
166 | #define NETIF_F_VLAN_FEATURES (NETIF_F_HW_VLAN_CTAG_FILTER | \ | ||
167 | NETIF_F_HW_VLAN_CTAG_RX | \ | ||
168 | NETIF_F_HW_VLAN_CTAG_TX | \ | ||
169 | NETIF_F_HW_VLAN_STAG_FILTER | \ | ||
170 | NETIF_F_HW_VLAN_STAG_RX | \ | ||
171 | NETIF_F_HW_VLAN_STAG_TX) | ||
172 | |||
166 | #endif /* _LINUX_NETDEV_FEATURES_H */ | 173 | #endif /* _LINUX_NETDEV_FEATURES_H */ |
diff --git a/net/8021q/vlan_dev.c b/net/8021q/vlan_dev.c index a9591ff2b678..27bfe2f8e2de 100644 --- a/net/8021q/vlan_dev.c +++ b/net/8021q/vlan_dev.c | |||
@@ -578,6 +578,9 @@ static int vlan_dev_init(struct net_device *dev) | |||
578 | 578 | ||
579 | dev->features |= real_dev->vlan_features | NETIF_F_LLTX; | 579 | dev->features |= real_dev->vlan_features | NETIF_F_LLTX; |
580 | dev->gso_max_size = real_dev->gso_max_size; | 580 | dev->gso_max_size = real_dev->gso_max_size; |
581 | if (dev->features & NETIF_F_VLAN_FEATURES) | ||
582 | netdev_warn(real_dev, "VLAN features are set incorrectly. Q-in-Q configurations may not work correctly.\n"); | ||
583 | |||
581 | 584 | ||
582 | /* ipv6 shared card related stuff */ | 585 | /* ipv6 shared card related stuff */ |
583 | dev->dev_id = real_dev->dev_id; | 586 | dev->dev_id = real_dev->dev_id; |