rte_eth_bond_create(const char *name, uint8_t mode, uint8_t socket_id)
{
struct bond_dev_private *internals;
+ struct rte_eth_dev *bond_dev;
char devargs[52];
- uint16_t port_id;
int ret;
if (name == NULL) {
if (ret)
return ret;
- ret = rte_eth_dev_get_port_by_name(name, &port_id);
- RTE_ASSERT(!ret);
+ bond_dev = rte_eth_dev_get_by_name(name);
+ RTE_ASSERT(bond_dev);
/*
* To make bond_ethdev_configure() happy we need to free the
*
* Also see comment in bond_ethdev_configure().
*/
- internals = rte_eth_devices[port_id].data->dev_private;
+ internals = bond_dev->data->dev_private;
rte_kvargs_free(internals->kvlist);
internals->kvlist = NULL;
- return port_id;
+ return bond_dev->data->port_id;
}
int
* value. Thus, the new internal value of default Rx queue offloads
* has to be masked by rx_queue_offload_capa to make sure that only
* commonly supported offloads are preserved from both the previous
- * value and the value being inhereted from the new slave device.
+ * value and the value being inherited from the new slave device.
*/
rxconf_i->offloads = (rxconf_i->offloads | rxconf->offloads) &
internals->rx_queue_offload_capa;
* value. Thus, the new internal value of default Tx queue offloads
* has to be masked by tx_queue_offload_capa to make sure that only
* commonly supported offloads are preserved from both the previous
- * value and the value being inhereted from the new slave device.
+ * value and the value being inherited from the new slave device.
*/
txconf_i->offloads = (txconf_i->offloads | txconf->offloads) &
internals->tx_queue_offload_capa;
slave_port_id);
return -1;
}
+ if (slave_start(bonded_eth_dev, slave_eth_dev) != 0) {
+ internals->slave_count--;
+ RTE_BOND_LOG(ERR, "rte_bond_slaves_start: port=%d",
+ slave_port_id);
+ return -1;
+ }
}
/* Update all slave devices MACs */
}
if (slave_idx < 0) {
- RTE_BOND_LOG(ERR, "Couldn't find slave in port list, slave count %d",
+ RTE_BOND_LOG(ERR, "Couldn't find slave in port list, slave count %u",
internals->slave_count);
return -1;
}