From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 4C95FA04B1; Tue, 24 Nov 2020 11:27:59 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 2E219C92A; Tue, 24 Nov 2020 11:27:58 +0100 (CET) Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) by dpdk.org (Postfix) with ESMTP id 2BB49C926 for ; Tue, 24 Nov 2020 11:27:56 +0100 (CET) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id A559F5C0203; Tue, 24 Nov 2020 05:27:55 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Tue, 24 Nov 2020 05:27:55 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s=fm2; bh= Szgjt62DNaN8dFaBm1fiBl1Ax8lhEsl3r8HtkOy7sYM=; b=WJFnvsW5loCbJQQ/ Rugycpg2Y9WgG8opaf/mDCCLRjZucyvEJIuW3iTQRcI+Vs8Ve0vBVw4XvWAbGZVS VC3EMmuDJIaAer1hOrpiBNOFCbGYGo+A4G2kiNk6ZrtjfQ1JF3xY7d2CnpB9hY5g yaeIFltn2WG8mTvc5U478pMZ679/A7A5jb/7FjnY493RBuFL7A5UrjO23XoIgppV OZl4f1NF6672q3gDDGwoGFEZhubqh9F0FUjwhpJb8z3Sql9e0YNn+qi9qoHND+Bw a9jolZCIXBx4bYswf3XGD9kuB9WGBTYiezdiCoi8zu536nJsbLANN9rPW3MONfze NexRWg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=Szgjt62DNaN8dFaBm1fiBl1Ax8lhEsl3r8HtkOy7s YM=; b=VbmeGvSQ6C0feogcxPGdmPVIVV9dN/mb8anLw9XQ335u0QhijP2B0Whc9 +7YMlcREWeinmaP3P+8m9s0VdVH0Akex+Kkk4MLhmz4szAiyFJEqTU59F3homlCs A3z85mDlL7aLvhbuR94ONt37cg5Jn+Vzcw5qLXiJ/Mogz8KAuDiKE5BRPOwEMXwE yqzE6ZqIJEwZtXX/fhHm/12kC2+xFTkGJ76tv3coyG5KwaEEdQub7Ile2anrZ/2u yXOco+wqoZT7TYrKeRXC7cJAmiaN1lFJo8ALD6jW/iZBwrB6MMg+4hKlQ8pI3eG3 oeRfQ1Y7W07yBq43CKJzZaYCrSvgw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedrudegkedgudehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkfgjfhgggfgtsehtufertddttddvnecuhfhrohhmpefvhhhomhgr shcuofhonhhjrghlohhnuceothhhohhmrghssehmohhnjhgrlhhonhdrnhgvtheqnecugg ftrfgrthhtvghrnhepudeggfdvfeduffdtfeeglefghfeukefgfffhueejtdetuedtjeeu ieeivdffgeehnecukfhppeejjedrudefgedrvddtfedrudekgeenucevlhhushhtvghruf hiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehthhhomhgrshesmhhonhhjrghl ohhnrdhnvght X-ME-Proxy: Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id 9791E3064AA6; Tue, 24 Nov 2020 05:27:53 -0500 (EST) From: Thomas Monjalon To: "Wei Hu (Xavier)" , "ferruh.yigit@intel.com" Cc: "dev@dpdk.org" , "xavier.huwei@huawei.com" , Slava Ovsiienko Date: Tue, 24 Nov 2020 11:27:51 +0100 Message-ID: <3600731.79S79Y1HSu@thomas> In-Reply-To: References: <20200818120254.72792-1-huwei013@chinasoftinc.com> <20200925124719.26001-4-huwei013@chinasoftinc.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH v4 3/6] app/testpmd: remove restriction on txpkts set X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Is it OK to keep this regression? Ferruh, what do you suggest? 23/11/2020 12:50, Slava Ovsiienko: > Hi, Wei > > It was found this patch rejects the --txpkts command line settings. > set_tx_pkt_segments() is called before device started and > we have failure chain: > > set_tx_pkt_segments() > nb_segs_is_invalid() > get_tx_ring_size () > rte_eth_tx_queue_info_get() > > It causes --txpkts testpmd command line option is ignored. > > With best regards, Slava > > > -----Original Message----- > > From: dev On Behalf Of Wei Hu (Xavier) > > Sent: Friday, September 25, 2020 15:47 > > To: dev@dpdk.org > > Cc: xavier.huwei@huawei.com > > Subject: [dpdk-dev] [PATCH v4 3/6] app/testpmd: remove restriction on txpkts > > set > > > > From: Chengchang Tang > > > > Currently, if nb_txd is not set, the txpkts is not allowed to be set because the > > nb_txd is used to avoid the numer of segments exceed the Tx ring size and the > > default value of nb_txd is 0. And there is a bug that nb_txd is the global > > configuration for Tx ring size and the ring size could be changed by some > > command per queue. So these valid check is unreliable and introduced > > unnecessary constraints. > > > > This patch adds a valid check function to use the real Tx ring size to check the > > validity of txpkts. > > > > Fixes: af75078fece3 ("first public release") > > Cc: stable@dpdk.org > > > > Signed-off-by: Chengchang Tang > > Signed-off-by: Wei Hu (Xavier) > > --- > > v3 -> v4: > > add check 'rte_eth_rx_queue_info_get()' return value and > > if it is '-ENOSTUP' calculate the 'ring_size'. > > v3: initial version. > > --- > > app/test-pmd/config.c | 64 > > +++++++++++++++++++++++++++++++++++++++++++++++---- > > 1 file changed, 60 insertions(+), 4 deletions(-) > > > > diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c index > > 6496d2f..8ebb927 100644 > > --- a/app/test-pmd/config.c > > +++ b/app/test-pmd/config.c > > @@ -1893,6 +1893,38 @@ tx_queue_id_is_invalid(queueid_t txq_id) } > > > > static int > > +get_tx_ring_size(portid_t port_id, queueid_t txq_id, uint16_t > > +*ring_size) { > > + struct rte_port *port = &ports[port_id]; > > + struct rte_eth_txq_info tx_qinfo; > > + int ret; > > + > > + ret = rte_eth_tx_queue_info_get(port_id, txq_id, &tx_qinfo); > > + if (ret == 0) { > > + *ring_size = tx_qinfo.nb_desc; > > + return ret; > > + } > > + > > + if (ret != -ENOTSUP) > > + return ret; > > + /* > > + * If the rte_eth_tx_queue_info_get is not support for this PMD, > > + * ring_size stored in testpmd will be used for validity verification. > > + * When configure the txq by rte_eth_tx_queue_setup with > > nb_tx_desc > > + * being 0, it will use a default value provided by PMDs to setup this > > + * txq. If the default value is 0, it will use the > > + * RTE_ETH_DEV_FALLBACK_TX_RINGSIZE to setup this txq. > > + */ > > + if (port->nb_tx_desc[txq_id]) > > + *ring_size = port->nb_tx_desc[txq_id]; > > + else if (port->dev_info.default_txportconf.ring_size) > > + *ring_size = port->dev_info.default_txportconf.ring_size; > > + else > > + *ring_size = RTE_ETH_DEV_FALLBACK_TX_RINGSIZE; > > + return 0; > > +} > > + > > +static int > > rx_desc_id_is_invalid(uint16_t rxdesc_id) { > > if (rxdesc_id < nb_rxd) > > @@ -2986,17 +3018,41 @@ show_tx_pkt_segments(void) > > printf("Split packet: %s\n", split); > > } > > > > +static bool > > +nb_segs_is_invalid(unsigned int nb_segs) { > > + uint16_t ring_size; > > + uint16_t queue_id; > > + uint16_t port_id; > > + int ret; > > + > > + RTE_ETH_FOREACH_DEV(port_id) { > > + for (queue_id = 0; queue_id < nb_txq; queue_id++) { > > + ret = get_tx_ring_size(port_id, queue_id, &ring_size); > > + > > + if (ret) > > + return true; > > + > > + if (ring_size < nb_segs) { > > + printf("nb segments per TX packets=%u >= " > > + "TX queue(%u) ring_size=%u - ignored\n", > > + nb_segs, queue_id, ring_size); > > + return true; > > + } > > + } > > + } > > + > > + return false; > > +} > > + > > void > > set_tx_pkt_segments(unsigned *seg_lengths, unsigned nb_segs) { > > uint16_t tx_pkt_len; > > unsigned i; > > > > - if (nb_segs >= (unsigned) nb_txd) { > > - printf("nb segments per TX packets=%u >= nb_txd=%u - > > ignored\n", > > - nb_segs, (unsigned int) nb_txd); > > + if (nb_segs_is_invalid(nb_segs)) > > return; > > - } > > > > /* > > * Check that each segment length is greater or equal than > > -- > > 2.9.5 > >