DPDK patches and discussions
 help / color / mirror / Atom feed
From: David Marchand <david.marchand@redhat.com>
To: "Min Hu (Connor)" <humin29@huawei.com>
Cc: dev <dev@dpdk.org>, "Yigit, Ferruh" <ferruh.yigit@intel.com>
Subject: Re: [dpdk-dev] [PATCH 5/5] net/hns3: select Tx prepare based on Tx offload
Date: Fri, 7 May 2021 11:26:59 +0200	[thread overview]
Message-ID: <CAJFAV8y71u4qrxpBaSrazChxUyRUkDpp=GS3bL-1KNPW0ugkxw@mail.gmail.com> (raw)
In-Reply-To: <1619594455-56787-6-git-send-email-humin29@huawei.com>

On Wed, Apr 28, 2021 at 9:21 AM Min Hu (Connor) <humin29@huawei.com> wrote:
>
> From: Chengchang Tang <tangchengchang@huawei.com>
>
> Tx prepare should be called only when necessary to reduce the impact on
> performance.
>
> For partial TX offload, users need to call rte_eth_tx_prepare() to invoke
> the tx_prepare callback of PMDs. In this callback, the PMDs adjust the
> packet based on the offloading used by the user. (e.g. For some PMDs,
> pseudo-headers need to be calculated when the TX cksum is offloaded.)
>
> However, for the users, they cannot grasp all the hardware and PMDs
> characteristics. As a result, users cannot decide when they need to
> actually call tx_prepare. Therefore, we should assume that the user calls
> rte_eth_tx_prepare() when using any Tx offloading to ensure that related
> functions work properly. Whether packets need to be adjusted should be
> determined by PMDs. They can make judgments in the dev_configure or
> queue_setup phase. When the related function is not used, the pointer of
> tx_prepare should be set to NULL to reduce the performance loss caused by
> invoking rte_eth_tx_repare().
>
> In this patch, if tx_prepare is not required for the offloading used by
> the users, the tx_prepare pointer will be set to NULL.
>
> Fixes: bba636698316 ("net/hns3: support Rx/Tx and related operations")
> Cc: stable@dpdk.org
>
> Signed-off-by: Chengchang Tang <tangchengchang@huawei.com>
> Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
> ---
>  drivers/net/hns3/hns3_rxtx.c | 36 +++++++++++++++++++++++++++++++++---
>  1 file changed, 33 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/net/hns3/hns3_rxtx.c b/drivers/net/hns3/hns3_rxtx.c
> index 3881a72..7ac3a48 100644
> --- a/drivers/net/hns3/hns3_rxtx.c
> +++ b/drivers/net/hns3/hns3_rxtx.c
> @@ -4203,17 +4203,45 @@ hns3_tx_check_simple_support(struct rte_eth_dev *dev)
>         return (offloads == (offloads & DEV_TX_OFFLOAD_MBUF_FAST_FREE));
>  }
>
> +static bool
> +hns3_get_tx_prep_needed(struct rte_eth_dev *dev)
> +{
> +#ifdef RTE_LIBRTE_ETHDEV_DEBUG
> +       /* always perform tx_prepare when debug */
> +       return true;

dev is unused in this case.
http://mails.dpdk.org/archives/test-report/2021-May/193391.html


-- 
David Marchand


  reply	other threads:[~2021-05-07  9:27 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-28  7:20 [dpdk-dev] [PATCH 0/5] Features and bugfix for hns3 PMD Min Hu (Connor)
2021-04-28  7:20 ` [dpdk-dev] [PATCH 1/5] net/hns3: support preferred burst size and queues in VF Min Hu (Connor)
2021-04-28  7:20 ` [dpdk-dev] [PATCH 2/5] net/hns3: log time delta in decimal format Min Hu (Connor)
2021-04-28  7:20 ` [dpdk-dev] [PATCH 3/5] net/hns3: fix use wrong time API Min Hu (Connor)
2021-04-28  7:20 ` [dpdk-dev] [PATCH 4/5] net/hns3: delete unused macro of cmd module Min Hu (Connor)
2021-04-28  7:20 ` [dpdk-dev] [PATCH 5/5] net/hns3: select Tx prepare based on Tx offload Min Hu (Connor)
2021-05-07  9:26   ` David Marchand [this message]
2021-05-07 10:23     ` Ferruh Yigit
2021-05-07 12:20       ` [dpdk-dev] [PATCH] net/hns3: fix debug build Thomas Monjalon
2021-05-07 12:25         ` David Marchand
2021-05-07 12:49           ` Thomas Monjalon
2021-05-08  0:47           ` Min Hu (Connor)
2021-04-29 16:27 ` [dpdk-dev] [PATCH 0/5] Features and bugfix for hns3 PMD Ferruh Yigit

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='CAJFAV8y71u4qrxpBaSrazChxUyRUkDpp=GS3bL-1KNPW0ugkxw@mail.gmail.com' \
    --to=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=humin29@huawei.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).