]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
ixgbe: Add support for toggling VLAN filtering flag via ethtool
authorAlexander Duyck <aduyck@mirantis.com>
Thu, 10 Mar 2016 18:01:10 +0000 (10:01 -0800)
committerChuck Anderson <chuck.anderson@oracle.com>
Wed, 6 Jul 2016 23:41:08 +0000 (16:41 -0700)
Orabug: 23177316

This change makes it so that we can use the ethtool rx-vlan-filter flag to
toggle Rx VLAN filtering on and off.  This is basically just an extension
of the existing VLAN promisc work in that it just adds support for the
additional ethtool flag.

Signed-off-by: Alexander Duyck <aduyck@mirantis.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 0c5a616650a08b766e529511348274c1914ef4bf)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
Conflicts:
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c

drivers/net/ethernet/intel/ixgbe/ixgbe_main.c

index 89855728620fdedbcd6c132a16bca8236da25d07..fc3dc7dbe3ac2ff90cc43481c9e9a0a99f6eb0b4 100644 (file)
@@ -4450,6 +4450,7 @@ void ixgbe_set_rx_mode(struct net_device *netdev)
        struct ixgbe_adapter *adapter = netdev_priv(netdev);
        struct ixgbe_hw *hw = &adapter->hw;
        u32 fctrl, vmolr = IXGBE_VMOLR_BAM | IXGBE_VMOLR_AUPE;
+       netdev_features_t features = netdev->features;
        int count;
 
        /* Check for Promiscuous and All Multicast modes */
@@ -4467,14 +4468,13 @@ void ixgbe_set_rx_mode(struct net_device *netdev)
                hw->addr_ctrl.user_set_promisc = true;
                fctrl |= (IXGBE_FCTRL_UPE | IXGBE_FCTRL_MPE);
                vmolr |= IXGBE_VMOLR_MPE;
-               ixgbe_vlan_promisc_enable(adapter);
+               features &= ~NETIF_F_HW_VLAN_CTAG_FILTER;
        } else {
                if (netdev->flags & IFF_ALLMULTI) {
                        fctrl |= IXGBE_FCTRL_MPE;
                        vmolr |= IXGBE_VMOLR_MPE;
                }
                hw->addr_ctrl.user_set_promisc = false;
-               ixgbe_vlan_promisc_disable(adapter);
        }
 
        /*
@@ -4507,7 +4507,7 @@ void ixgbe_set_rx_mode(struct net_device *netdev)
        }
 
        /* This is useful for sniffing bad packets. */
-       if (adapter->netdev->features & NETIF_F_RXALL) {
+       if (features & NETIF_F_RXALL) {
                /* UPE and MPE will be handled by normal PROMISC logic
                 * in e1000e_set_rx_mode */
                fctrl |= (IXGBE_FCTRL_SBP | /* Receive bad packets */
@@ -4520,10 +4520,15 @@ void ixgbe_set_rx_mode(struct net_device *netdev)
 
        IXGBE_WRITE_REG(hw, IXGBE_FCTRL, fctrl);
 
-       if (netdev->features & NETIF_F_HW_VLAN_CTAG_RX)
+       if (features & NETIF_F_HW_VLAN_CTAG_RX)
                ixgbe_vlan_strip_enable(adapter);
        else
                ixgbe_vlan_strip_disable(adapter);
+
+       if (features & NETIF_F_HW_VLAN_CTAG_FILTER)
+               ixgbe_vlan_promisc_disable(adapter);
+       else
+               ixgbe_vlan_promisc_enable(adapter);
 }
 
 static void ixgbe_napi_enable_all(struct ixgbe_adapter *adapter)
@@ -8305,11 +8310,6 @@ static int ixgbe_set_features(struct net_device *netdev,
                break;
        }
 
-       if (features & NETIF_F_HW_VLAN_CTAG_RX)
-               ixgbe_vlan_strip_enable(adapter);
-       else
-               ixgbe_vlan_strip_disable(adapter);
-
        if (changed & NETIF_F_RXALL)
                need_reset = true;
 
@@ -8326,6 +8326,9 @@ static int ixgbe_set_features(struct net_device *netdev,
 
        if (need_reset)
                ixgbe_do_reset(netdev);
+       else if (changed & (NETIF_F_HW_VLAN_CTAG_RX |
+                           NETIF_F_HW_VLAN_CTAG_FILTER))
+               ixgbe_set_rx_mode(netdev);
 
        return 0;
 }
@@ -9024,7 +9027,9 @@ skip_sriov:
                           NETIF_F_TSO |
                           NETIF_F_TSO6 |
                           NETIF_F_RXHASH |
-                          NETIF_F_RXCSUM;
+                          NETIF_F_RXCSUM |
+                          NETIF_F_HW_VLAN_CTAG_RX |
+                          NETIF_F_HW_VLAN_CTAG_FILTER;
 
        netdev->hw_features = netdev->features | NETIF_F_HW_L2FW_DOFFLOAD;
 
@@ -9042,7 +9047,6 @@ skip_sriov:
        }
 
        netdev->hw_features |= NETIF_F_RXALL;
-       netdev->features |= NETIF_F_HW_VLAN_CTAG_FILTER;
 
        netdev->vlan_features |= NETIF_F_TSO;
        netdev->vlan_features |= NETIF_F_TSO6;