Skip to content

Commit 2adb956

Browse files
Vlad Yasevichdavem330
authored andcommitted
vlan: Warn the user if lowerdev has bad vlan features.
Some drivers incorrectly assign vlan acceleration features to vlan_features thus causing issues for Q-in-Q vlan configurations. Warn the user of such cases. Signed-off-by: Vlad Yasevich <vyasevic@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 3f8c707 commit 2adb956

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

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)