DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH v2] ethdev: verify queue ID when Tx done cleanup
@ 2024-10-12  9:14 Jie Hai
  2024-10-13  0:29 ` Ferruh Yigit
  0 siblings, 1 reply; 2+ messages in thread
From: Jie Hai @ 2024-10-12  9:14 UTC (permalink / raw)
  To: dev, thomas, ferruh.yigit, Andrew Rybchenko, Keith Wiles, Billy McFall
  Cc: lihuisong, fengchengwen, haijie1

From: Chengwen Feng <fengchengwen@huawei.com>

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 <fengchengwen@huawei.com>
---
v2: make the check under RTE_ETHDEV_DEBUG_TX.
---
 lib/ethdev/rte_ethdev.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c
index 12f42f1d68a9..6413c54e3b39 100644
--- a/lib/ethdev/rte_ethdev.c
+++ b/lib/ethdev/rte_ethdev.c
@@ -2910,6 +2910,12 @@ 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];
 
+#ifdef RTE_ETHDEV_DEBUG_TX
+	ret = eth_dev_validate_tx_queue(dev, queue_id);
+	if (ret != 0)
+		return ret;
+#endif
+
 	if (*dev->dev_ops->tx_done_cleanup == NULL)
 		return -ENOTSUP;
 
-- 
2.22.0


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-10-13  0:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-10-12  9:14 [PATCH v2] ethdev: verify queue ID when Tx done cleanup Jie Hai
2024-10-13  0:29 ` Ferruh Yigit

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).