net/sfc: avoid unnecessary actions on dummy default MAC set

Message ID 1595321925-26226-1-git-send-email-arybchenko@solarflare.com (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers
Series net/sfc: avoid unnecessary actions on dummy default MAC set |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/iol-broadcom-Performance success Performance Testing PASS
ci/Intel-compilation success Compilation OK
ci/iol-intel-Performance success Performance Testing PASS
ci/travis-robot success Travis build: passed
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-testing success Testing PASS

Commit Message

Andrew Rybchenko July 21, 2020, 8:58 a.m. UTC
  Just an optimization to avoid extra reconfiguration when it
is not not actually required.

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

Comments

Ferruh Yigit July 21, 2020, 4:37 p.m. UTC | #1
On 7/21/2020 9:58 AM, Andrew Rybchenko wrote:
> Just an optimization to avoid extra reconfiguration when it
> is not not actually required.
> 
> Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>

Applied to dpdk-next-net/master, thanks.
  

Patch

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.