From: Stephen Hemminger <stephen@networkplumber.org>
To: Kaiwen Deng <kaiwenx.deng@intel.com>
Cc: dev@dpdk.org, stable@dpdk.org, qiming.yang@intel.com,
yidingx.zhou@intel.com, Aman Singh <aman.deep.singh@intel.com>,
Yuying Zhang <yuying.zhang@intel.com>,
David Marchand <david.marchand@redhat.com>,
Ferruh Yigit <ferruh.yigit@amd.com>
Subject: Re: [PATCH v1] app/testpmd: use Tx preparation in txonly engine
Date: Tue, 3 Dec 2024 10:35:37 -0800 [thread overview]
Message-ID: <20241203103537.08712b3b@hermes.local> (raw)
In-Reply-To: <20240103012912.4334-1-kaiwenx.deng@intel.com>
On Wed, 3 Jan 2024 09:29:12 +0800
Kaiwen Deng <kaiwenx.deng@intel.com> wrote:
> Txonly forwarding engine does not call the Tx preparation API
> before transmitting packets. This may cause some problems.
>
> TSO breaks when MSS spans more than 8 data fragments. Those
> packets will be dropped by Tx preparation API, but it will cause
> MDD event if txonly forwarding engine does not call the Tx preparation
> API before transmitting packets.
>
> We can reproduce this issue by these steps list blow on ICE and I40e.
>
> ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -c 0xf -n 4 -- -i
> --tx-offloads=0x00008000
>
> testpmd>set txpkts 64,128,256,512,64,128,256,512,512
> testpmd>set burst 1
> testpmd>start tx_first 1
>
> This commit will use Tx preparation API in txonly forwarding engine.
>
> Fixes: 655131ccf727 ("app/testpmd: factorize fwd engines Tx")
> Cc: stable@dpdk.org
>
> Signed-off-by: Kaiwen Deng <kaiwenx.deng@intel.com>
> ---
> app/test-pmd/txonly.c | 13 ++++++++++++-
> 1 file changed, 12 insertions(+), 1 deletion(-)
>
> diff --git a/app/test-pmd/txonly.c b/app/test-pmd/txonly.c
> index c2b88764be..60d69be3f6 100644
> --- a/app/test-pmd/txonly.c
> +++ b/app/test-pmd/txonly.c
> @@ -339,6 +339,7 @@ pkt_burst_transmit(struct fwd_stream *fs)
> struct rte_ether_hdr eth_hdr;
> uint16_t nb_tx;
> uint16_t nb_pkt;
> + uint16_t nb_prep;
> uint16_t vlan_tci, vlan_tci_outer;
> uint64_t ol_flags = 0;
> uint64_t tx_offloads;
> @@ -396,7 +397,17 @@ pkt_burst_transmit(struct fwd_stream *fs)
> if (nb_pkt == 0)
> return false;
>
> - nb_tx = common_fwd_stream_transmit(fs, pkts_burst, nb_pkt);
> + nb_prep = rte_eth_tx_prepare(fs->tx_port, fs->tx_queue,
> + pkts_burst, nb_pkt);
> + if (unlikely(nb_prep != nb_pkt)) {
> + fprintf(stderr,
> + "Preparing packet burst to transmit failed: %s\n",
> + rte_strerror(rte_errno));
> + fs->fwd_dropped += (nb_pkt - nb_prep);
> + rte_pktmbuf_free_bulk(&pkts_burst[nb_prep], nb_pkt - nb_prep);
> + }
> +
> + nb_tx = common_fwd_stream_transmit(fs, pkts_burst, nb_prep);
The comment section on this patch raises lots of good points.
1. Testpmd and example applications are not calling tx_prepare.
2. Testpmd and examples are not checking descriptor limits.
3. It is not clear from documentation when tx_prepare is required.
On a practical level, if testpmd was being used in txonly mode,
if the condition ever triggered, you really really don't want to
print a message there since it would likely be endless stream of messages.
Please consider the comments and come back with a better solution in v2.
prev parent reply other threads:[~2024-12-03 18:35 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-03 1:29 Kaiwen Deng
2024-01-04 1:03 ` Stephen Hemminger
2024-01-04 5:52 ` Jerin Jacob
2024-01-11 5:25 ` [PATCH v2] " Kaiwen Deng
2024-01-11 6:34 ` lihuisong (C)
2024-01-11 16:57 ` Stephen Hemminger
2024-01-12 16:00 ` David Marchand
2024-02-08 0:07 ` Ferruh Yigit
2024-02-08 10:50 ` Konstantin Ananyev
2024-02-08 11:35 ` Ferruh Yigit
2024-02-08 15:14 ` Konstantin Ananyev
2024-02-08 11:52 ` Morten Brørup
2024-02-11 15:04 ` Konstantin Ananyev
2024-02-13 10:27 ` Morten Brørup
2024-02-22 18:28 ` Konstantin Ananyev
2024-02-23 8:36 ` Andrew Rybchenko
2024-02-26 13:26 ` Konstantin Ananyev
2024-02-26 13:56 ` Morten Brørup
2024-02-27 10:41 ` Konstantin Ananyev
2024-02-08 12:09 ` Jerin Jacob
2024-02-09 19:18 ` Ferruh Yigit
2024-12-03 18:35 ` Stephen Hemminger [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=20241203103537.08712b3b@hermes.local \
--to=stephen@networkplumber.org \
--cc=aman.deep.singh@intel.com \
--cc=david.marchand@redhat.com \
--cc=dev@dpdk.org \
--cc=ferruh.yigit@amd.com \
--cc=kaiwenx.deng@intel.com \
--cc=qiming.yang@intel.com \
--cc=stable@dpdk.org \
--cc=yidingx.zhou@intel.com \
--cc=yuying.zhang@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).