internals->slave_count = 0;
internals->active_slave_count = 0;
+ internals->rx_offload_capa = 0;
+ internals->tx_offload_capa = 0;
memset(internals->active_slaves, 0, sizeof(internals->active_slaves));
memset(internals->slaves, 0, sizeof(internals->slaves));
struct bond_dev_private *internals;
struct bond_dev_private *temp_internals;
struct rte_eth_link link_props;
+ struct rte_eth_dev_info dev_info;
int i, j;
/* Add slave details to bonded device */
slave_add(internals, slave_eth_dev);
+ memset(&dev_info, 0, sizeof(dev_info));
+ rte_eth_dev_info_get(slave_port_id, &dev_info);
+
if (internals->slave_count < 1) {
/* if MAC is not user defined then use MAC of first slave add to
* bonded device */
/* Make primary slave */
internals->primary_port = slave_port_id;
+
+ /* Take the first dev's offload capabilities */
+ internals->rx_offload_capa = dev_info.rx_offload_capa;
+ internals->tx_offload_capa = dev_info.tx_offload_capa;
+
} else {
/* Check slave link properties are supported if props are set,
* all slaves must be the same */
link_properties_set(bonded_eth_dev,
&(slave_eth_dev->data->dev_link));
}
+ internals->rx_offload_capa &= dev_info.rx_offload_capa;
+ internals->tx_offload_capa &= dev_info.tx_offload_capa;
}
internals->slave_count++;
memset(rte_eth_devices[bonded_port_id].data->mac_addrs, 0,
sizeof(*(rte_eth_devices[bonded_port_id].data->mac_addrs)));
}
-
+ if (internals->slave_count == 0) {
+ internals->rx_offload_capa = 0;
+ internals->tx_offload_capa = 0;
+ }
return 0;
}
static void
bond_ethdev_info(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
{
+ struct bond_dev_private *internals = dev->data->dev_private;
+
dev_info->driver_name = driver_name;
dev_info->max_mac_addrs = 1;
dev_info->min_rx_bufsize = 0;
dev_info->pci_dev = dev->pci_dev;
+
+ dev_info->rx_offload_capa = internals->rx_offload_capa;
+ dev_info->tx_offload_capa = internals->tx_offload_capa;
}
static int