[PATCH v2 7/8] net/memif: fix bogus Tx count on invalid interrupt FD
Sriram Yagnaraman
sriram.yagnaraman at ericsson.com
Thu Oct 15 16:39:44 CEST 2026
eth_memif_tx_zc() returns uint16_t but did "return -1" when the
interrupt FD was invalid, so the caller saw 65535 packets sent after
ring->head had already been published. The FD can legitimately be -1:
memif_init_queues() only warns and continues when eventfd() fails. Skip
the kick when the FD is invalid, as eth_memif_tx() does, and return the
real count.
Fixes: aedd054c5c2a ("drivers: check interrupt file descriptor validity")
Cc: stable at dpdk.org
Suggested-by: Stephen Hemminger <stephen at networkplumber.org>
Signed-off-by: Sriram Yagnaraman <sriram.yagnaraman at ericsson.com>
---
drivers/net/memif/rte_eth_memif.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/net/memif/rte_eth_memif.c b/drivers/net/memif/rte_eth_memif.c
index 3174d21dc0..039acd4b12 100644
--- a/drivers/net/memif/rte_eth_memif.c
+++ b/drivers/net/memif/rte_eth_memif.c
@@ -1254,11 +1254,9 @@ eth_memif_tx_zc(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
rte_atomic_store_explicit(&ring->head, slot, rte_memory_order_release);
/* Send interrupt, if enabled. */
- if ((ring->flags & MEMIF_RING_FLAG_MASK_INT) == 0) {
+ if ((ring->flags & MEMIF_RING_FLAG_MASK_INT) == 0 &&
+ rte_intr_fd_get(mq->intr_handle) >= 0) {
uint64_t a = 1;
- if (rte_intr_fd_get(mq->intr_handle) < 0)
- return -1;
-
ssize_t size = write(rte_intr_fd_get(mq->intr_handle),
&a, sizeof(a));
if (unlikely(size < 0)) {
--
2.43.7
More information about the dev
mailing list