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 40E4545909; Thu, 5 Sep 2024 08:56:55 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5FA2442D91; Thu, 5 Sep 2024 08:56:50 +0200 (CEST) Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by mails.dpdk.org (Postfix) with ESMTP id C81A74025C for ; Thu, 5 Sep 2024 08:56:47 +0200 (CEST) Received: from mail.maildlp.com (unknown [172.19.88.105]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4WzqqJ3gYmzpVNX; Thu, 5 Sep 2024 14:54:52 +0800 (CST) Received: from kwepemf500004.china.huawei.com (unknown [7.202.181.242]) by mail.maildlp.com (Postfix) with ESMTPS id 6C790140155; Thu, 5 Sep 2024 14:56:46 +0800 (CST) Received: from localhost.localdomain (10.28.79.22) by kwepemf500004.china.huawei.com (7.202.181.242) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Thu, 5 Sep 2024 14:56:45 +0800 From: Jie Hai To: , , , Andrew Rybchenko , Keith Wiles , Billy McFall CC: , , Subject: [PATCH 1/4] ethdev: verify queue ID when Tx done cleanup Date: Thu, 5 Sep 2024 14:46:35 +0800 Message-ID: <20240905064638.17980-2-haijie1@huawei.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20240905064638.17980-1-haijie1@huawei.com> References: <20240905064638.17980-1-haijie1@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.28.79.22] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To kwepemf500004.china.huawei.com (7.202.181.242) 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 From: Chengwen Feng Verify queue_id for rte_eth_tx_done_cleanup API. 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; -- 2.22.0