Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
[linux-2.6-block.git] / drivers / net / ethernet / pensando / ionic / ionic_lif.c
index 80b4d8332109bf3ccb71d95e4f3c44912ea4f6f6..7321a92f8395edafb851f5d058799dffd6e0698c 100644 (file)
@@ -2175,6 +2175,7 @@ static void ionic_lif_handle_fw_up(struct ionic_lif *lif)
        dev_info(ionic->dev, "FW Up: restarting LIFs\n");
 
        ionic_init_devinfo(ionic);
+       ionic_port_init(ionic);
        err = ionic_qcqs_alloc(lif);
        if (err)
                goto err_out;
@@ -2406,7 +2407,17 @@ static int ionic_station_set(struct ionic_lif *lif)
        if (is_zero_ether_addr(ctx.comp.lif_getattr.mac))
                return 0;
 
-       if (!ether_addr_equal(ctx.comp.lif_getattr.mac, netdev->dev_addr)) {
+       if (!is_zero_ether_addr(netdev->dev_addr)) {
+               /* If the netdev mac is non-zero and doesn't match the default
+                * device address, it was set by something earlier and we're
+                * likely here again after a fw-upgrade reset.  We need to be
+                * sure the netdev mac is in our filter list.
+                */
+               if (!ether_addr_equal(ctx.comp.lif_getattr.mac,
+                                     netdev->dev_addr))
+                       ionic_lif_addr(lif, netdev->dev_addr, true);
+       } else {
+               /* Update the netdev mac with the device's mac */
                memcpy(addr.sa_data, ctx.comp.lif_getattr.mac, netdev->addr_len);
                addr.sa_family = AF_INET;
                err = eth_prepare_mac_addr_change(netdev, &addr);
@@ -2416,12 +2427,6 @@ static int ionic_station_set(struct ionic_lif *lif)
                        return 0;
                }
 
-               if (!is_zero_ether_addr(netdev->dev_addr)) {
-                       netdev_dbg(lif->netdev, "deleting station MAC addr %pM\n",
-                                  netdev->dev_addr);
-                       ionic_lif_addr(lif, netdev->dev_addr, false);
-               }
-
                eth_commit_mac_addr_change(netdev, &addr);
        }