Just an optimization to avoid extra reconfiguration when it
is not not actually required.

Signed-off-by: Andrew Rybchenko <arybche...@solarflare.com>
---
 drivers/net/sfc/sfc_ethdev.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/net/sfc/sfc_ethdev.c b/drivers/net/sfc/sfc_ethdev.c
index 6b3c49a284..acee3e48e4 100644
--- a/drivers/net/sfc/sfc_ethdev.c
+++ b/drivers/net/sfc/sfc_ethdev.c
@@ -1030,6 +1030,9 @@ sfc_mac_addr_set(struct rte_eth_dev *dev, struct 
rte_ether_addr *mac_addr)
 
        sfc_adapter_lock(sa);
 
+       if (rte_is_same_ether_addr(mac_addr, &port->default_mac_addr))
+               goto unlock;
+
        /*
         * Copy the address to the device private data so that
         * it could be recalled in the case of adapter restart.
-- 
2.17.1

Reply via email to