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 2E32C4383B; Fri, 5 Jan 2024 11:03:59 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 146844067E; Fri, 5 Jan 2024 11:03:59 +0100 (CET) Received: from wnew1-smtp.messagingengine.com (wnew1-smtp.messagingengine.com [64.147.123.26]) by mails.dpdk.org (Postfix) with ESMTP id 10DE5402AC for ; Fri, 5 Jan 2024 11:03:57 +0100 (CET) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailnew.west.internal (Postfix) with ESMTP id BC6282B003E2; Fri, 5 Jan 2024 05:03:49 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Fri, 05 Jan 2024 05:03:56 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm2; t=1704449029; x=1704456229; bh=ne6Zg9X059CtS7CSWoTNVLtfZiAvnpSzro02EVO3J9w=; b= cD+QhkToZB30q+VPdDcacRuZxblW+lJHJdZKbnfxT2c1sjnKUJtJFEx1q99tVxHd koGBsnt0sDK4SIBOWHBOCj+sHRRM/J3vxiYIm9k5eKdWK0eVGiDLb9VB7dDSne+v cpJza6HkArIn64tdERBKVSYWG0a/wEVk6AauxhlNDWrjuX9zoGl9dWmilSuChR2T rEWnRJd0Vii7K7xuyIsSRXiqgvE2RSDeECRej7HaGmhOqfL9lTJhjlrnRDKNlN6q anzaiXNV1RcQTf9E49BZnXA0d55heCHTeVn8S8odoHpX+Lw+sxiCd+Wx9VlMrH9X Zqt/8VX7VtXTg0fB/HU3PQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1704449029; x= 1704456229; bh=ne6Zg9X059CtS7CSWoTNVLtfZiAvnpSzro02EVO3J9w=; b=o 2JIZRkldPi15pudCatpWabLZLJOQnm/z2lJ49UZ35V9xXPzfiVPGvwEdPzPW4vUi oanOHRrqyG1RPcgwuNPh24wAsrMJq7jgsAn6SZZ5voHCrWX6FkrldrAzlUKVvkuC DU8jZrYP4kO+j2HHE5MXsbeyfdHeKjc1T93NFJcWUiUdJ3jljW5wFeAt6Xg6gmtk SlO9G9vcQi4SXf5r+jbeZ/yNz+Ju0EAVpDG0IqZ+XxykfPd1V0X9pQXE5DbhB9E+ RcE86c1Brtowmo3Bl8Jiu2H6ks0U2e4VXaQCc9Ak5t1J61QFjtngcNIgFeBw7UoT zh/8tCpj/YQ7gxvWD0A1Q== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrvdegledguddvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvvefufffkjghfggfgtgesthhqredttddtjeenucfhrhhomhepvfhhohhm rghsucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenuc ggtffrrghtthgvrhhnpeegtddtleejjeegffekkeektdejvedtheevtdekiedvueeuvdei uddvleevjeeujeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfh hrohhmpehthhhomhgrshesmhhonhhjrghlohhnrdhnvght X-ME-Proxy: Feedback-ID: i47234305:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 5 Jan 2024 05:03:40 -0500 (EST) From: Thomas Monjalon To: Jerin Jacob Cc: "Dumitrescu, Cristian" , Konstantin Ananyev , "jerinj@marvell.com" , "dev@dpdk.org" , Ferruh Yigit , Andrew Rybchenko , "ferruh.yigit@xilinx.com" , "ajit.khaparde@broadcom.com" , "aboyer@pensando.io" , "Xing, Beilei" , "Richardson, Bruce" , "chas3@att.com" , "chenbo.xia@intel.com" , "Loftus, Ciara" , "dsinghrawat@marvell.com" , "Czeck, Ed" , "evgenys@amazon.com" , "grive@u256.net" , "g.singh@nxp.com" , "zhouguoyang@huawei.com" , "Wang, Haiyue" , "hkalra@marvell.com" , "heinrich.kuhn@corigine.com" , "hemant.agrawal@nxp.com" , "hyonkim@cisco.com" , "igorch@amazon.com" , "irusskikh@marvell.com" , "jgrajcia@cisco.com" , "Singh, Jasvinder" , "jianwang@trustnetic.com" , "jiawenwu@trustnetic.com" , "Wu, Jingjing" , "johndale@cisco.com" , "john.miller@atomicrules.com" , "linville@tuxdriver.com" , "Wiles, Keith" , "kirankumark@marvell.com" , "oulijun@huawei.com" , "lironh@marvell.com" , "longli@microsoft.com" , "mw@semihalf.com" , "spinler@cesnet.cz" , "matan@nvidia.com" , "Peters, Matt" , "maxime.coquelin@redhat.com" , "mk@semihalf.com" , "humin (Q)" , "pnalla@marvell.com" , "ndabilpuram@marvell.com" , "Yang, Qiming" , "Zhang, Qi Z" , "radhac@marvell.com" , "rahul.lakkireddy@chelsio.com" , "rmody@marvell.com" , "Xu, Rosen" , "sachin.saxena@oss.nxp.com" , "skoteshwar@marvell.com" , "shshaikh@marvell.com" , "shaibran@amazon.com" , "Siegel, Shepard" , "asomalap@amd.com" , "somnath.kotur@broadcom.com" , "sthemmin@microsoft.com" , "Webster, Steven" , "skori@marvell.com" , "mtetsuyah@gmail.com" , "vburru@marvell.com" , "viacheslavo@nvidia.com" , "Wang, Xiao W" , "Wangxiaoyun (Cloud)" , "Zhuangyuzeng (Yisen)" , "Wang, Yong" , "Xuanziyang (William)" Subject: Re: [dpdk-dev] [RFC] ethdev: support Tx queue free descriptor query Date: Fri, 05 Jan 2024 11:03:39 +0100 Message-ID: <9265280.rMLUfLXkoz@thomas> In-Reply-To: References: <20231219172948.3909749-1-jerinj@marvell.com> <852198449.0ifERbkFSE@thomas> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="UTF-8" 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 05/01/2024 10:57, Jerin Jacob: > On Thu, Jan 4, 2024 at 11:59=E2=80=AFPM Thomas Monjalon wrote: > > > > 04/01/2024 15:21, Konstantin Ananyev: > > > > > > > > > Introduce a new API to retrieve the number of available free de= scriptors > > > > > > in a Tx queue. Applications can leverage this API in the fast p= ath to > > > > > > inspect the Tx queue occupancy and take appropriate actions bas= ed on the > > > > > > available free descriptors. > > > > > > > > > > > > A notable use case could be implementing Random Early Discard (= RED) > > > > > > in software based on Tx queue occupancy. > > > > > > > > > > > > Signed-off-by: Jerin Jacob > > > > > > > > > > I think having an API to get the number of free descriptors per q= ueue is a good idea. Why have it only for TX queues and not for RX > > > > queues as well? > > > > > > > > I see no harm in adding for Rx as well. I think, it is better to ha= ve > > > > separate API for each instead of adding argument as it is fast path > > > > API. > > > > If so, we could add a new API when there is any PMD implementation = or > > > > need for this. > > > > > > I think for RX we already have similar one: > > > /** @internal Get number of used descriptors on a receive queue. */ > > > typedef uint32_t (*eth_rx_queue_count_t)(void *rxq); > > > > rte_eth_rx_queue_count() gives the number of Rx used descriptors > > rte_eth_rx_descriptor_status() gives the status of one Rx descriptor > > rte_eth_tx_descriptor_status() gives the status of one Tx descriptor > > > > This patch is adding a function to get Tx available descriptors, > > rte_eth_tx_queue_free_desc_get(). > > I can see a symmetry with rte_eth_rx_queue_count(). > > For consistency I would rename it to rte_eth_tx_queue_free_count(). > > > > Should we add rte_eth_tx_queue_count() and rte_eth_rx_queue_free_count(= )? >=20 > IMO, rte_eth_rx_queue_free_count() is enough as > used count =3D total desc number(configured via nb_tx_desc with > rte_eth_tx_queue_setup()) - free count I'm fine with that.