From 02b73b1e93a2e319e5751e0e662e6271f6f3367e Mon Sep 17 00:00:00 2001 From: Harman Kalra Date: Fri, 19 Jun 2020 19:29:28 +0530 Subject: [PATCH] eal/linux: fix epoll fd list rebuild for interrupts An issue has been observed where epoll file descriptor list rebuilds every time an interrupt/alarm event is received. eal_intr_process_interrupts() should notify pipe fd only if any source is removed from the source list i.e (rv > 0) Fixes: 0c7ce182a760 ("eal: add pending interrupt callback unregister") Cc: stable@dpdk.org Signed-off-by: Harman Kalra --- lib/librte_eal/linux/eal_interrupts.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/librte_eal/linux/eal_interrupts.c b/lib/librte_eal/linux/eal_interrupts.c index 16e7a7d512..84eeaa1bc6 100644 --- a/lib/librte_eal/linux/eal_interrupts.c +++ b/lib/librte_eal/linux/eal_interrupts.c @@ -1010,7 +1010,7 @@ eal_intr_process_interrupts(struct epoll_event *events, int nfds) } /* notify the pipe fd waited by epoll_wait to rebuild the wait list */ - if (rv >= 0 && write(intr_pipe.writefd, "1", 1) < 0) { + if (rv > 0 && write(intr_pipe.writefd, "1", 1) < 0) { rte_spinlock_unlock(&intr_lock); return -EPIPE; } -- 2.20.1