]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commitdiff
ixgbe: Use __dev_uc_sync and __dev_uc_unsync for unicast addresses
authorAlexander Duyck <aduyck@mirantis.com>
Thu, 22 Oct 2015 23:26:36 +0000 (16:26 -0700)
committerTim Gardner <tim.gardner@canonical.com>
Mon, 29 Feb 2016 15:56:35 +0000 (08:56 -0700)
BugLink: http://bugs.launchpad.net/bugs/1536473
This change replaces the ixgbe_write_uc_addr_list call in ixgbe_set_rx_mode
with a call to __dev_uc_sync instead.  This works much better with the MAC
addr list code that was already in place and solves an issue in which you
couldn't remove an FDB address without having to reset the port.

Signed-off-by: Alexander Duyck <aduyck@mirantis.com>
Tested-by: Darin Miller <darin.j.miller@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 0f079d22834ac0529413bdee5b5aa52485942162)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c

index 4d70ec0942387940fafe82a9871bcc12f5bbf1eb..8edf3a00aae8a7eb80a3485f5ac3a24bca2c58e7 100644 (file)
@@ -4212,6 +4212,25 @@ static int ixgbe_write_uc_addr_list(struct net_device *netdev, int vfn)
        return count;
 }
 
+static int ixgbe_uc_sync(struct net_device *netdev, const unsigned char *addr)
+{
+       struct ixgbe_adapter *adapter = netdev_priv(netdev);
+       int ret;
+
+       ret = ixgbe_add_mac_filter(adapter, addr, VMDQ_P(0));
+
+       return min_t(int, ret, 0);
+}
+
+static int ixgbe_uc_unsync(struct net_device *netdev, const unsigned char *addr)
+{
+       struct ixgbe_adapter *adapter = netdev_priv(netdev);
+
+       ixgbe_del_mac_filter(adapter, addr, VMDQ_P(0));
+
+       return 0;
+}
+
 /**
  * ixgbe_set_rx_mode - Unicast, Multicast and Promiscuous mode set
  * @netdev: network interface device structure
@@ -4267,8 +4286,7 @@ void ixgbe_set_rx_mode(struct net_device *netdev)
         * sufficient space to store all the addresses then enable
         * unicast promiscuous mode
         */
-       count = ixgbe_write_uc_addr_list(netdev, VMDQ_P(0));
-       if (count < 0) {
+       if (__dev_uc_sync(netdev, ixgbe_uc_sync, ixgbe_uc_unsync)) {
                fctrl |= IXGBE_FCTRL_UPE;
                vmolr |= IXGBE_VMOLR_ROPE;
        }
@@ -5106,8 +5124,12 @@ void ixgbe_reset(struct ixgbe_adapter *adapter)
        }
 
        clear_bit(__IXGBE_IN_SFP_INIT, &adapter->state);
-       /* do not flush user set addresses */
+
+       /* flush entries out of MAC table */
        ixgbe_flush_sw_mac_table(adapter);
+       __dev_uc_unsync(netdev, NULL);
+
+       /* do not flush user set addresses */
        ixgbe_mac_set_default_filter(adapter);
 
        /* update SAN MAC vmdq pool selection */