https://bugs.dpdk.org/show_bug.cgi?id=256
Bug ID: 256 Summary: Transmit or receive packets use the bond MAC is failed when switch backup port to active Product: DPDK Version: 18.11 Hardware: All OS: All Status: CONFIRMED Severity: major Priority: Normal Component: ethdev Assignee: dev@dpdk.org Reporter: fengchuns...@huawei.com Target Milestone: --- 1.Problem Description Create a active-backup bond device, when primary port link down,slave port changes to primary,but new primary mac is not change to the bonding MAC. Transmit or receive packets use the bond MAC is failed. 2.analyze The bonding pmd call mac_address_slaves_update to modify the MAC of all slaves:the primary use bond mac addrs, and other slaves to use the slave's MAC. The code is incorrect using primary_port instead of current_primary_port. diff --git a/dpdk-18.11.0/drivers/net/bonding/rte_eth_bond_pmd.c b/dpdk-18.11.0/drivers/net/bonding/rte_eth_bond_pmd.c index 44deaf1..1c5bc2d 100644 --- a/dpdk-18.11.0/drivers/net/bonding/rte_eth_bond_pmd.c +++ b/dpdk-18.11.0/drivers/net/bonding/rte_eth_bond_pmd.c @@ -1627,7 +1627,7 @@ mac_address_slaves_update(struct rte_eth_dev *bonded_eth_dev) if (internals->slaves[i].port_id == internals->current_primary_port) { if (rte_eth_dev_default_mac_addr_set( - internals->primary_port, + internals->current_primary_port, bonded_eth_dev->data->mac_addrs)) { RTE_BOND_LOG(ERR, "Failed to update port Id %d MAC address", internals->current_primary_port); Bonding pmd sets slave's mac according to current_primary_port. The current_primary_port changes in the following scenario: 1. add slave to bond, the first slave will set the current_primary_port, change the order of adding the slave, current_primary_port will be different. 2. The user specifies primary_port via rte_eth_bond_primary_set 3. delete the primary slave 4 -- You are receiving this mail because: You are the assignee for the bug.