patches for DPDK stable branches
 help / color / mirror / Atom feed
* [PATCH] eventdev/eth_tx: fix service function
@ 2023-01-07 16:40 Naga Harish K S V
  2023-01-17 16:00 ` Jerin Jacob
  0 siblings, 1 reply; 2+ messages in thread
From: Naga Harish K S V @ 2023-01-07 16:40 UTC (permalink / raw)
  To: jerinj; +Cc: dev, jay.jayatheerthan, stable

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: stable@dpdk.org

Signed-off-by: Naga Harish K S V <s.v.naga.harish.k@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


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

end of thread, other threads:[~2023-01-17 16:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-07 16:40 [PATCH] eventdev/eth_tx: fix service function Naga Harish K S V
2023-01-17 16:00 ` Jerin Jacob

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).