Skip to content

Commit 5f2feca

Browse files
committed
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>
2 parents fc92f74 + 2adb956 commit 5f2feca

File tree

5 files changed

+19
-3
lines changed

5 files changed

+19
-3
lines changed

drivers/net/ethernet/qlogic/qlge/qlge_main.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4765,7 +4765,9 @@ static int qlge_probe(struct pci_dev *pdev,
47654765
ndev->features = ndev->hw_features;
47664766
ndev->vlan_features = ndev->hw_features;
47674767
/* 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);
47694771

47704772
if (test_bit(QL_DMA64, &qdev->flags))
47714773
ndev->features |= NETIF_F_HIGHDMA;

drivers/net/ifb.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,8 @@ static void ifb_setup(struct net_device *dev)
180180
dev->tx_queue_len = TX_Q_LIMIT;
181181

182182
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);
184185

185186
dev->flags |= IFF_NOARP;
186187
dev->flags &= ~IFF_MULTICAST;

drivers/net/veth.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,10 @@ static void veth_setup(struct net_device *dev)
286286
dev->features |= NETIF_F_LLTX;
287287
dev->features |= VETH_FEATURES;
288288
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);
290293
dev->destructor = veth_dev_free;
291294

292295
dev->hw_features = VETH_FEATURES;

include/linux/netdev_features.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,4 +163,11 @@ enum {
163163
/* changeable features with no special hardware requirements */
164164
#define NETIF_F_SOFT_FEATURES (NETIF_F_GSO | NETIF_F_GRO)
165165

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+
166173
#endif /* _LINUX_NETDEV_FEATURES_H */

net/8021q/vlan_dev.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -578,6 +578,9 @@ static int vlan_dev_init(struct net_device *dev)
578578

579579
dev->features |= real_dev->vlan_features | NETIF_F_LLTX;
580580
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+
581584

582585
/* ipv6 shared card related stuff */
583586
dev->dev_id = real_dev->dev_id;

0 commit comments

Comments
 (0)