* [dpdk-dev] [PATCH] net/avf: convert to new RX/TX offload API @ 2018-03-01 6:41 Wenzhuo Lu 2018-03-29 10:29 ` Xing, Beilei 0 siblings, 1 reply; 3+ messages in thread From: Wenzhuo Lu @ 2018-03-01 6:41 UTC (permalink / raw) To: dev; +Cc: Wenzhuo Lu Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com> --- drivers/net/avf/avf_ethdev.c | 6 +++--- drivers/net/avf/avf_rxtx.c | 6 +++--- drivers/net/avf/avf_rxtx.h | 10 +++++++--- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/drivers/net/avf/avf_ethdev.c b/drivers/net/avf/avf_ethdev.c index 4df6617..444e0e7 100644 --- a/drivers/net/avf/avf_ethdev.c +++ b/drivers/net/avf/avf_ethdev.c @@ -532,13 +532,13 @@ static int avf_config_rx_queues_irqs(struct rte_eth_dev *dev, 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 @@ static int avf_config_rx_queues_irqs(struct rte_eth_dev *dev, /* 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 d276d97..1824ed7 100644 --- a/drivers/net/avf/avf_rxtx.c +++ b/drivers/net/avf/avf_rxtx.c @@ -109,7 +109,7 @@ 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 @@ 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 @@ 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 d1701cd..297d077 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 */ -- 1.9.3 ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [dpdk-dev] [PATCH] net/avf: convert to new RX/TX offload API 2018-03-01 6:41 [dpdk-dev] [PATCH] net/avf: convert to new RX/TX offload API Wenzhuo Lu @ 2018-03-29 10:29 ` Xing, Beilei 2018-03-29 16:11 ` Zhang, Helin 0 siblings, 1 reply; 3+ messages in thread From: Xing, Beilei @ 2018-03-29 10:29 UTC (permalink / raw) To: Lu, Wenzhuo, dev; +Cc: Lu, Wenzhuo > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Wenzhuo Lu > Sent: Thursday, March 1, 2018 2:42 PM > To: dev@dpdk.org > Cc: Lu, Wenzhuo <wenzhuo.lu@intel.com> > Subject: [dpdk-dev] [PATCH] net/avf: convert to new RX/TX offload API > > Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com> > --- > drivers/net/avf/avf_ethdev.c | 6 +++--- > drivers/net/avf/avf_rxtx.c | 6 +++--- > drivers/net/avf/avf_rxtx.h | 10 +++++++--- > 3 files changed, 13 insertions(+), 9 deletions(-) > > diff --git a/drivers/net/avf/avf_ethdev.c b/drivers/net/avf/avf_ethdev.c > index 4df6617..444e0e7 100644 > --- a/drivers/net/avf/avf_ethdev.c > +++ b/drivers/net/avf/avf_ethdev.c > @@ -532,13 +532,13 @@ static int avf_config_rx_queues_irqs(struct > rte_eth_dev *dev, > 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 > @@ static int avf_config_rx_queues_irqs(struct rte_eth_dev *dev, > /* 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 > d276d97..1824ed7 100644 > --- a/drivers/net/avf/avf_rxtx.c > +++ b/drivers/net/avf/avf_rxtx.c > @@ -109,7 +109,7 @@ > 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 @@ > 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 @@ > > 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 > d1701cd..297d077 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 */ > > -- > 1.9.3 Acked-by: Beilei Xing <beilei.xing@intel.com> ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [dpdk-dev] [PATCH] net/avf: convert to new RX/TX offload API 2018-03-29 10:29 ` Xing, Beilei @ 2018-03-29 16:11 ` Zhang, Helin 0 siblings, 0 replies; 3+ messages in thread From: Zhang, Helin @ 2018-03-29 16:11 UTC (permalink / raw) To: Xing, Beilei, Lu, Wenzhuo, dev; +Cc: Lu, Wenzhuo > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Xing, Beilei > Sent: Thursday, March 29, 2018 6:30 PM > To: Lu, Wenzhuo; dev@dpdk.org > Cc: Lu, Wenzhuo > Subject: Re: [dpdk-dev] [PATCH] net/avf: convert to new RX/TX offload API > > > -----Original Message----- > > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Wenzhuo Lu > > Sent: Thursday, March 1, 2018 2:42 PM > > To: dev@dpdk.org > > Cc: Lu, Wenzhuo <wenzhuo.lu@intel.com> > > Subject: [dpdk-dev] [PATCH] net/avf: convert to new RX/TX offload API > > > > Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com> > > --- > > drivers/net/avf/avf_ethdev.c | 6 +++--- > > drivers/net/avf/avf_rxtx.c | 6 +++--- > > drivers/net/avf/avf_rxtx.h | 10 +++++++--- > > 3 files changed, 13 insertions(+), 9 deletions(-) > > > > diff --git a/drivers/net/avf/avf_ethdev.c > > b/drivers/net/avf/avf_ethdev.c index 4df6617..444e0e7 100644 > > --- a/drivers/net/avf/avf_ethdev.c > > +++ b/drivers/net/avf/avf_ethdev.c > > @@ -532,13 +532,13 @@ static int avf_config_rx_queues_irqs(struct > > rte_eth_dev *dev, > > 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 > > @@ static int avf_config_rx_queues_irqs(struct rte_eth_dev *dev, > > /* 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 > > d276d97..1824ed7 100644 > > --- a/drivers/net/avf/avf_rxtx.c > > +++ b/drivers/net/avf/avf_rxtx.c > > @@ -109,7 +109,7 @@ > > 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 @@ > > 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 @@ > > > > 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 > > d1701cd..297d077 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 */ > > > > -- > > 1.9.3 > > Acked-by: Beilei Xing <beilei.xing@intel.com> Applied to dpdk-next-net-intel, with minor commit log changes. Thanks! /Helin ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-03-29 16:11 UTC | newest] Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2018-03-01 6:41 [dpdk-dev] [PATCH] net/avf: convert to new RX/TX offload API Wenzhuo Lu 2018-03-29 10:29 ` Xing, Beilei 2018-03-29 16:11 ` Zhang, Helin
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).