From: Adrien Mazarguil <adrien.mazarguil@6wind.com>
To: dev@dpdk.org
Subject: [dpdk-dev] [PATCH 1/3] eal: new interrupt handler type
Date: Mon, 5 Oct 2015 19:56:33 +0200 [thread overview]
Message-ID: <1444067795-29748-2-git-send-email-adrien.mazarguil@6wind.com> (raw)
In-Reply-To: <1444067795-29748-1-git-send-email-adrien.mazarguil@6wind.com>
From: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Add RTE_INTR_HANDLE_EXT handler type for PMDs that do not support VFIO or
UIO. Those are expected to manage the file descriptor themselves.
Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
---
lib/librte_eal/linuxapp/eal/eal_interrupts.c | 34 ++++++++++++----------
.../linuxapp/eal/include/exec-env/rte_interrupts.h | 1 +
2 files changed, 20 insertions(+), 15 deletions(-)
diff --git a/lib/librte_eal/linuxapp/eal/eal_interrupts.c b/lib/librte_eal/linuxapp/eal/eal_interrupts.c
index 078318c..79eedaf 100644
--- a/lib/librte_eal/linuxapp/eal/eal_interrupts.c
+++ b/lib/librte_eal/linuxapp/eal/eal_interrupts.c
@@ -691,26 +691,30 @@ eal_intr_process_interrupts(struct epoll_event *events, int nfds)
bytes_read = sizeof(buf.vfio_intr_count);
break;
#endif
+ case RTE_INTR_HANDLE_EXT:
default:
bytes_read = 1;
break;
}
- /**
- * read out to clear the ready-to-be-read flag
- * for epoll_wait.
- */
- bytes_read = read(events[n].data.fd, &buf, bytes_read);
- if (bytes_read < 0) {
- if (errno == EINTR || errno == EWOULDBLOCK)
- continue;
-
- RTE_LOG(ERR, EAL, "Error reading from file "
- "descriptor %d: %s\n", events[n].data.fd,
- strerror(errno));
- } else if (bytes_read == 0)
- RTE_LOG(ERR, EAL, "Read nothing from file "
- "descriptor %d\n", events[n].data.fd);
+ if (src->intr_handle.type != RTE_INTR_HANDLE_EXT) {
+ /**
+ * read out to clear the ready-to-be-read flag
+ * for epoll_wait.
+ */
+ bytes_read = read(events[n].data.fd, &buf, bytes_read);
+ if (bytes_read < 0) {
+ if (errno == EINTR || errno == EWOULDBLOCK)
+ continue;
+
+ RTE_LOG(ERR, EAL, "Error reading from file "
+ "descriptor %d: %s\n",
+ events[n].data.fd,
+ strerror(errno));
+ } else if (bytes_read == 0)
+ RTE_LOG(ERR, EAL, "Read nothing from file "
+ "descriptor %d\n", events[n].data.fd);
+ }
/* grab a lock, again to call callbacks and update status. */
rte_spinlock_lock(&intr_lock);
diff --git a/lib/librte_eal/linuxapp/eal/include/exec-env/rte_interrupts.h b/lib/librte_eal/linuxapp/eal/include/exec-env/rte_interrupts.h
index 45071b7..b095b86 100644
--- a/lib/librte_eal/linuxapp/eal/include/exec-env/rte_interrupts.h
+++ b/lib/librte_eal/linuxapp/eal/include/exec-env/rte_interrupts.h
@@ -48,6 +48,7 @@ enum rte_intr_handle_type {
RTE_INTR_HANDLE_VFIO_MSI, /**< vfio device handle (MSI) */
RTE_INTR_HANDLE_VFIO_MSIX, /**< vfio device handle (MSIX) */
RTE_INTR_HANDLE_ALARM, /**< alarm handle */
+ RTE_INTR_HANDLE_EXT, /**< external handler */
RTE_INTR_HANDLE_MAX
};
--
2.1.0
next prev parent reply other threads:[~2015-10-05 17:56 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-05 17:56 [dpdk-dev] [PATCH 0/3] Add link status notification support to Mellanox PMDs Adrien Mazarguil
2015-10-05 17:56 ` Adrien Mazarguil [this message]
2015-10-20 20:25 ` [dpdk-dev] [PATCH 1/3] eal: new interrupt handler type David Marchand
2015-10-05 17:56 ` [dpdk-dev] [PATCH 2/3] mlx4: handle interrupts Adrien Mazarguil
2015-10-05 17:56 ` [dpdk-dev] [PATCH 3/3] mlx5: " Adrien Mazarguil
2015-10-30 18:57 ` [dpdk-dev] [PATCH v2 0/3] Add link status notification support to Mellanox PMDs Adrien Mazarguil
2015-10-30 18:57 ` [dpdk-dev] [PATCH v2 1/3] eal: new interrupt handler type Adrien Mazarguil
2015-10-30 18:57 ` [dpdk-dev] [PATCH v2 2/3] mlx4: handle interrupts Adrien Mazarguil
2015-10-30 18:57 ` [dpdk-dev] [PATCH v2 3/3] mlx5: " Adrien Mazarguil
2015-11-01 10:32 ` [dpdk-dev] [PATCH v2 0/3] Add link status notification support to Mellanox PMDs Thomas Monjalon
2015-11-02 11:12 ` Adrien Mazarguil
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=1444067795-29748-2-git-send-email-adrien.mazarguil@6wind.com \
--to=adrien.mazarguil@6wind.com \
--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).