From: Wenzhuo Lu Date: Thu, 1 Mar 2018 06:41:46 +0000 (+0800) Subject: net/avf: convert to new Rx and Tx offload API X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=605c6f9ca52ff9c34481e6f818a3ff81c3d10d9d;p=dpdk.git net/avf: convert to new Rx and Tx offload API Ethdev Tx offloads API has changed since: commit cba7f53b717d ("ethdev: introduce Tx queue offloads API") This commit support the new Rx and Tx offloads API. Signed-off-by: Wenzhuo Lu Acked-by: Beilei Xing --- diff --git a/drivers/net/avf/avf_ethdev.c b/drivers/net/avf/avf_ethdev.c index 68a59b46c7..ff900651e1 100644 --- a/drivers/net/avf/avf_ethdev.c +++ b/drivers/net/avf/avf_ethdev.c @@ -532,13 +532,13 @@ avf_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) dev_info->default_rxconf = (struct rte_eth_rxconf) { .rx_free_thresh = AVF_DEFAULT_RX_FREE_THRESH, .rx_drop_en = 0, + .offloads = 0, }; dev_info->default_txconf = (struct rte_eth_txconf) { .tx_free_thresh = AVF_DEFAULT_TX_FREE_THRESH, .tx_rs_thresh = AVF_DEFAULT_TX_RS_THRESH, - .txq_flags = ETH_TXQ_FLAGS_NOMULTSEGS | - ETH_TXQ_FLAGS_NOOFFLOADS, + .offloads = 0, }; dev_info->rx_desc_lim = (struct rte_eth_desc_lim) { @@ -759,7 +759,7 @@ avf_dev_vlan_offload_set(struct rte_eth_dev *dev, int mask) /* Vlan stripping setting */ if (mask & ETH_VLAN_STRIP_MASK) { /* Enable or disable VLAN stripping */ - if (dev_conf->rxmode.hw_vlan_strip) + if (dev_conf->rxmode.offloads & DEV_RX_OFFLOAD_VLAN_STRIP) err = avf_enable_vlan_strip(adapter); else err = avf_disable_vlan_strip(adapter); diff --git a/drivers/net/avf/avf_rxtx.c b/drivers/net/avf/avf_rxtx.c index d276d9752c..1824ed70be 100644 --- a/drivers/net/avf/avf_rxtx.c +++ b/drivers/net/avf/avf_rxtx.c @@ -109,7 +109,7 @@ check_rx_vec_allow(struct avf_rx_queue *rxq) static inline bool check_tx_vec_allow(struct avf_tx_queue *txq) { - if ((txq->txq_flags & AVF_SIMPLE_FLAGS) == AVF_SIMPLE_FLAGS && + if (!(txq->offloads & AVF_NO_VECTOR_FLAGS) && txq->rs_thresh >= AVF_VPMD_TX_MAX_BURST && txq->rs_thresh <= AVF_VPMD_TX_MAX_FREE_BUF) { PMD_INIT_LOG(DEBUG, "Vector tx can be enabled on this txq."); @@ -474,7 +474,7 @@ avf_dev_tx_queue_setup(struct rte_eth_dev *dev, txq->free_thresh = tx_free_thresh; txq->queue_id = queue_idx; txq->port_id = dev->data->port_id; - txq->txq_flags = tx_conf->txq_flags; + txq->offloads = tx_conf->offloads; txq->tx_deferred_start = tx_conf->tx_deferred_start; /* Allocate software ring */ @@ -1831,7 +1831,7 @@ avf_dev_txq_info_get(struct rte_eth_dev *dev, uint16_t queue_id, qinfo->conf.tx_free_thresh = txq->free_thresh; qinfo->conf.tx_rs_thresh = txq->rs_thresh; - qinfo->conf.txq_flags = txq->txq_flags; + qinfo->conf.offloads = txq->offloads; qinfo->conf.tx_deferred_start = txq->tx_deferred_start; } diff --git a/drivers/net/avf/avf_rxtx.h b/drivers/net/avf/avf_rxtx.h index d1701cd63e..297d0776d4 100644 --- a/drivers/net/avf/avf_rxtx.h +++ b/drivers/net/avf/avf_rxtx.h @@ -22,8 +22,12 @@ #define AVF_VPMD_DESCS_PER_LOOP 4 #define AVF_VPMD_TX_MAX_FREE_BUF 64 -#define AVF_SIMPLE_FLAGS ((uint32_t)ETH_TXQ_FLAGS_NOMULTSEGS | \ - ETH_TXQ_FLAGS_NOOFFLOADS) +#define AVF_NO_VECTOR_FLAGS ( \ + DEV_TX_OFFLOAD_MULTI_SEGS | \ + DEV_TX_OFFLOAD_VLAN_INSERT | \ + DEV_TX_OFFLOAD_SCTP_CKSUM | \ + DEV_TX_OFFLOAD_UDP_CKSUM | \ + DEV_TX_OFFLOAD_TCP_CKSUM) #define DEFAULT_TX_RS_THRESH 32 #define DEFAULT_TX_FREE_THRESH 32 @@ -125,7 +129,7 @@ struct avf_tx_queue { uint16_t port_id; uint16_t queue_id; - uint32_t txq_flags; + uint64_t offloads; uint16_t next_dd; /* next to set RS, for VPMD */ uint16_t next_rs; /* next to check DD, for VPMD */