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 F26884383B; Fri, 5 Jan 2024 10:58:09 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6AC15402BF; Fri, 5 Jan 2024 10:58:09 +0100 (CET) Received: from mail-qt1-f170.google.com (mail-qt1-f170.google.com [209.85.160.170]) by mails.dpdk.org (Postfix) with ESMTP id 1D1C1402AC for ; Fri, 5 Jan 2024 10:58:07 +0100 (CET) Received: by mail-qt1-f170.google.com with SMTP id d75a77b69052e-42832ddd9d1so7900161cf.0 for ; Fri, 05 Jan 2024 01:58:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1704448686; x=1705053486; darn=dpdk.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=t0ywQi/ZL0WwjCteL0dYxG5QNAZJc4hy2HTNBBSL5e4=; b=RSXvXMIG9ybgOQdR1p3t79erow3Lj0UStHyZFA+mIjTRM5MZlTn2vAb0SddF0H8wbh QGg3wpHpnGs4Dch7ySK+HbgAK02Tv6zLWHbekXn29KGzComZ0QGJ/IXsgqGJAjfd1jch zUgUQpa4lqggVGqk5NRbHRi25Oq6+qOpeS7GQTe8+jSqDOdcGg7xH2wHlwG4j692+CDv NbhI1RVNfwB4PmLWnO369RjCWPecooskmr8uJGS1ZeV2PT5Pg0rHhR8f4zVr/pC5BgOx DFZY3cAyb88I7MbB8BmDEJRVnQwk6kVqtFuLalUhkI2cnRxfiPsrtntmJJvbu74VQcE6 ic6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704448686; x=1705053486; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=t0ywQi/ZL0WwjCteL0dYxG5QNAZJc4hy2HTNBBSL5e4=; b=XbhNcDQR8Np6/RNFNRL6iIafvjBnxRLPpByHTbHSfBsxzP04QLnL/dfucbxjSRWGgC B4pkZ0pS5F8xkQ8MT0fXf5gTGmRvnynvQG/hcN8bOZtVQqJjncvNhTDzBfgICOObMx+E eaD0MAsCIMC0BAnGBf6AkZf4UHkxqK02Pr+UdDcDBI3Rp1doxFh8u0B3QeR1aQdKqYHl Go7yHjUbDqmJDbvIsZqWeSraRqsZQVvS7fufCsvdGCl2f3K9sHmX/car44OypdNouS4W BLnE9HV7lelzmTcU7Zkue6QzZBNl3vqsrLFgw0M1httUTd4nIBj9nKnWJr+K3Et2Fpjj JhfQ== X-Gm-Message-State: AOJu0YyyuSLpEL8i0i8fyYObuB3mVst+ufOgFOMDPzZ3FYwxvJbu1fSF KiJPdr6p5NpT4mqtvGXLH74cU5ggdHO8Ib92rs4= X-Google-Smtp-Source: AGHT+IGtyLQyI75mUy5vKa5NLf6TCKriR8XyJEm97tuQT67d0Xwf54hQTMX4pzS11F7OP5rRGS3Qh14Ipx1EsB5NjmA= X-Received: by 2002:ac8:7d44:0:b0:429:7c98:20c8 with SMTP id h4-20020ac87d44000000b004297c9820c8mr46208qtb.28.1704448686350; Fri, 05 Jan 2024 01:58:06 -0800 (PST) MIME-Version: 1.0 References: <20231219172948.3909749-1-jerinj@marvell.com> <72c8a6a8001e48159f4bbeac44847f26@huawei.com> <852198449.0ifERbkFSE@thomas> In-Reply-To: <852198449.0ifERbkFSE@thomas> From: Jerin Jacob Date: Fri, 5 Jan 2024 15:27:39 +0530 Message-ID: Subject: Re: [dpdk-dev] [RFC] ethdev: support Tx queue free descriptor query To: Thomas Monjalon 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)" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 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 desc= riptors > > > > > in a Tx queue. Applications can leverage this API in the fast pat= h 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 (RE= D) > > > > > 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 que= ue 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()? 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 > >