From: Chengchang Tang <tangchengchang@huawei.com>
To: Olivier Matz <olivier.matz@6wind.com>,
Thomas Monjalon <thomas@monjalon.net>
Cc: Ferruh Yigit <ferruh.yigit@intel.com>,
"dev@dpdk.org" <dev@dpdk.org>, <linuxarm@openeuler.org>,
<konstantin.ananyev@intel.com>
Subject: Re: [dpdk-dev] [Question about 'rte_eth_tx_prepare']
Date: Tue, 9 Feb 2021 09:13:27 +0800 [thread overview]
Message-ID: <d97f30a2-59e2-a435-96e5-0736e747c911@huawei.com> (raw)
In-Reply-To: <20210208084045.GD1725@platinum>
On 2021/2/8 16:40, Olivier Matz wrote:
> Hi,
>
> On Mon, Feb 08, 2021 at 09:07:39AM +0100, Thomas Monjalon wrote:
>> 08/02/2021 07:29, Chengchang Tang:
>>> Hi, Thomas Monjalon and Ferruh Yigit and others.
>>>
>>> Here are two questions:
>>> 1. What functions should be included in the 'tx_prepare' for PMDs?
>>> 2. Whether an app must invoke 'rte_eth_tx_prepare' or under which
>>> conditions an app must invoke the 'rte_eth_tx_prepare'?
>>
>> I would say by default the app should prepare the checksums,
>> except if there is an explicit offload request (DEV_TX_OFFLOAD_*).
>> I think the tx_prepare should only prepare the HW Tx offload
>> if the offload is not entirely done in HW.
>
> On our side, we call tx_prepare() on a tx bulk if:
>
> 1/ a Tx offload is enabled on the port (DEV_TX_OFFLOAD_*)
> 2/ at least one mbuf in the bulk has an offload flag among
> PKT_TX_OFFLOAD_MASK
>
> The purpose of tx_prepare() is to check that offload can be done in hw,
> and to prepare the packet data for the hw. For instance, niantics NICs
> require that the L4 checksum in the packet is set to the pseudo-header
> checksum.
>
> This could have be done in the tx() function, but it is a separated
> function for 2 reasons:
> - the application does not need to call it if it does not do hw tx offload
> - the tx_prepare() function may modify packet data, which should not be the
> case for tx(). In a pipeline model, these 2 functions may be called on
> different cores.
>
> In my opinion, the tx_prepare() function should deal with outer checksums
> preparation as well.
>
> Olivier
>
> .
Thank you, Thomas and Olivier. It's really helpful.
Chengchang
prev parent reply other threads:[~2021-02-09 1:13 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-08 6:29 Chengchang Tang
2021-02-08 8:07 ` Thomas Monjalon
2021-02-08 8:40 ` Olivier Matz
2021-02-09 1:13 ` Chengchang Tang [this message]
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=d97f30a2-59e2-a435-96e5-0736e747c911@huawei.com \
--to=tangchengchang@huawei.com \
--cc=dev@dpdk.org \
--cc=ferruh.yigit@intel.com \
--cc=konstantin.ananyev@intel.com \
--cc=linuxarm@openeuler.org \
--cc=olivier.matz@6wind.com \
--cc=thomas@monjalon.net \
/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).