summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephen Hemminger <stephen@networkplumber.org>2015-07-15 10:16:16 -0700
committerThomas Monjalon <thomas.monjalon@6wind.com>2015-07-20 01:56:17 +0200
commit7ccfcb159313ce40bc57de2eecc3067eee493131 (patch)
treece104a0c62d1e21eb1d0949d5bdced87bd56304f
parentb0343d8b36ae2a1f838de955dbf47024206ee33d (diff)
downloaddpdk-7ccfcb159313ce40bc57de2eecc3067eee493131.zip
dpdk-7ccfcb159313ce40bc57de2eecc3067eee493131.tar.gz
dpdk-7ccfcb159313ce40bc57de2eecc3067eee493131.tar.xz
eal/linux: handle signal on event read
The read for events in the interrupt thread may get interrupted by signals from application. Avoid generating stray log message. Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
-rw-r--r--lib/librte_eal/linuxapp/eal/eal_interrupts.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/librte_eal/linuxapp/eal/eal_interrupts.c b/lib/librte_eal/linuxapp/eal/eal_interrupts.c
index b5f369e..61e7c85 100644
--- a/lib/librte_eal/linuxapp/eal/eal_interrupts.c
+++ b/lib/librte_eal/linuxapp/eal/eal_interrupts.c
@@ -720,12 +720,14 @@ eal_intr_process_interrupts(struct epoll_event *events, int nfds)
* for epoll_wait.
*/
bytes_read = read(events[n].data.fd, &buf, bytes_read);
+ if (bytes_read < 0) {
+ if (errno == EINTR || errno == EWOULDBLOCK)
+ continue;
- if (bytes_read < 0)
RTE_LOG(ERR, EAL, "Error reading from file "
"descriptor %d: %s\n", events[n].data.fd,
strerror(errno));
- else if (bytes_read == 0)
+ } else if (bytes_read == 0)
RTE_LOG(ERR, EAL, "Read nothing from file "
"descriptor %d\n", events[n].data.fd);