From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id D139345E1E for ; Tue, 3 Dec 2024 19:35:41 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C78D24025D; Tue, 3 Dec 2024 19:35:41 +0100 (CET) Received: from mail-pf1-f173.google.com (mail-pf1-f173.google.com [209.85.210.173]) by mails.dpdk.org (Postfix) with ESMTP id EB5234025D for ; Tue, 3 Dec 2024 19:35:40 +0100 (CET) Received: by mail-pf1-f173.google.com with SMTP id d2e1a72fcca58-724f42c1c38so5114109b3a.1 for ; Tue, 03 Dec 2024 10:35:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1733250940; x=1733855740; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=ZDrzO+/glvONeepsX+B3qm/Duyatec0i5FbbMXXZVq4=; b=Aiaq44ck/K2SPipjXPkbtzAihzlX2VeJ++1HPiygs8dKuzWk3n4pGHGE0Xp6ONSxqm VZYOc51pWqROF/G1hYja/pzf6ixYP6X3eY0g1KSHd65YG7cyC9qipQiAQX+Bu65+Qp/J Gexurbj9HB1oWo5gPrIYCVvjAvTibjV9eyN/Od11NJwo7KZpAVYz0ME8OMUwvarcIogE CeCBgT4rkUE44+RDyd8vLYkktWw6y2G+lFWJXZpyVE35V/wnzcRniCMl1n5iLDi+yb2J eL7aB/7DfWa7kY4fe+xVCXd+E/xV/Flkt89mkeS3FTMuonpbjMaWWjw3u1P67o/s/9aW oNcQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733250940; x=1733855740; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ZDrzO+/glvONeepsX+B3qm/Duyatec0i5FbbMXXZVq4=; b=Z+N3wVVbxCSO85ukPnfYbKYCoCreWRnpM8acG82d06XNAnTFHK7yywZFuJ9bTmoBdg I6M8aGT0GAZNNbvYx0FVeeACJfuGOALvpSDoKsMKjE7s/WHXGOwPqfqYTC07/y6cc3w1 aLWmo5ooi4rvAthrv88e6hPGmIpgKQ2LxF9EACHDCn5QGVFPVoLUsezGAUCjbTg7iUK/ KAnCUa5sGSQWWLc/B5XUZf/QtHkYeF0KIl+mLU4rVXReJsO9xF10NhhfNrSbvJoJpwS8 HkBxa0aBNcw3Iw+KGQaWn/5x8ixyTr6ldnlNodY0uJdGN7dAWGLHi6zkrMafEGRyI9Ye PmKg== X-Forwarded-Encrypted: i=1; AJvYcCVzDgFK7H8VUGd30Ro+//VKt6YERbP9lFKhWot2WgxBTodKFc8IICO+3IfDZSgj/4MqE1APcBc=@dpdk.org X-Gm-Message-State: AOJu0YyV0Zf4xd8OG5FK11mNXHyzmZBEBXGyMdfvTzgx30to3LbPVy3z /zCTxAacoVZIl8FYYSU4JdRYxRf/1idjZbh6755Pfg8PHK99G8ubEgbBjgLhtxc= X-Gm-Gg: ASbGncvVDF8/242CV0Q6iKKnp+xFnjSK20c+AbMxW6VJERcDiNnYfysjOF34D2Kcj7G BKLRNLjVcRX0iQIpvjLGWCDtZJxeGFFMQP4ZyBsCYnb5TSYV66TrdeXqNdftD4arJ7pnh81N+Q/ 5g51pmfRKCwxljYCM6MREVJu3onwp2WAb5AiH+cJ9CjwDq6FqzoHo7Y/P6JFjW2jMGg2MLFB4yx dCoQ0TiEml6t2M9Nj4dBc7VJR1yUy64VsBd5FpV2TM4RgzPsFYfu/7DUvK2NT2nVdfvsARTBqqw bU4KqIpfrqTzNppkEMC8QwusOlc= X-Google-Smtp-Source: AGHT+IH7xMAdyaMqAY2nMaTaR/1l0E4xGsrYu3zrukSaOn8uSRFJXw1vPvLvMIDiDF0iTwLk8ULcNQ== X-Received: by 2002:a05:6a00:13a7:b0:725:30f3:67d8 with SMTP id d2e1a72fcca58-7257f976c14mr4407875b3a.0.1733250939863; Tue, 03 Dec 2024 10:35:39 -0800 (PST) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-72541761316sm10818050b3a.18.2024.12.03.10.35.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Dec 2024 10:35:39 -0800 (PST) Date: Tue, 3 Dec 2024 10:35:37 -0800 From: Stephen Hemminger To: Kaiwen Deng Cc: dev@dpdk.org, stable@dpdk.org, qiming.yang@intel.com, yidingx.zhou@intel.com, Aman Singh , Yuying Zhang , David Marchand , Ferruh Yigit Subject: Re: [PATCH v1] app/testpmd: use Tx preparation in txonly engine Message-ID: <20241203103537.08712b3b@hermes.local> In-Reply-To: <20240103012912.4334-1-kaiwenx.deng@intel.com> References: <20240103012912.4334-1-kaiwenx.deng@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org On Wed, 3 Jan 2024 09:29:12 +0800 Kaiwen Deng 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 > --- > 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.