From: "Xing, Beilei" <beilei.xing@intel.com>
To: "Lu, Wenzhuo" <wenzhuo.lu@intel.com>, "dev@dpdk.org" <dev@dpdk.org>
Cc: "Lu, Wenzhuo" <wenzhuo.lu@intel.com>
Subject: Re: [dpdk-dev] [PATCH] net/avf: convert to new RX/TX offload API
Date: Thu, 29 Mar 2018 10:29:53 +0000 [thread overview]
Message-ID: <94479800C636CB44BD422CB454846E01320FA43F@SHSMSX101.ccr.corp.intel.com> (raw)
In-Reply-To: <1519886506-87069-1-git-send-email-wenzhuo.lu@intel.com>
> -----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>
next prev parent reply other threads:[~2018-03-29 10:29 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-01 6:41 Wenzhuo Lu
2018-03-29 10:29 ` Xing, Beilei [this message]
2018-03-29 16:11 ` Zhang, Helin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=94479800C636CB44BD422CB454846E01320FA43F@SHSMSX101.ccr.corp.intel.com \
--to=beilei.xing@intel.com \
--cc=dev@dpdk.org \
--cc=wenzhuo.lu@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).