Skip to content

Commit f20a4d4

Browse files
emuslndavem330
authored andcommitted
ionic: leave netdev mac alone after fw-upgrade
When running in a bond setup, or some other potential configurations, the netdev mac may have been changed from the default device mac. Since the userland doesn't know about the changes going on under the covers in a fw-upgrade it doesn't know the re-push the mac filter. The driver needs to leave the netdev mac filter alone when rebuilding after the fw-upgrade. Fixes: c672412 ("ionic: remove lifs on fw reset") Signed-off-by: Shannon Nelson <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 2c864c7 commit f20a4d4

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

drivers/net/ethernet/pensando/ionic/ionic_lif.c

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2348,7 +2348,17 @@ static int ionic_station_set(struct ionic_lif *lif)
23482348
if (is_zero_ether_addr(ctx.comp.lif_getattr.mac))
23492349
return 0;
23502350

2351-
if (!ether_addr_equal(ctx.comp.lif_getattr.mac, netdev->dev_addr)) {
2351+
if (!is_zero_ether_addr(netdev->dev_addr)) {
2352+
/* If the netdev mac is non-zero and doesn't match the default
2353+
* device address, it was set by something earlier and we're
2354+
* likely here again after a fw-upgrade reset. We need to be
2355+
* sure the netdev mac is in our filter list.
2356+
*/
2357+
if (!ether_addr_equal(ctx.comp.lif_getattr.mac,
2358+
netdev->dev_addr))
2359+
ionic_lif_addr(lif, netdev->dev_addr, true);
2360+
} else {
2361+
/* Update the netdev mac with the device's mac */
23522362
memcpy(addr.sa_data, ctx.comp.lif_getattr.mac, netdev->addr_len);
23532363
addr.sa_family = AF_INET;
23542364
err = eth_prepare_mac_addr_change(netdev, &addr);
@@ -2358,12 +2368,6 @@ static int ionic_station_set(struct ionic_lif *lif)
23582368
return 0;
23592369
}
23602370

2361-
if (!is_zero_ether_addr(netdev->dev_addr)) {
2362-
netdev_dbg(lif->netdev, "deleting station MAC addr %pM\n",
2363-
netdev->dev_addr);
2364-
ionic_lif_addr(lif, netdev->dev_addr, false);
2365-
}
2366-
23672371
eth_commit_mac_addr_change(netdev, &addr);
23682372
}
23692373

0 commit comments

Comments
 (0)