DPDK patches and discussions
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: dev@dpdk.org
Subject: [dpdk-dev] [PATCH] eal: handle signal on eventfd
Date: Wed, 15 Jul 2015 10:16:16 -0700	[thread overview]
Message-ID: <1436980576-6361-1-git-send-email-stephen@networkplumber.org> (raw)

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>
---
 lib/librte_eal/linuxapp/eal/eal_interrupts.c | 6 ++++--
 1 file 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);
 
-- 
2.1.4

             reply	other threads:[~2015-07-15 17:16 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-15 17:16 Stephen Hemminger [this message]
2015-07-19 23:55 ` Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1436980576-6361-1-git-send-email-stephen@networkplumber.org \
    --to=stephen@networkplumber.org \
    --cc=dev@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).