net/bonding: add add/remove mac addrs
Subsystems (2)
PATCH v4 1/1 net/bonding: add add/remove mac addrs
add functions to add/remove MAC addresses
Signed-off-by Alex Kiselev <[email protected]>
--- drivers/net/bonding/rte_eth_bond_api.c | 12 ++- drivers/net/bonding/rte_eth_bond_pmd.c | 131 ++++++++++++++++++++++++++++- drivers/net/bonding/rte_eth_bond_private.h | 8 ++ 3 files changed, 146 insertions(+), 5 deletions(-)
drivers/net/bonding/rte_eth_bond_api.c +11 -1
@@ -373,6 +373,13 @@ __eth_bond_slave_add_lock_free(uint16_t bonded_port_id, uint16_t slave_port_id)return -1 ; } +/* Add additional MAC addresses to the slave */ +if (slave_add_mac_addresses (bonded_eth_dev, slave_port_id) !=0 ) { +RTE_BOND_LOG (ERR ,"Failed to add mac address(es) to slave %hu" , + slave_port_id); +return -1 ; + } + internals->slave_count++;if (bonded_eth_dev->data->dev_started) {
@@ -387,7 +394,7 @@ __eth_bond_slave_add_lock_free(uint16_t bonded_port_id, uint16_t slave_port_id)/* Add slave details to bonded device */ slave_eth_dev->data->dev_flags |=RTE_ETH_DEV_BONDED_SLAVE ; -/* Update all slave devices MACs*/ +/* Update all slave devices MACs */ mac_address_slaves_update (bonded_eth_dev);/* Register link status change callback with bonded device pointer as
@@ -491,6 +498,9 @@ __eth_bond_slave_remove_lock_free(uint16_t bonded_port_id,rte_eth_dev_default_mac_addr_set (slave_port_id, &(internals->slaves[slave_idx].persisted_mac_addr)); +/* remove additional MAC addresses from the slave */ +slave_remove_mac_addresses (bonded_eth_dev, slave_port_id); +/* * Remove bond device flows from slave device. * Note: don't restore flow isolate mode.
drivers/net/bonding/rte_eth_bond_pmd.c +127 -4
168 lines not on this page · raw message
drivers/net/bonding/rte_eth_bond_private.h +8 -0
@@ -230,6 +230,14 @@ mac_address_get(struct rte_eth_dev *eth_dev, struct ether_addr *dst_mac_addr);int mac_address_slaves_update (struct rte_eth_dev *bonded_eth_dev); +int +slave_add_mac_addresses (struct rte_eth_dev *bonded_eth_dev, +uint16_t slave_port_id); + +int +slave_remove_mac_addresses (struct rte_eth_dev *bonded_eth_dev, +uint16_t slave_port_id); +int bond_ethdev_mode_set (struct rte_eth_dev *eth_dev,int mode);
Signature · 1 line
2.16.1.windows.1