From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <stable-bounces@dpdk.org>
Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124])
	by inbox.dpdk.org (Postfix) with ESMTP id C00B1A00C3
	for <public@inbox.dpdk.org>; Mon, 25 Apr 2022 10:30:55 +0200 (CEST)
Received: from [217.70.189.124] (localhost [127.0.0.1])
	by mails.dpdk.org (Postfix) with ESMTP id BA4C6427EF;
	Mon, 25 Apr 2022 10:30:55 +0200 (CEST)
Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com
 [66.111.4.26]) by mails.dpdk.org (Postfix) with ESMTP id 0705C410E6;
 Mon, 25 Apr 2022 10:30:53 +0200 (CEST)
Received: from compute5.internal (compute5.nyi.internal [10.202.2.45])
 by mailout.nyi.internal (Postfix) with ESMTP id 932245C017F;
 Mon, 25 Apr 2022 04:30:51 -0400 (EDT)
Received: from mailfrontend2 ([10.202.2.163])
 by compute5.internal (MEProxy); Mon, 25 Apr 2022 04:30:51 -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=1650875451; x=
 1650961851; bh=CxpZR1blKXRxUIvQAt8Jvwq4HKPTY9zAH8VvwyqGyqA=; b=A
 c7H8kYpx5IYGzei0lgDH/DNTffQvc4ioyIwd5jcT4Wr0iHN8ebXSCnymRTdF1yIg
 HiAK+SYvqN/cn3jaBlsuWlnXRkBlPJY3UWN/7q5USHfSX2Yfs5wY8ETvsqQ3CCD5
 FYZxQH7fBeQRPs4mYOd1nNeMZyFmkwrauZ8kVWyv1t2RsMjZdU62/ePR+EP1+Ob1
 sevTsf4G3OUq0g76h3f+7ss4ULrsJ1m+gch4BNNRWxUIBziFF44Ea3ZXt/MyRZjJ
 9by9QqIlU4t/YxZW7ZBDBWRTgxnSMaTN1JqNnr4O/TfH2SuwqYbJQTvTOPcfSI8l
 re8T+EGWzYihVFaPZCpWQ==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
 messagingengine.com; 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:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender
 :x-sasl-enc; s=fm1; t=1650875451; x=1650961851; bh=CxpZR1blKXRxU
 IvQAt8Jvwq4HKPTY9zAH8VvwyqGyqA=; b=olTEx/6zB8bvfZgQDRddTzwBPkkE2
 0Guj7ywaZvxZO+WK7P7ajP9r4DF9qjSbyJ4sSE+LCuz6guWiqejuW9Ysg+jtTnKL
 lJ/h1iTPkbxVLtnIsOAQxtF+LtMPVTrFIQO9IlS3k9ZOoc6rWoORVr67e2yZR9Qh
 DKa+yJg4lj3q9VGsyv/wCdZ9+/lH1oQoZyjx2IZYo3e/MysbzHNns0IaeGKQpZQa
 stAHolTfhomXtDdPmZjTBWWv0Ogf/kSGdEc9wlvaMJcNpV9+I2uHW2uiCCnrZz4V
 CObEq7ZPd6ynD/+pDp5p9QxB+2Z4tK8ktHWqIbXE5bT6clQ1N4FLzw0Cg==
X-ME-Sender: <xms:O1xmYqaD03uxT9pjRVIAiDYPuAWWOS718l1YWxo5mtnWXfoK0MQ8Lg>
 <xme:O1xmYtZNVFpqgBxb0_yjRPp567zO8OP-DLXOmrn1Z2_2s550OB7KcLyN5GPGTj72_
 jQRqkjWKDDdYIqZUw>
X-ME-Received: <xmr:O1xmYk_Ae4DGoHIDEpee-4oOGOQKx-AFiVVAkAYi4oNvVEbg977OMIG8idC69YvC_0JF4LgTwekDWIBed-ezbsGCkw>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedruddugddtvdcutefuodetggdotefrodftvf
 curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu
 uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc
 fjughrpefhvfevufffkfgjfhgggfgtsehtufertddttddvnecuhfhrohhmpefvhhhomhgr
 shcuofhonhhjrghlohhnuceothhhohhmrghssehmohhnjhgrlhhonhdrnhgvtheqnecugg
 ftrfgrthhtvghrnhepjeejffffgfffkeefffelgfekleetjeffleeludeghfehleffteeh
 veduffdugfdvnecuffhomhgrihhnpeguphgukhdrohhrghenucevlhhushhtvghrufhiii
 gvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehthhhomhgrshesmhhonhhjrghlohhn
 rdhnvght
X-ME-Proxy: <xmx:O1xmYspHL_Pe3-tGgnD_eg0HN71TUb37DpGq5230x7xUe_v2ME6CTw>
 <xmx:O1xmYlrRHJyx8k03bD4gihOLkcCX2PAwS7s9jkFHX1VW_VzN6RIWAA>
 <xmx:O1xmYqSbOuiXT2rU-l0y43xGTQZI59tkQ6lpHFfNbH4Yl9ZSksSwmw>
 <xmx:O1xmYsVRlZZHM_RkwW25yvHHS9VpHEyOw0oKKRIohVtGLQRfhT4sVg>
Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon,
 25 Apr 2022 04:30:50 -0400 (EDT)
From: Thomas Monjalon <thomas@monjalon.net>
To: Dmitry Kozlyuk <dkozlyuk@nvidia.com>
Cc: dev@dpdk.org, stable@dpdk.org, Ferruh Yigit <ferruh.yigit@intel.com>,
 Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Subject: Re: [PATCH] ethdev: prohibit polling of a stopped queue
Date: Mon, 25 Apr 2022 10:30:49 +0200
Message-ID: <2298145.NG923GbCHz@thomas>
In-Reply-To: <20220410213550.1733330-1-dkozlyuk@nvidia.com>
References: <20220410213550.1733330-1-dkozlyuk@nvidia.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 7Bit
Content-Type: text/plain; charset="us-ascii"
X-BeenThere: stable@dpdk.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: patches for DPDK stable branches <stable.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/stable>,
 <mailto:stable-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/stable/>
List-Post: <mailto:stable@dpdk.org>
List-Help: <mailto:stable-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/stable>,
 <mailto:stable-request@dpdk.org?subject=subscribe>
Errors-To: stable-bounces@dpdk.org

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 <dkozlyuk@nvidia.com>
> ---
> 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.