adapter service function is using RTE_ETH_FOREACH_DEV() macro for
looping through all available eth devices and flushing any pending
buffered packets.

When Traffic Management nodes (vports) are added and deleted dynamically,
there is a possibility of accessing the device info memory beyond the
allocated limit which can result in segfaults. Fixed the logic to
prevent illegal memory access.

Fixes: a3bbf2e09756 ("eventdev: add eth Tx adapter implementation")
Cc: sta...@dpdk.org

Signed-off-by: Naga Harish K S V <s.v.naga.haris...@intel.com>
---
 lib/eventdev/rte_event_eth_tx_adapter.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/eventdev/rte_event_eth_tx_adapter.c 
b/lib/eventdev/rte_event_eth_tx_adapter.c
index 88309d2aaa..ba7a1c7f1b 100644
--- a/lib/eventdev/rte_event_eth_tx_adapter.c
+++ b/lib/eventdev/rte_event_eth_tx_adapter.c
@@ -676,7 +676,7 @@ txa_service_func(void *args)
                RTE_ETH_FOREACH_DEV(i) {
                        uint16_t q;
 
-                       if (i == txa->dev_count)
+                       if (i >= txa->dev_count)
                                break;
 
                        dev = tdi[i].dev;
-- 
2.25.1

Reply via email to