Thread (28 messages) 28 messages, 9 authors, 2023-06-16

Re: [PATCH net-next 1/3] iavf: add check for current MAC address in set_mac callback

From: Alexander Lobakin <aleksander.lobakin@intel.com>
Date: 2023-06-06 12:56:35

From: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
Date: Tue, 6 Jun 2023 12:21:07 +0200

[...]
quoted
quoted
quoted
diff --git a/drivers/net/ethernet/intel/iavf/iavf_main.c b/drivers/net/ethernet/intel/iavf/iavf_main.c
index 2de4baff4c20..420aaca548a0 100644
--- a/drivers/net/ethernet/intel/iavf/iavf_main.c
+++ b/drivers/net/ethernet/intel/iavf/iavf_main.c
@@ -1088,6 +1088,12 @@ static int iavf_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_dbg(netdev, "already using mac address %pM\n",
+			   addr->sa_data);
i am not sure if this is helpful message, you end up with an address that
you requested, why would you care that it was already same us you wanted?
You can find similar message in i40e and ice drivers. Please note that this
is a debug message, so it won't print by default. I would leave it this way,
it might be useful in a future for debugging.
I'm not a fan of neither this debug print nor the argument that it's
already present in driver A :D When we're developing things, we always
add a bunch of "useful for debugging" stuff to the code.
I also don't really get what this message can help with.
hmm fair enough :) :
Reviewed-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com>

CC: Olek
do you think libie could implement common ndo callbacks?
For sure it will. OTOH .ndo_set_mac_address() have a piece of
HW-specific code per each our driver. Configuration path is more
difficult to merge/share than hotpath in general, but will see later.
quoted
quoted
quoted
+		return 0;
+	}
+
 	ret = iavf_replace_primary_mac(adapter, addr->sa_data);
 
 	if (ret)
-- 
2.38.1
Regards,
Piotr
Thanks,
Olek
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help