Skip to content

Commit abac260

Browse files
fengchengwenferruhy
authored andcommitted
ethdev: verify queue ID when Tx done cleanup
Verify queue_id for rte_eth_tx_done_cleanup API. Fixes: 44a718c ("ethdev: add API to free consumed buffers in Tx ring") Cc: [email protected] Signed-off-by: Chengwen Feng <[email protected]> Reviewed-by: Ferruh Yigit <[email protected]>
1 parent b92a9a2 commit abac260

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lib/ethdev/rte_ethdev.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2910,6 +2910,12 @@ rte_eth_tx_done_cleanup(uint16_t port_id, uint16_t queue_id, uint32_t free_cnt)
29102910
RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
29112911
dev = &rte_eth_devices[port_id];
29122912

2913+
#ifdef RTE_ETHDEV_DEBUG_TX
2914+
ret = eth_dev_validate_tx_queue(dev, queue_id);
2915+
if (ret != 0)
2916+
return ret;
2917+
#endif
2918+
29132919
if (*dev->dev_ops->tx_done_cleanup == NULL)
29142920
return -ENOTSUP;
29152921

0 commit comments

Comments
 (0)