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 7A211A054F; Wed, 25 May 2022 12:34:48 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 69F0A427F0; Wed, 25 May 2022 12:34:48 +0200 (CEST) Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) by mails.dpdk.org (Postfix) with ESMTP id E93C040E78; Wed, 25 May 2022 12:34:47 +0200 (CEST) Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id A41575C01EC; Wed, 25 May 2022 06:34:47 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Wed, 25 May 2022 06:34:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= cc:cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm1; t=1653474887; x= 1653561287; bh=+KerUOlDfE6iE+Ar6bwN4NGAImH2f3R4I5Rx/OravGo=; b=K CtZhwJ94Ht44kjqct1S+U1+dS3iGzwxm6la2pMmsM/LWrk5AUS+gIsEIHfw6xxNn l1tKT3w+xfApmx1MhKHTv5BE/RgUwu52jKJga5+xw9sxXe5nNJ6oeVVbdxfvPmDt Xen/uDoM2WDMx9Z/Rbh7hSPg8FgX+XpMnabIZCgp+0DtWK1l39SVkbEfPAuDZdNj UxDSX5vI+lDW35jcvionF7fzsWN2wJWb2vvsMuI5mDSM1LP/0qYzfmBEjWWostZ+ JwLZiIfcUkQTrZTICyh/3p5DoFcVEfRzqVpJDdrl6WBW/EOJSSbjbpBzDufbbONm iwpgRiy59KHSGUMhvxWhA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1653474887; x= 1653561287; bh=+KerUOlDfE6iE+Ar6bwN4NGAImH2f3R4I5Rx/OravGo=; b=T gk6HJ9wbq//dkivumuQaJ5IQWRI7MXjKaIQsgiLb4VPRNIezQyMLXe558+U3DdXq d09UGz10gzd4+qtMsDhQMy29IDhb5qEZT2GoeU56BBlFfLifMiRhf6bTHqxcLL/4 VfN6ZIeg+R1GkLZcQmZRz6i1WsMiGXk8tRObgFsT/Mu7QKcvv06jF7fzJThmNNLl ktX7B4psHm36italcNq0L9JEmYBsolCzn4O+nL7P8UhD6YBF2YsIijygd3jEUNPq jjyCip7IbXMEOWDdTMOQkAsSqAj1bIOBrCCpC5JBPKomDUODBo28cgpDqPvF148O Cw2RA1e0K/YiRmDRQd+5w== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrjeehgddvkecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvfevufffkfgjfhgggfgtsehtufertddttddvnecuhfhrohhmpefvhhhomhgr shcuofhonhhjrghlohhnuceothhhohhmrghssehmohhnjhgrlhhonhdrnhgvtheqnecugg ftrfgrthhtvghrnhepjeejffffgfffkeefffelgfekleetjeffleeludeghfehleffteeh veduffdugfdvnecuffhomhgrihhnpeguphgukhdrohhrghenucevlhhushhtvghrufhiii gvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehthhhomhgrshesmhhonhhjrghlohhn rdhnvght X-ME-Proxy: Feedback-ID: i47234305:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 25 May 2022 06:34:46 -0400 (EDT) From: Thomas Monjalon To: Dmitry Kozlyuk Cc: dev@dpdk.org, stable@dpdk.org, Ferruh Yigit , Andrew Rybchenko Subject: Re: [PATCH] ethdev: prohibit polling of a stopped queue Date: Wed, 25 May 2022 12:34:37 +0200 Message-ID: <4594382.neEnAmRlxL@thomas> In-Reply-To: <2298145.NG923GbCHz@thomas> References: <20220410213550.1733330-1-dkozlyuk@nvidia.com> <2298145.NG923GbCHz@thomas> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org 25/04/2022 10:30, Thomas Monjalon: > 10/04/2022 23:35, Dmitry Kozlyuk: > > Whether it is allowed to call Rx/Tx functions for a stopped queue > > was undocumented. Some PMDs make this behavior a no-op > > either by explicitly checking the queue state > > or by the way how their routines are implemented or HW works. > > > > No-op behavior may be convenient for application developers. > > But it also means that pollers of stopped queues > > would go all the way down to PMD Rx/Tx routines, wasting cycles. > > Some PMDs would do a check for the queue state on data path, > > even though it may never be needed for a particular application. > > Also, use cases for stopping queues or starting them deferred > > do not logically require polling stopped queues. > > > > Use case 1: a secondary that was polling the queue has crashed, > > the primary is doing a recovery to free all mbufs. > > By definition the queue to be restarted is not polled. > > > > Use case 2: deferred queue start or queue reconfiguration. > > The polling thread must be synchronized anyway, > > because queue start and stop are non-atomic. > > > > Prohibit calling Rx/Tx functions on stopped queues. > > > > Fixes: 0748be2cf9a2 ("ethdev: queue start and stop") > > Cc: stable@dpdk.org > > > > Signed-off-by: Dmitry Kozlyuk > > --- > > This patch is was originally a part of the series: > > http://patchwork.dpdk.org/project/dpdk/patch/20220307125351.697936-3-dkozlyuk@nvidia.com/ > > The discussion there is summarized in the commit message. > [...] > > * rte_eth_rx_queue_setup()), it must call rte_eth_dev_stop() first to stop the > > * device and then do the reconfiguration before calling rte_eth_dev_start() > > * again. The transmit and receive functions should not be invoked when the > > - * device is stopped. > > + * device is stopped or when the queue is stopped (for that queue). > > I think we can make it simpler: > > The transmit and receive functions should not be invoked when the device > or the queue is stopped. No comment after a month. The patch is applied in next-net with the suggested rewording.