]> git.karo-electronics.de Git - linux-beck.git/commitdiff
i40evf: add MAC address filter in open, not init
authorMitch Williams <mitch.a.williams@intel.com>
Mon, 27 Apr 2015 18:57:17 +0000 (14:57 -0400)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Wed, 15 Jul 2015 01:26:42 +0000 (18:26 -0700)
During close, all of the MAC filters are cleared, so the driver would be
unable to receive unicast packets after being closed and reopened.

Add the adapter's "hardware" MAC address filter in open, not init. This
ensures that the correct filter is present each time.

Change-ID: I51a11e9c1200139dab6f66a5353bd38c7d26f875
Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Tested-by: Jim Young <james.m.young@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/ethernet/intel/i40evf/i40evf_main.c

index 1c2ee97d1844607ebb9cba04689191b799e732e7..802e158ea981b36dd408fc135f90397b081783b4 100644 (file)
@@ -1858,6 +1858,7 @@ static int i40evf_open(struct net_device *netdev)
        if (err)
                goto err_req_irq;
 
+       i40evf_add_filter(adapter, adapter->hw.mac.addr);
        i40evf_configure(adapter);
 
        err = i40evf_up_complete(adapter);
@@ -1998,7 +1999,6 @@ static void i40evf_init_task(struct work_struct *work)
                                                      struct i40evf_adapter,
                                                      init_task.work);
        struct net_device *netdev = adapter->netdev;
-       struct i40evf_mac_filter *f;
        struct i40e_hw *hw = &adapter->hw;
        struct pci_dev *pdev = adapter->pdev;
        int i, err, bufsz;
@@ -2132,16 +2132,6 @@ static void i40evf_init_task(struct work_struct *work)
        ether_addr_copy(netdev->dev_addr, adapter->hw.mac.addr);
        ether_addr_copy(netdev->perm_addr, adapter->hw.mac.addr);
 
-       f = kzalloc(sizeof(*f), GFP_ATOMIC);
-       if (!f)
-               goto err_sw_init;
-
-       ether_addr_copy(f->macaddr, adapter->hw.mac.addr);
-       f->add = true;
-       adapter->aq_required |= I40EVF_FLAG_AQ_ADD_MAC_FILTER;
-
-       list_add(&f->list, &adapter->mac_filter_list);
-
        init_timer(&adapter->watchdog_timer);
        adapter->watchdog_timer.function = &i40evf_watchdog_timer;
        adapter->watchdog_timer.data = (unsigned long)adapter;