summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/broadcom/bnxt/bnxt.c
diff options
context:
space:
mode:
authorMichael Chan <michael.chan@broadcom.com>2017-10-26 18:51:24 +0300
committerDavid S. Miller <davem@davemloft.net>2017-10-27 18:02:44 +0300
commitc1a7bdff17247332ecff7f243e42d269b3f74c65 (patch)
treeccab8afd6eb072f1adfa9a3e0f4b8227c329305b /drivers/net/ethernet/broadcom/bnxt/bnxt.c
parent431aa1eb20d8ae2674723292adb832b968da868e (diff)
downloadlinux-c1a7bdff17247332ecff7f243e42d269b3f74c65.tar.xz
bnxt_en: Optimize .ndo_set_mac_address() for VFs.
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>
Diffstat (limited to 'drivers/net/ethernet/broadcom/bnxt/bnxt.c')
-rw-r--r--drivers/net/ethernet/broadcom/bnxt/bnxt.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
index ffc6c494f6ea..ef5a5e52eb04 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
@@ -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);