Skip to content

Commit

Permalink
bnxt_en: Optimize .ndo_set_mac_address() for VFs.
Browse files Browse the repository at this point in the history
No need to call bnxt_approve_mac() which will send a message to the
PF if the MAC address hasn't changed.

Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Michael Chan authored and David S. Miller committed Oct 27, 2017
1 parent 431aa1e commit c1a7bdf
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/net/ethernet/broadcom/bnxt/bnxt.c
Original file line number Diff line number Diff line change
Expand Up @@ -7249,13 +7249,13 @@ static int bnxt_change_mac_addr(struct net_device *dev, void *p)
if (!is_valid_ether_addr(addr->sa_data))
return -EADDRNOTAVAIL;

if (ether_addr_equal(addr->sa_data, dev->dev_addr))
return 0;

rc = bnxt_approve_mac(bp, addr->sa_data);
if (rc)
return rc;

if (ether_addr_equal(addr->sa_data, dev->dev_addr))
return 0;

memcpy(dev->dev_addr, addr->sa_data, dev->addr_len);
if (netif_running(dev)) {
bnxt_close_nic(bp, false, false);
Expand Down

0 comments on commit c1a7bdf

Please sign in to comment.