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 920C6A04FD for ; Mon, 11 Apr 2022 10:17:52 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8BE4E40F35; Mon, 11 Apr 2022 10:17:52 +0200 (CEST) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id E34524067B; Mon, 11 Apr 2022 10:17:50 +0200 (CEST) Received: by linux.microsoft.com (Postfix, from userid 1086) id F3DD72058469; Mon, 11 Apr 2022 01:17:49 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com F3DD72058469 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1649665070; bh=/U+BYa1vRYeeckRIoQUGMtGG0AkIbDW7cdd/COraj7I=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=bACxkehE+gzqkkTm9Yoeq958ESY6+LBRPo3eWi7RDpo62n2Vcz0lpZTLstQxSHN7i gAxWYPU6AZIsSGxsIt/KarVoX+b5LBCWpnEwNHNyCG8hOEPWJB02Nip8OgYFVp7oT7 TE2E0CCM2vXabSKPbC9LayIqz7JdyiCFnjgGM4f4= Date: Mon, 11 Apr 2022 01:17:49 -0700 From: Tyler Retzlaff To: Dmitry Kozlyuk Cc: dev@dpdk.org, stable@dpdk.org, Thomas Monjalon , Ferruh Yigit , Andrew Rybchenko Subject: Re: [PATCH] ethdev: prohibit polling of a stopped queue Message-ID: <20220411081749.GA19395@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> References: <20220410213550.1733330-1-dkozlyuk@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220410213550.1733330-1-dkozlyuk@nvidia.com> User-Agent: Mutt/1.5.21 (2010-09-15) 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 Mon, Apr 11, 2022 at 12:35:50AM +0300, Dmitry Kozlyuk wrote: > 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 Acked-by: Tyler Retzlaff