- /* Verify that port_id refers to a non bonded port */
- if (check_for_bonded_ethdev(&rte_eth_devices[port_id]) == 0 &&
- mode == BONDING_MODE_8023AD) {
+ /* Verify that slave_port_id refers to a non bonded port */
+ if (check_for_bonded_ethdev(&rte_eth_devices[slave_port_id]) == 0 &&
+ internals->mode == BONDING_MODE_8023AD) {
RTE_BOND_LOG(ERR, "Cannot add slave to bonded device in 802.3ad"
" mode as slave is also a bonded device, only "
"physical devices can be support in this mode.");
return -1;
}
RTE_BOND_LOG(ERR, "Cannot add slave to bonded device in 802.3ad"
" mode as slave is also a bonded device, only "
"physical devices can be support in this mode.");
return -1;
}
uint16_t slave_port_id = internals->slaves[slave_id].port_id;
if (internals->flow_isolated_valid != 0) {
uint16_t slave_port_id = internals->slaves[slave_id].port_id;
if (internals->flow_isolated_valid != 0) {
if (rte_flow_isolate(slave_port_id, internals->flow_isolated,
&ferror)) {
RTE_BOND_LOG(ERR, "rte_flow_isolate failed for slave"
if (rte_flow_isolate(slave_port_id, internals->flow_isolated,
&ferror)) {
RTE_BOND_LOG(ERR, "rte_flow_isolate failed for slave"
if (valid_bonded_port_id(bonded_port_id) != 0)
return -1;
bonded_eth_dev = &rte_eth_devices[bonded_port_id];
internals = bonded_eth_dev->data->dev_private;
if (valid_bonded_port_id(bonded_port_id) != 0)
return -1;
bonded_eth_dev = &rte_eth_devices[bonded_port_id];
internals = bonded_eth_dev->data->dev_private;
rte_spinlock_lock(&internals->lock);
retval = __eth_bond_slave_add_lock_free(bonded_port_id, slave_port_id);
rte_spinlock_lock(&internals->lock);
retval = __eth_bond_slave_add_lock_free(bonded_port_id, slave_port_id);