[dpdk-dev,v2] net/bonding: switch to new offloading API
Checks
Commit Message
Switch to new ethdev offloading API.
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
Cc: Radu Nicolau <radu.nicolau@intel.com>
Cc: Matan Azrad <matan@mellanox.com>
v2:
* added [rt]x_queue_offload_capa to driver internal struct
* increased [rt]x_offload_capa size to 64bit as same as ethdev
---
drivers/net/bonding/rte_eth_bond_api.c | 9 ++++++++-
drivers/net/bonding/rte_eth_bond_pmd.c | 13 +++++++++++--
drivers/net/bonding/rte_eth_bond_private.h | 6 ++++--
3 files changed, 23 insertions(+), 5 deletions(-)
Comments
On 3/22/2018 6:13 PM, Ferruh Yigit wrote:
> Switch to new ethdev offloading API.
>
> Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
> ---
> Cc: Radu Nicolau <radu.nicolau@intel.com>
> Cc: Matan Azrad <matan@mellanox.com>
>
> v2:
> * added [rt]x_queue_offload_capa to driver internal struct
> * increased [rt]x_offload_capa size to 64bit as same as ethdev
> ---
>
Acked-by: Radu Nicolau <radu.nicolau@intel.com>
<mailto:radu.nicolau@intel.com>
On 4/6/2018 10:57 AM, Radu Nicolau wrote:
>
> On 3/22/2018 6:13 PM, Ferruh Yigit wrote:
>> Switch to new ethdev offloading API.
>>
>> Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
>> ---
>> Cc: Radu Nicolau <radu.nicolau@intel.com>
>> Cc: Matan Azrad <matan@mellanox.com>
>>
>> v2:
>> * added [rt]x_queue_offload_capa to driver internal struct
>> * increased [rt]x_offload_capa size to 64bit as same as ethdev
>> ---
>>
> Acked-by: Radu Nicolau <radu.nicolau@intel.com
Applied to dpdk-next-net/master, thanks.
@@ -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;
@@ -284,6 +285,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 */
@@ -292,6 +295,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,
@@ -458,6 +463,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;
@@ -1818,8 +1818,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;
@@ -2252,6 +2257,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;
@@ -2944,6 +2951,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;
@@ -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;