eal/linux: fix epoll fd list rebuild for interrupts
authorHarman Kalra <hkalra@marvell.com>
Fri, 19 Jun 2020 13:59:28 +0000 (19:29 +0530)
committerThomas Monjalon <thomas@monjalon.net>
Wed, 24 Jun 2020 08:01:56 +0000 (10:01 +0200)
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 <hkalra@marvell.com>
lib/librte_eal/linux/eal_interrupts.c

index 16e7a7d..84eeaa1 100644 (file)
@@ -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;
                }