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 7459345909; Thu, 5 Sep 2024 09:33:20 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3F1AA40264; Thu, 5 Sep 2024 09:33:20 +0200 (CEST) Received: from shelob.oktetlabs.ru (shelob.oktetlabs.ru [91.220.146.113]) by mails.dpdk.org (Postfix) with ESMTP id 619734025C for ; Thu, 5 Sep 2024 09:33:18 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 shelob.oktetlabs.ru 7149256 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=oktetlabs.ru; s=default; t=1725521597; bh=5fIWMbKuecjCWHDNx42dZnAcFBg7ycuqA2vT+QvlZI0=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=WJJAGkasnN5KJIAwZYvT0Tw92BmtTlo8B4IK8N2Q2R0/VeeKjK5dYuTgmBhy1YJxL 8FD74rU/+PxmJoXHlMtfzG/V+9WEEZb/KEm4i3OipQyGKWn4voufnDJjlGZlirOsBc 0q3uEFPXNBPKica9MNIMQHOtjiKPoWi9Sl/uD3GY= Received: from [192.168.38.17] (aros.oktetlabs.ru [192.168.38.17]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by shelob.oktetlabs.ru (Postfix) with ESMTPSA id 7149256; Thu, 5 Sep 2024 10:33:17 +0300 (MSK) Message-ID: <20681877-7c2a-4b54-bf32-0de7779df55c@oktetlabs.ru> Date: Thu, 5 Sep 2024 10:33:16 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 1/4] ethdev: verify queue ID when Tx done cleanup To: Jie Hai , dev@dpdk.org, thomas@monjalon.net, ferruh.yigit@amd.com, Keith Wiles , Billy McFall Cc: lihuisong@huawei.com, fengchengwen@huawei.com References: <20240905064638.17980-1-haijie1@huawei.com> <20240905064638.17980-2-haijie1@huawei.com> Content-Language: en-US From: Andrew Rybchenko Organization: OKTET Labs In-Reply-To: <20240905064638.17980-2-haijie1@huawei.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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 9/5/24 09:46, Jie Hai wrote: > From: Chengwen Feng > > Verify queue_id for rte_eth_tx_done_cleanup API. If I'm not mistaken the function is considered data path API (fast). If so, it should not validate it's parameters as in rte_eth_tx_burst(). It may be done under RTE_ETHDEV_DEBUG_TX only. May be documentation should be fixed to highlight it. And yes, current implementation looks inconsistent from this point of view since port_id and presence of callback are checked. Anyway motivation in the patch description is insufficient. > > Fixes: 44a718c457b5 ("ethdev: add API to free consumed buffers in Tx ring") > Cc: stable@dpdk.org > > Signed-off-by: Chengwen Feng > --- > lib/ethdev/rte_ethdev.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c > index f1c658f49e80..998deb5ab101 100644 > --- a/lib/ethdev/rte_ethdev.c > +++ b/lib/ethdev/rte_ethdev.c > @@ -2823,6 +2823,10 @@ rte_eth_tx_done_cleanup(uint16_t port_id, uint16_t queue_id, uint32_t free_cnt) > RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); > dev = &rte_eth_devices[port_id]; > > + ret = eth_dev_validate_tx_queue(dev, queue_id); > + if (ret != 0) > + return ret; > + > if (*dev->dev_ops->tx_done_cleanup == NULL) > return -ENOTSUP; >