Log an error when rte_eth_dev_default_mac_addr_set() fails while
restoring the default MAC address of a member device removed from a
bonding device.
This improves visibility of failures without changing the existing
behavior.

Fixes: aa7791ba8de0 ("net/bonding: fix setting slave MAC addresses")
Cc: [email protected]

Signed-off-by: Evgeny Sokolov <[email protected]>
Cc: [email protected]
---
 .mailmap                               | 1 +
 drivers/net/bonding/rte_eth_bond_api.c | 8 ++++++--
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/.mailmap b/.mailmap
index 8e1153ce58..ddbaaf744f 100644
--- a/.mailmap
+++ b/.mailmap
@@ -461,6 +461,7 @@ Evan Swanson <[email protected]>
 Evgeny Efimov <[email protected]>
 Evgeny Im <[email protected]>
 Evgeny Schemeilin <[email protected]>
+Evgeny Sokolov <[email protected]>
 Fabio Pricoco <[email protected]>
 Fady Bader <[email protected]>
 Faicker Mo <[email protected]>
diff --git a/drivers/net/bonding/rte_eth_bond_api.c 
b/drivers/net/bonding/rte_eth_bond_api.c
index 9e5df67c18..da2b538b3c 100644
--- a/drivers/net/bonding/rte_eth_bond_api.c
+++ b/drivers/net/bonding/rte_eth_bond_api.c
@@ -706,8 +706,12 @@ __eth_bond_member_remove_lock_free(uint16_t 
bonding_port_id,
                        &rte_eth_devices[bonding_port_id].data->port_id);
 
        /* Restore original MAC address of member device */
-       rte_eth_dev_default_mac_addr_set(member_port_id,
-                       &internals->members[member_idx].persisted_mac_addr);
+       if (rte_eth_dev_default_mac_addr_set(member_port_id,
+                       &internals->members[member_idx].persisted_mac_addr)) {
+               RTE_BOND_LOG(ERR,
+                               "Failed to restore MAC address on member port 
%u",
+                               member_port_id);
+       }
 
        /* remove additional MAC addresses from the member */
        member_remove_mac_addresses(bonding_eth_dev, member_port_id);
-- 
2.47.3

Reply via email to