summaryrefslogtreecommitdiffstats
path: root/lib/librte_eal/linuxapp/eal/eal_interrupts.c
diff options
context:
space:
mode:
authorLuca Boccassi <luca.boccassi@gmail.com>2019-03-20 14:45:09 +0000
committerLuca Boccassi <luca.boccassi@gmail.com>2019-03-20 14:45:37 +0000
commitf7a9461e29147c47ce2bb81bd157ac1833cf5eb1 (patch)
tree6f3b4f4850cf9f116acc1dda3f0515259673e13b /lib/librte_eal/linuxapp/eal/eal_interrupts.c
parent8e6d9d118f6105a3627b64a7949e1fb0b145879e (diff)
New upstream version 16.11.9upstream/16.11.9upstream-16.11-stable
Change-Id: Ia1ac246c53e5050b6a29d6952fb668ad6c782996 Signed-off-by: Luca Boccassi <luca.boccassi@gmail.com>
Diffstat (limited to 'lib/librte_eal/linuxapp/eal/eal_interrupts.c')
-rw-r--r--lib/librte_eal/linuxapp/eal/eal_interrupts.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/lib/librte_eal/linuxapp/eal/eal_interrupts.c b/lib/librte_eal/linuxapp/eal/eal_interrupts.c
index 7f739140..cce69285 100644
--- a/lib/librte_eal/linuxapp/eal/eal_interrupts.c
+++ b/lib/librte_eal/linuxapp/eal/eal_interrupts.c
@@ -647,7 +647,7 @@ eal_intr_process_interrupts(struct epoll_event *events, int nfds)
{
int n, bytes_read;
struct rte_intr_source *src;
- struct rte_intr_callback *cb;
+ struct rte_intr_callback *cb, *next;
union rte_intr_read_buffer buf;
struct rte_intr_callback active_cb;
@@ -713,6 +713,23 @@ eal_intr_process_interrupts(struct epoll_event *events, int nfds)
"descriptor %d: %s\n",
events[n].data.fd,
strerror(errno));
+ /*
+ * The device is unplugged or buggy, remove
+ * it as an interrupt source and return to
+ * force the wait list to be rebuilt.
+ */
+ rte_spinlock_lock(&intr_lock);
+ TAILQ_REMOVE(&intr_sources, src, next);
+ rte_spinlock_unlock(&intr_lock);
+
+ for (cb = TAILQ_FIRST(&src->callbacks); cb;
+ cb = next) {
+ next = TAILQ_NEXT(cb, next);
+ TAILQ_REMOVE(&src->callbacks, cb, next);
+ free(cb);
+ }
+ free(src);
+ return -1;
} else if (bytes_read == 0)
RTE_LOG(ERR, EAL, "Read nothing from file "
"descriptor %d\n", events[n].data.fd);