Skip to content

Commit

Permalink
Bugfix, config same mac address of bond slave.
Browse files Browse the repository at this point in the history
Signed-off-by: Simon Jones <batmanustc@gmail.com>
  • Loading branch information
batmancn committed Apr 29, 2024
1 parent 7e06c0d commit a484ac3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
9 changes: 9 additions & 0 deletions drivers/net/bonding/rte_eth_bond_pmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1562,6 +1562,15 @@ mac_address_members_update(struct rte_eth_dev *bonding_eth_dev)
}
break;
case BONDING_MODE_8023AD:
for (i = 0; i < internals->slave_count; i++) {
if (rte_eth_dev_default_mac_addr_set(
internals->slaves[i].port_id,
bonded_eth_dev->data->mac_addrs)) {
RTE_BOND_LOG(ERR, "Failed to update port Id %d MAC address",
internals->slaves[i].port_id);
return -1;
}
}
bond_mode_8023ad_mac_address_update(bonding_eth_dev);
break;
case BONDING_MODE_ACTIVE_BACKUP:
Expand Down
3 changes: 2 additions & 1 deletion lib/ethdev/rte_ethdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -1746,7 +1746,8 @@ rte_eth_dev_start(uint16_t port_id)
return ret;

/* Lets restore MAC now if device does not support live change */
if (*dev_info.dev_flags & RTE_ETH_DEV_NOLIVE_MAC_ADDR)
if ((*dev_info.dev_flags & RTE_ETH_DEV_NOLIVE_MAC_ADDR) &&
!(*dev_info.dev_flags & RTE_ETH_DEV_BONDED_SLAVE))
eth_dev_mac_restore(dev, &dev_info);

diag = (*dev->dev_ops->dev_start)(dev);
Expand Down

0 comments on commit a484ac3

Please sign in to comment.