Merge branch 'optimize-procedure-of-changing-mac-address-on-interface'
Piotr Gardocki says: ==================== optimize procedure of changing MAC address on interface The first patch adds an if statement in core to skip early when the MAC address is not being changes. The remaining patches remove such checks from Intel drivers as they're redundant at this point. ==================== Link: https://lore.kernel.org/r/20230614145302.902301-1-piotrx.gardocki@intel.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
commit
7deb0c3c24
@ -1788,12 +1788,6 @@ static int i40e_set_mac(struct net_device *netdev, void *p)
|
||||
if (!is_valid_ether_addr(addr->sa_data))
|
||||
return -EADDRNOTAVAIL;
|
||||
|
||||
if (ether_addr_equal(netdev->dev_addr, addr->sa_data)) {
|
||||
netdev_info(netdev, "already using mac address %pM\n",
|
||||
addr->sa_data);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (test_bit(__I40E_DOWN, pf->state) ||
|
||||
test_bit(__I40E_RESET_RECOVERY_PENDING, pf->state))
|
||||
return -EADDRNOTAVAIL;
|
||||
|
@ -5624,11 +5624,6 @@ static int ice_set_mac_address(struct net_device *netdev, void *pi)
|
||||
if (!is_valid_ether_addr(mac))
|
||||
return -EADDRNOTAVAIL;
|
||||
|
||||
if (ether_addr_equal(netdev->dev_addr, mac)) {
|
||||
netdev_dbg(netdev, "already using mac %pM\n", mac);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (test_bit(ICE_DOWN, pf->state) ||
|
||||
ice_is_reset_in_progress(pf->state)) {
|
||||
netdev_err(netdev, "can't set mac %pM. device not ready\n",
|
||||
|
@ -8781,6 +8781,8 @@ int dev_set_mac_address(struct net_device *dev, struct sockaddr *sa,
|
||||
return -EINVAL;
|
||||
if (!netif_device_present(dev))
|
||||
return -ENODEV;
|
||||
if (!memcmp(dev->dev_addr, sa->sa_data, dev->addr_len))
|
||||
return 0;
|
||||
err = dev_pre_changeaddr_notify(dev, sa->sa_data, extack);
|
||||
if (err)
|
||||
return err;
|
||||
|
Loading…
x
Reference in New Issue
Block a user