]> Pileus Git - ~andy/linux/commitdiff
Merge branch 'vlan_offloads'
authorDavid S. Miller <davem@davemloft.net>
Fri, 28 Mar 2014 21:17:16 +0000 (17:17 -0400)
committerDavid S. Miller <davem@davemloft.net>
Fri, 28 Mar 2014 21:17:16 +0000 (17:17 -0400)
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>
drivers/net/ethernet/qlogic/qlge/qlge_main.c
drivers/net/ifb.c
drivers/net/veth.c
include/linux/netdev_features.h
net/8021q/vlan_dev.c

index ce2cfddbed504c1b960e32bc87691ff6965a1fce..656c65ddadb4af03ff032f8f2310ebb91a7f0189 100644 (file)
@@ -4765,7 +4765,9 @@ static int qlge_probe(struct pci_dev *pdev,
        ndev->features = ndev->hw_features;
        ndev->vlan_features = ndev->hw_features;
        /* vlan gets same features (except vlan filter) */
-       ndev->vlan_features &= ~NETIF_F_HW_VLAN_CTAG_FILTER;
+       ndev->vlan_features &= ~(NETIF_F_HW_VLAN_CTAG_FILTER |
+                                NETIF_F_HW_VLAN_CTAG_TX |
+                                NETIF_F_HW_VLAN_CTAG_RX);
 
        if (test_bit(QL_DMA64, &qdev->flags))
                ndev->features |= NETIF_F_HIGHDMA;
index c14d39bf32d06a6f8d1b42a29b36dcd84b25c8f6..d7b2e947184b549a5034e4a54423ecde9050d721 100644 (file)
@@ -180,7 +180,8 @@ static void ifb_setup(struct net_device *dev)
        dev->tx_queue_len = TX_Q_LIMIT;
 
        dev->features |= IFB_FEATURES;
-       dev->vlan_features |= IFB_FEATURES;
+       dev->vlan_features |= IFB_FEATURES & ~(NETIF_F_HW_VLAN_CTAG_TX |
+                                              NETIF_F_HW_VLAN_STAG_TX);
 
        dev->flags |= IFF_NOARP;
        dev->flags &= ~IFF_MULTICAST;
index 5b374370f71c702d1eec4153c21038cc882795cd..c0e7c64765abd449070a7bce6826a994c674b8c7 100644 (file)
@@ -286,7 +286,10 @@ static void veth_setup(struct net_device *dev)
        dev->features |= NETIF_F_LLTX;
        dev->features |= VETH_FEATURES;
        dev->vlan_features = dev->features &
-                            ~(NETIF_F_HW_VLAN_CTAG_TX | NETIF_F_HW_VLAN_STAG_TX);
+                            ~(NETIF_F_HW_VLAN_CTAG_TX |
+                              NETIF_F_HW_VLAN_STAG_TX |
+                              NETIF_F_HW_VLAN_CTAG_RX |
+                              NETIF_F_HW_VLAN_STAG_RX);
        dev->destructor = veth_dev_free;
 
        dev->hw_features = VETH_FEATURES;
index 1005ebf175752774ada359369a313379a82dc85a..5a09a48f2658a64f7149ecddd30abd56c65cf69f 100644 (file)
@@ -163,4 +163,11 @@ enum {
 /* changeable features with no special hardware requirements */
 #define NETIF_F_SOFT_FEATURES  (NETIF_F_GSO | NETIF_F_GRO)
 
+#define NETIF_F_VLAN_FEATURES  (NETIF_F_HW_VLAN_CTAG_FILTER | \
+                                NETIF_F_HW_VLAN_CTAG_RX | \
+                                NETIF_F_HW_VLAN_CTAG_TX | \
+                                NETIF_F_HW_VLAN_STAG_FILTER | \
+                                NETIF_F_HW_VLAN_STAG_RX | \
+                                NETIF_F_HW_VLAN_STAG_TX)
+
 #endif /* _LINUX_NETDEV_FEATURES_H */
index a9591ff2b678c7c93ac1717fb9d42a19ad2d9672..27bfe2f8e2de71bee3f873106d88498765d36e93 100644 (file)
@@ -578,6 +578,9 @@ static int vlan_dev_init(struct net_device *dev)
 
        dev->features |= real_dev->vlan_features | NETIF_F_LLTX;
        dev->gso_max_size = real_dev->gso_max_size;
+       if (dev->features & NETIF_F_VLAN_FEATURES)
+               netdev_warn(real_dev, "VLAN features are set incorrectly.  Q-in-Q configurations may not work correctly.\n");
+
 
        /* ipv6 shared card related stuff */
        dev->dev_id = real_dev->dev_id;