net/bonding: switch to new offloading API
authorFerruh Yigit <ferruh.yigit@intel.com>
Thu, 22 Mar 2018 18:13:24 +0000 (18:13 +0000)
committerFerruh Yigit <ferruh.yigit@intel.com>
Fri, 13 Apr 2018 22:40:21 +0000 (00:40 +0200)
Switch to new ethdev offloading API.

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Radu Nicolau <radu.nicolau@intel.com>
drivers/net/bonding/rte_eth_bond_api.c
drivers/net/bonding/rte_eth_bond_pmd.c
drivers/net/bonding/rte_eth_bond_private.h

index d5b7260..aa89425 100644 (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;
index 960daac..2ba1055 100644 (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;
 
index 92e15f8..94eca88 100644 (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;