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 C9CA843819; Thu, 4 Jan 2024 19:29:37 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9479D402CB; Thu, 4 Jan 2024 19:29:37 +0100 (CET) Received: from wnew4-smtp.messagingengine.com (wnew4-smtp.messagingengine.com [64.147.123.18]) by mails.dpdk.org (Postfix) with ESMTP id 592634029A for ; Thu, 4 Jan 2024 19:29:36 +0100 (CET) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailnew.west.internal (Postfix) with ESMTP id 955202B0037B; Thu, 4 Jan 2024 13:29:28 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Thu, 04 Jan 2024 13:29:35 -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=1704392968; x=1704400168; bh=QQTOXDxmzL9m/oEUsumG/TiJ1rkf3acMtXUaKrixgh8=; b= pcLZmK5sWF8PKc3L2NiC+0j8ziFqdO/7FEo6AQkVEWwOhJpTsHSwvPZ3B5NrFaPy 7pTNxgQAyulPNzpg8621A6taDY+pQXEnp5VVcIKYktUfCng7/mxp6pa6zEB15o89 wLCPrV3/YjZ1x/ZtIY25doNmXbx10v4EdoBIId/p5eQhEb8fJG/4QpSE6VTYK6s+ FUvHytacWGPpZxC3PfCYgKJ3W8pcwhmGPHFepMDpghHtFnac2c4jlb2ndxDFEyoA QCX2xsaM9JEYgagWwx4izxQlTKIFWkeu50Vy+R1SsYdDOj/Wn3vXftEzmPKAiXo5 ytMORhbSKbKgvyto2Qrs8g== 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=1704392968; x= 1704400168; bh=QQTOXDxmzL9m/oEUsumG/TiJ1rkf3acMtXUaKrixgh8=; b=0 f5gVezA3Y9VlhyPvLKidhUp0UtFOBiYpWjUxopUZCWVAqzaHoVIBUw7snhETt0XE L0vCKfRmtCKA4/WjT6SzwyeR8HgNKBu5WFZHWci8qprp7reZo13Umt/6/eZ4dgnO 6U322zJh093qJ/9jR41tQR4ug+z3azk+d5wVsQmqgqni346EurpS2FJRQOFwzPgF /VGSeZlHqvn6oNjklyf6zkJWiNCaxW7doyQR9JbhLOHDQgFDFO3+RJydiaA6EM99 avtQcHtdcA/3UkzQehvhfxliYduDY4rPAPjEHiGa0KvCIAb+KOM2JDhlKCGrKDm6 jpSD6n5hXfY8WNxcGwrag== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrvdegjedguddufecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefhvfevufffkfgjfhgggfgtsehtufertddttddvnecuhfhrohhmpefvhhho mhgrshcuofhonhhjrghlohhnuceothhhohhmrghssehmohhnjhgrlhhonhdrnhgvtheqne cuggftrfgrthhtvghrnheptdejieeifeehtdffgfdvleetueeffeehueejgfeuteeftddt ieekgfekudehtdfgnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilh hfrhhomhepthhhohhmrghssehmohhnjhgrlhhonhdrnhgvth X-ME-Proxy: Feedback-ID: i47234305:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 4 Jan 2024 13:29:18 -0500 (EST) From: Thomas Monjalon To: Jerin Jacob , "Dumitrescu, Cristian" , Konstantin Ananyev Cc: "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: Thu, 04 Jan 2024 19:29:16 +0100 Message-ID: <852198449.0ifERbkFSE@thomas> In-Reply-To: <72c8a6a8001e48159f4bbeac44847f26@huawei.com> References: <20231219172948.3909749-1-jerinj@marvell.com> <72c8a6a8001e48159f4bbeac44847f26@huawei.com> 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 04/01/2024 15:21, Konstantin Ananyev: > > > > > Introduce a new API to retrieve the number of available free descriptors > > > > in a Tx queue. Applications can leverage this API in the fast path to > > > > inspect the Tx queue occupancy and take appropriate actions based 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 queue 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 have > > 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()?