From 98e2783af32b8fe2228dae10714a1a756652c5b6 Mon Sep 17 00:00:00 2001 From: Andrew Rybchenko Date: Tue, 21 Jul 2020 09:58:45 +0100 Subject: [PATCH] net/sfc: avoid unnecessary actions on dummy default MAC set Just an optimization to avoid extra reconfiguration when it is not actually required. Signed-off-by: Andrew Rybchenko --- 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.20.1