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 32F45438D1; Tue, 16 Jan 2024 07:37:57 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A855D4029F; Tue, 16 Jan 2024 07:37:56 +0100 (CET) Received: from mail-qk1-f182.google.com (mail-qk1-f182.google.com [209.85.222.182]) by mails.dpdk.org (Postfix) with ESMTP id E16EF4027D for ; Tue, 16 Jan 2024 07:37:54 +0100 (CET) Received: by mail-qk1-f182.google.com with SMTP id af79cd13be357-7831aacdaffso946505585a.3 for ; Mon, 15 Jan 2024 22:37:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1705387074; x=1705991874; 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=IHqF1ZZYScJGjJktSaMyMPM9wShLnYm1MrnbQmEwDok=; b=YVkYdMBDJnG42pI8q4j4YyBEg6LydLtyr3tPWz+ixg4FO09WKl5iWXMdgDQQxkS4kW kLyjlOPGVAmms8//39IjWmGMeVJcFxJZc30cuQ1SU1hE2IAyclvCQmGfP8Hl+vqgh2lD ACEWALHXfmeOlmg7AhaJ4Bkiz+LYRpLmV7YPk/SXPT7V3E7Ekeky7NN/nFD/pK1sch6q E3xltJqQ7oygBuM5Oi25gI6c7gIAHeesZWiARqPnm+yaCpfntXY7LyfiQXQAPNSrZs6L rnWhsL390no0180YbCtuxEJcXTGsDhqpFhWXuFbFxGDc1C2+pNAEXQbXmykYYZyX/LDb IbvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705387074; x=1705991874; 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=IHqF1ZZYScJGjJktSaMyMPM9wShLnYm1MrnbQmEwDok=; b=RkRn0zE8ZYtLrypOxVldU6GyOesc2JWZ7p2ddVlpx2ZcO3xBc7uQTAkXeQwpcLpX8k UXrYbIrepCdKzXOaD8/KW9+qCMdgAO2wbl0gjcddX6zNK8gDCWalOIm7pZjyFVAui4OM Q78F/1d3yoFzjqRasnnWDHb2o8x1Th82E8IkoZYdSYUxmBfi4v7AaCm2oTxGOyREpk6w EwjGiWCLEQCRyGscRFt30K4PQ4hoZvOQnwG1ZlTV+hc+AP75cpqHJzYqqgrkgbgVLUUY GXFGHw8bAqkqa4cQt73jQVoLIIBXq+F3aE8vQHOBmE8Bn5ylw/stvlxY5DSxOgn9LWSb ARRA== X-Gm-Message-State: AOJu0YxRKRi86zse1+funmix6gkuRYFaAYd5z6e/HwZIxL2OEozveK33 b4t4HrrKHwrozD/TlPI16+mZ+93YQq+X+iA4WsI= X-Google-Smtp-Source: AGHT+IHstvYQuLNVGqY9VjsDZ0XfHQP8sGkSdWenxCpOVH3wec7sV6VptNfQFr9z0vx/mBMeyuU4EQhLELto1X41K8Y= X-Received: by 2002:ac8:5d87:0:b0:429:f252:bf2e with SMTP id d7-20020ac85d87000000b00429f252bf2emr3177295qtx.90.1705387074023; Mon, 15 Jan 2024 22:37:54 -0800 (PST) MIME-Version: 1.0 References: <20231219172948.3909749-1-jerinj@marvell.com> <20240111151745.3800170-1-jerinj@marvell.com> <2f45bf93d17a4ea688fdc23bf6f50027@huawei.com> In-Reply-To: <2f45bf93d17a4ea688fdc23bf6f50027@huawei.com> From: Jerin Jacob Date: Tue, 16 Jan 2024 12:07:27 +0530 Message-ID: Subject: Re: [dpdk-dev] [v1] ethdev: support Tx queue used count To: Konstantin Ananyev Cc: "jerinj@marvell.com" , "dev@dpdk.org" , Thomas Monjalon , Ferruh Yigit , Andrew Rybchenko , "ferruh.yigit@xilinx.com" , "ajit.khaparde@broadcom.com" , "aboyer@pensando.io" , "beilei.xing@intel.com" , "bruce.richardson@intel.com" , "chas3@att.com" , "chenbo.xia@intel.com" , "ciara.loftus@intel.com" , "dsinghrawat@marvell.com" , "ed.czeck@atomicrules.com" , "evgenys@amazon.com" , "grive@u256.net" , "g.singh@nxp.com" , "haiyue.wang@intel.com" , "hkalra@marvell.com" , "heinrich.kuhn@corigine.com" , "hemant.agrawal@nxp.com" , "hyonkim@cisco.com" , "igorch@amazon.com" , "irusskikh@marvell.com" , "jgrajcia@cisco.com" , "jasvinder.singh@intel.com" , "jianwang@trustnetic.com" , "jiawenwu@trustnetic.com" , "jingjing.wu@intel.com" , "johndale@cisco.com" , "john.miller@atomicrules.com" , "linville@tuxdriver.com" , "keith.wiles@intel.com" , "kirankumark@marvell.com" , "lironh@marvell.com" , "longli@microsoft.com" , "mw@semihalf.com" , "spinler@cesnet.cz" , "matan@nvidia.com" , "matt.peters@windriver.com" , "maxime.coquelin@redhat.com" , "mk@semihalf.com" , "humin (Q)" , "pnalla@marvell.com" , "ndabilpuram@marvell.com" , "qiming.yang@intel.com" , "qi.z.zhang@intel.com" , "radhac@marvell.com" , "rahul.lakkireddy@chelsio.com" , "rmody@marvell.com" , "rosen.xu@intel.com" , "sachin.saxena@oss.nxp.com" , "skoteshwar@marvell.com" , "shshaikh@marvell.com" , "shaibran@amazon.com" , "shepard.siegel@atomicrules.com" , "asomalap@amd.com" , "somnath.kotur@broadcom.com" , "sthemmin@microsoft.com" , "steven.webster@windriver.com" , "skori@marvell.com" , "mtetsuyah@gmail.com" , "vburru@marvell.com" , "viacheslavo@nvidia.com" , "xiao.w.wang@intel.com" , "Wangxiaoyun (Cloud)" , "Zhuangyuzeng (Yisen)" , "yongwang@vmware.com" , "Xuanziyang (William)" , "cristian.dumitrescu@intel.com" 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 Fri, Jan 12, 2024 at 6:03=E2=80=AFPM Konstantin Ananyev wrote: > > Hi Jerin, Hi Konstantin, > > > Introduce a new API to retrieve the number of used 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 th= e > > 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 > > @@ -6803,6 +6803,80 @@ rte_eth_recycle_mbufs(uint16_t rx_port_id, uint1= 6_t rx_queue_id, > > __rte_experimental > > int rte_eth_buffer_split_get_supported_hdr_ptypes(uint16_t port_id, ui= nt32_t *ptypes, int num); > > > > +/** > > + * @warning > > + * @b EXPERIMENTAL: this API may change, or be removed, without prior = notice > > + * > > + * Get the number of used descriptors of a Tx queue > > + * > > + * This function retrieves the number of used descriptors of a transmi= t queue. > > + * Applications can use this API in the fast path to inspect Tx queue = occupancy and take > > + * appropriate actions based on the available free descriptors. > > + * An example action could be implementing the Random Early Discard (R= ED). > > Sorry, I probably misunderstood your previous mails, but wouldn't it be m= ore convenient > for user to have rte_eth_tx_queue_free_count(...) as fast-op, and > have rte_eth_tx_queue_count(...) { queue_txd_num - rte_eth_tx_queue_free= _count(...);} > as a slow-path function in rte_ethdev.c? The general feedback is to align with the Rx queue API, specifically rte_eth_rx_queue_count, and it's noted that there is no equivalent rte_eth_rx_queue_free_count. Given that the free count can be obtained by subtracting the used count from queue_txd_num, it is considered that either approach is acceptable. The application configures queue_txd_num with tx_queue_setup(), and the application can store that value in its structure. This would enable fast-path usage for both base cases (whether the application needs information about free or used descriptors) with just one API(rte_eth_tx_queue_count()) > Konstantin