net/bonding: switch to new offloading API

Switch to new ethdev offloading API.

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Radu Nicolau <radu.nicolau@intel.com>
This commit is contained in:
Ferruh Yigit 2018-03-22 18:13:24 +00:00
parent 85d3c09a0f
commit e8b3e1a9b1
3 changed files with 23 additions and 5 deletions

View File

@ -194,7 +194,8 @@ slave_vlan_filter_set(uint16_t bonded_port_id, uint16_t slave_port_id)
uint16_t first;
bonded_eth_dev = &rte_eth_devices[bonded_port_id];
if (bonded_eth_dev->data->dev_conf.rxmode.hw_vlan_filter == 0)
if ((bonded_eth_dev->data->dev_conf.rxmode.offloads &
DEV_RX_OFFLOAD_VLAN_FILTER) == 0)
return 0;
internals = bonded_eth_dev->data->dev_private;
@ -287,6 +288,8 @@ __eth_bond_slave_add_lock_free(uint16_t bonded_port_id, uint16_t 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;
internals->rx_queue_offload_capa = dev_info.rx_queue_offload_capa;
internals->tx_queue_offload_capa = dev_info.tx_queue_offload_capa;
internals->flow_type_rss_offloads = dev_info.flow_type_rss_offloads;
/* Inherit first slave's max rx packet size */
@ -295,6 +298,8 @@ __eth_bond_slave_add_lock_free(uint16_t bonded_port_id, uint16_t slave_port_id)
} else {
internals->rx_offload_capa &= dev_info.rx_offload_capa;
internals->tx_offload_capa &= dev_info.tx_offload_capa;
internals->rx_queue_offload_capa &= dev_info.rx_queue_offload_capa;
internals->tx_queue_offload_capa &= dev_info.tx_queue_offload_capa;
internals->flow_type_rss_offloads &= dev_info.flow_type_rss_offloads;
if (link_properties_valid(bonded_eth_dev,
@ -461,6 +466,8 @@ __eth_bond_slave_remove_lock_free(uint16_t bonded_port_id,
if (internals->slave_count == 0) {
internals->rx_offload_capa = 0;
internals->tx_offload_capa = 0;
internals->rx_queue_offload_capa = 0;
internals->tx_queue_offload_capa = 0;
internals->flow_type_rss_offloads = ETH_RSS_PROTO_MASK;
internals->reta_size = 0;
internals->candidate_max_rx_pktlen = 0;

View File

@ -1819,8 +1819,13 @@ slave_configure(struct rte_eth_dev *bonded_eth_dev,
bonded_eth_dev->data->dev_conf.rxmode.mq_mode;
}
slave_eth_dev->data->dev_conf.rxmode.hw_vlan_filter =
bonded_eth_dev->data->dev_conf.rxmode.hw_vlan_filter;
if (bonded_eth_dev->data->dev_conf.rxmode.offloads &
DEV_RX_OFFLOAD_VLAN_FILTER)
slave_eth_dev->data->dev_conf.rxmode.offloads |=
DEV_RX_OFFLOAD_VLAN_FILTER;
else
slave_eth_dev->data->dev_conf.rxmode.offloads &=
~DEV_RX_OFFLOAD_VLAN_FILTER;
nb_rx_queues = bonded_eth_dev->data->nb_rx_queues;
nb_tx_queues = bonded_eth_dev->data->nb_tx_queues;
@ -2258,6 +2263,8 @@ bond_ethdev_info(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
dev_info->rx_offload_capa = internals->rx_offload_capa;
dev_info->tx_offload_capa = internals->tx_offload_capa;
dev_info->rx_queue_offload_capa = internals->rx_queue_offload_capa;
dev_info->tx_queue_offload_capa = internals->tx_queue_offload_capa;
dev_info->flow_type_rss_offloads = internals->flow_type_rss_offloads;
dev_info->reta_size = internals->reta_size;
@ -2950,6 +2957,8 @@ bond_alloc(struct rte_vdev_device *dev, uint8_t mode)
internals->active_slave_count = 0;
internals->rx_offload_capa = 0;
internals->tx_offload_capa = 0;
internals->rx_queue_offload_capa = 0;
internals->tx_queue_offload_capa = 0;
internals->candidate_max_rx_pktlen = 0;
internals->max_rx_pktlen = 0;

View File

@ -128,8 +128,10 @@ struct bond_dev_private {
/**< TLB active slaves send order */
struct mode_alb_private mode6;
uint32_t rx_offload_capa; /** Rx offload capability */
uint32_t tx_offload_capa; /** Tx offload capability */
uint64_t rx_offload_capa; /** Rx offload capability */
uint64_t tx_offload_capa; /** Tx offload capability */
uint64_t rx_queue_offload_capa; /** per queue Rx offload capability */
uint64_t tx_queue_offload_capa; /** per queue Tx offload capability */
/** Bit mask of RSS offloads, the bit offset also means flow type */
uint64_t flow_type_rss_offloads;