From: Cunming Liang <cunming.liang@intel.com>
To: dev@dpdk.org
Subject: [dpdk-dev] [PATCH v4 01/13] eal: vfio map misc intr to vector zero
Date: Wed, 4 Nov 2015 16:45:28 +0800 [thread overview]
Message-ID: <1446626740-28824-2-git-send-email-cunming.liang@intel.com> (raw)
In-Reply-To: <1446626740-28824-1-git-send-email-cunming.liang@intel.com>
During VFIO_DEVICE_SET_IRQS, the previous order is {Q0_fd, ... Qn_fd, misc_fd}.
The vector number of misc is indeterminable which is ugly to some NIC(e.g. i40e, fm10k).
The patch adjusts the order in {misc_fd, Q0_fd, ... Qn_fd}, always reserve the first vector to misc interrupt.
v3 changes:
- rename MISC_VEC_ID to RTE_INTR_VEC_ZERO_OFFSET
- rename RX_VEC_START to RTE_INTR_VEC_RXTX_OFFSET
- add macro definition in bsd header file
Signed-off-by: Cunming Liang <cunming.liang@intel.com>
---
.../bsdapp/eal/include/exec-env/rte_interrupts.h | 3 +++
lib/librte_eal/linuxapp/eal/eal_interrupts.c | 19 +++++++++++++------
.../linuxapp/eal/include/exec-env/rte_interrupts.h | 2 ++
3 files changed, 18 insertions(+), 6 deletions(-)
diff --git a/lib/librte_eal/bsdapp/eal/include/exec-env/rte_interrupts.h b/lib/librte_eal/bsdapp/eal/include/exec-env/rte_interrupts.h
index 88d4ae1..05bb484 100644
--- a/lib/librte_eal/bsdapp/eal/include/exec-env/rte_interrupts.h
+++ b/lib/librte_eal/bsdapp/eal/include/exec-env/rte_interrupts.h
@@ -38,6 +38,9 @@
#ifndef _RTE_BSDAPP_INTERRUPTS_H_
#define _RTE_BSDAPP_INTERRUPTS_H_
+#define RTE_INTR_VEC_ZERO_OFFSET 0
+#define RTE_INTR_VEC_RXTX_OFFSET 1
+
enum rte_intr_handle_type {
RTE_INTR_HANDLE_UNKNOWN = 0,
RTE_INTR_HANDLE_UIO, /**< uio device handle */
diff --git a/lib/librte_eal/linuxapp/eal/eal_interrupts.c b/lib/librte_eal/linuxapp/eal/eal_interrupts.c
index a4b9506..8758239 100644
--- a/lib/librte_eal/linuxapp/eal/eal_interrupts.c
+++ b/lib/librte_eal/linuxapp/eal/eal_interrupts.c
@@ -301,8 +301,10 @@ vfio_enable_msix(struct rte_intr_handle *intr_handle) {
irq_set->index = VFIO_PCI_MSIX_IRQ_INDEX;
irq_set->start = 0;
fd_ptr = (int *) &irq_set->data;
- memcpy(fd_ptr, intr_handle->efds, sizeof(intr_handle->efds));
- fd_ptr[intr_handle->max_intr - 1] = intr_handle->fd;
+ /* INTR vector offset 0 reserve for non-efds mapping */
+ fd_ptr[RTE_INTR_VEC_ZERO_OFFSET] = intr_handle->fd;
+ memcpy(&fd_ptr[RTE_INTR_VEC_RXTX_OFFSET], intr_handle->efds,
+ sizeof(*intr_handle->efds) * intr_handle->nb_efd);
ret = ioctl(intr_handle->vfio_dev_fd, VFIO_DEVICE_SET_IRQS, irq_set);
@@ -1083,10 +1085,14 @@ rte_intr_rx_ctl(struct rte_intr_handle *intr_handle, int epfd,
struct rte_epoll_event *rev;
struct rte_epoll_data *epdata;
int epfd_op;
+ unsigned int efd_idx;
int rc = 0;
+ efd_idx = (vec >= RTE_INTR_VEC_RXTX_OFFSET) ?
+ (vec - RTE_INTR_VEC_RXTX_OFFSET) : vec;
+
if (!intr_handle || intr_handle->nb_efd == 0 ||
- vec >= intr_handle->nb_efd) {
+ efd_idx >= intr_handle->nb_efd) {
RTE_LOG(ERR, EAL, "Wrong intr vector number.\n");
return -EPERM;
}
@@ -1094,7 +1100,7 @@ rte_intr_rx_ctl(struct rte_intr_handle *intr_handle, int epfd,
switch (op) {
case RTE_INTR_EVENT_ADD:
epfd_op = EPOLL_CTL_ADD;
- rev = &intr_handle->elist[vec];
+ rev = &intr_handle->elist[efd_idx];
if (rev->status != RTE_EPOLL_INVALID) {
RTE_LOG(INFO, EAL, "Event already been added.\n");
return -EEXIST;
@@ -1106,7 +1112,8 @@ rte_intr_rx_ctl(struct rte_intr_handle *intr_handle, int epfd,
epdata->data = data;
epdata->cb_fun = (rte_intr_event_cb_t)eal_intr_proc_rxtx_intr;
epdata->cb_arg = (void *)intr_handle;
- rc = rte_epoll_ctl(epfd, epfd_op, intr_handle->efds[vec], rev);
+ rc = rte_epoll_ctl(epfd, epfd_op,
+ intr_handle->efds[efd_idx], rev);
if (!rc)
RTE_LOG(DEBUG, EAL,
"efd %d associated with vec %d added on epfd %d"
@@ -1116,7 +1123,7 @@ rte_intr_rx_ctl(struct rte_intr_handle *intr_handle, int epfd,
break;
case RTE_INTR_EVENT_DEL:
epfd_op = EPOLL_CTL_DEL;
- rev = &intr_handle->elist[vec];
+ rev = &intr_handle->elist[efd_idx];
if (rev->status == RTE_EPOLL_INVALID) {
RTE_LOG(INFO, EAL, "Event does not exist.\n");
return -EPERM;
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 b095b86..8da81e7 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
@@ -39,6 +39,8 @@
#define _RTE_LINUXAPP_INTERRUPTS_H_
#define RTE_MAX_RXTX_INTR_VEC_ID 32
+#define RTE_INTR_VEC_ZERO_OFFSET 0
+#define RTE_INTR_VEC_RXTX_OFFSET 1
enum rte_intr_handle_type {
RTE_INTR_HANDLE_UNKNOWN = 0,
--
2.4.3
next prev parent reply other threads:[~2015-11-04 8:45 UTC|newest]
Thread overview: 79+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-24 5:33 [dpdk-dev] [PATCH v1 00/11] interrupt mode for i40e Cunming Liang
2015-09-24 5:33 ` [dpdk-dev] [PATCH v1 01/11] eal/linux: vfio map misc intr to vector zero Cunming Liang
2015-09-24 5:33 ` [dpdk-dev] [PATCH v1 02/11] ixgbe: reserve intr vector zero for misc cause Cunming Liang
2015-09-24 5:33 ` [dpdk-dev] [PATCH v1 03/11] igb: " Cunming Liang
2015-09-24 5:33 ` [dpdk-dev] [PATCH v1 04/11] eal/linux: not allow to enable zero intr efd Cunming Liang
2015-09-24 5:33 ` [dpdk-dev] [PATCH v1 05/11] eal/linux: add intr api to report multi-vector capability Cunming Liang
2015-09-24 5:33 ` [dpdk-dev] [PATCH v1 06/11] ixgbe: fix rx intr compatible issue with PF mbox Cunming Liang
2015-11-02 16:03 ` David Marchand
2015-11-02 16:09 ` Ananyev, Konstantin
2015-11-02 16:22 ` David Marchand
[not found] ` <2601191342CEEE43887BDE71AB97725836AB862D@irsmsx105.ger.corp.intel.com>
2015-11-02 16:41 ` Ananyev, Konstantin
2015-11-02 17:06 ` David Marchand
2015-11-02 17:23 ` Ananyev, Konstantin
2015-11-02 17:45 ` David Marchand
2015-09-24 5:33 ` [dpdk-dev] [PATCH v1 07/11] ixgbevf: cleanup unnecessary interrupt handler Cunming Liang
2015-09-24 5:33 ` [dpdk-dev] [PATCH v1 08/11] igb: fix rx intr compatible issue with PF mbox Cunming Liang
2015-09-24 5:33 ` [dpdk-dev] [PATCH v1 09/11] i40e: add rx interrupt support Cunming Liang
2015-09-24 5:33 ` [dpdk-dev] [PATCH v1 10/11] i40evf: " Cunming Liang
2015-09-24 5:33 ` [dpdk-dev] [PATCH v1 11/11] doc: release note update for intr mode Cunming Liang
2015-10-30 5:27 ` [dpdk-dev] [PATCH v2 00/11] interrupt mode for i40e Cunming Liang
2015-10-30 5:27 ` [dpdk-dev] [PATCH v2 01/11] eal/linux: vfio map misc intr to vector zero Cunming Liang
2015-10-30 7:11 ` He, Shaopeng
2015-10-30 7:33 ` Zhang, Helin
2015-10-30 14:22 ` Liang, Cunming
2015-11-02 15:53 ` David Marchand
2015-11-04 1:17 ` Liang, Cunming
2015-11-04 6:07 ` [dpdk-dev] [PATCH v3 00/13] interrupt mode for i40e Cunming Liang
2015-11-04 6:07 ` [dpdk-dev] [PATCH v3 01/13] eal: vfio map misc intr to vector zero Cunming Liang
2015-11-04 6:07 ` [dpdk-dev] [PATCH v3 02/13] ixgbe: reserve intr vector zero for misc cause Cunming Liang
2015-11-04 6:07 ` [dpdk-dev] [PATCH v3 03/13] igb: " Cunming Liang
2015-11-04 6:07 ` [dpdk-dev] [PATCH v3 04/13] eal/linux: not allow to enable zero intr efd Cunming Liang
2015-11-04 6:07 ` [dpdk-dev] [PATCH v3 05/13] ixgbe: fix efd_enable with zero number Cunming Liang
2015-11-04 6:07 ` [dpdk-dev] [PATCH v3 06/13] igb: " Cunming Liang
2015-11-04 6:07 ` [dpdk-dev] [PATCH v3 07/13] eal: add intr api to report multi-vector capability Cunming Liang
2015-11-04 6:07 ` [dpdk-dev] [PATCH v3 08/13] ixgbe: fix rx intr compatible issue with PF mbox Cunming Liang
2015-11-04 6:07 ` [dpdk-dev] [PATCH v3 09/13] ixgbe: fix unnecessary intr_vec free in dev_close Cunming Liang
2015-11-04 6:07 ` [dpdk-dev] [PATCH v3 10/13] ixgbevf: cleanup unnecessary interrupt handler Cunming Liang
2015-11-04 6:07 ` [dpdk-dev] [PATCH v3 11/13] igb: fix rx intr compatible issue with PF mbox Cunming Liang
2015-11-04 6:07 ` [dpdk-dev] [PATCH v3 12/13] i40e: add rx interrupt support Cunming Liang
2015-11-04 6:07 ` [dpdk-dev] [PATCH v3 13/13] i40evf: " Cunming Liang
2015-11-04 8:45 ` [dpdk-dev] [PATCH v4 00/13] interrupt mode for i40e Cunming Liang
2015-11-04 8:45 ` Cunming Liang [this message]
2015-11-04 13:06 ` [dpdk-dev] [PATCH v4 01/13] eal: vfio map misc intr to vector zero David Marchand
2015-11-04 8:45 ` [dpdk-dev] [PATCH v4 02/13] ixgbe: reserve intr vector zero for misc cause Cunming Liang
2015-11-04 8:45 ` [dpdk-dev] [PATCH v4 03/13] igb: " Cunming Liang
2015-11-04 8:45 ` [dpdk-dev] [PATCH v4 04/13] eal/linux: not allow to enable zero intr efd Cunming Liang
2015-11-04 13:06 ` David Marchand
2015-11-04 8:45 ` [dpdk-dev] [PATCH v4 05/13] ixgbe: fix efd_enable with zero number Cunming Liang
2015-11-04 8:45 ` [dpdk-dev] [PATCH v4 06/13] igb: " Cunming Liang
2015-11-04 8:45 ` [dpdk-dev] [PATCH v4 07/13] eal: add intr api to report multi-vector capability Cunming Liang
2015-11-04 13:07 ` David Marchand
2015-11-04 8:45 ` [dpdk-dev] [PATCH v4 08/13] ixgbe: fix rx intr compatible issue with PF mbox Cunming Liang
2015-11-04 8:45 ` [dpdk-dev] [PATCH v4 09/13] ixgbe: fix unnecessary intr_vec free in dev_close Cunming Liang
2015-11-04 8:45 ` [dpdk-dev] [PATCH v4 10/13] ixgbevf: cleanup unnecessary interrupt handler Cunming Liang
2015-11-04 8:45 ` [dpdk-dev] [PATCH v4 11/13] igb: fix rx intr compatible issue with PF mbox Cunming Liang
2015-11-04 8:45 ` [dpdk-dev] [PATCH v4 12/13] i40e: add rx interrupt support Cunming Liang
2015-11-04 8:45 ` [dpdk-dev] [PATCH v4 13/13] i40evf: " Cunming Liang
2015-11-04 14:29 ` [dpdk-dev] [PATCH v4 00/13] interrupt mode for i40e Thomas Monjalon
2015-10-30 5:27 ` [dpdk-dev] [PATCH v2 02/11] ixgbe: reserve intr vector zero for misc cause Cunming Liang
2015-10-30 5:27 ` [dpdk-dev] [PATCH v2 03/11] igb: " Cunming Liang
2015-10-30 5:27 ` [dpdk-dev] [PATCH v2 04/11] eal/linux: not allow to enable zero intr efd Cunming Liang
2015-10-30 7:11 ` He, Shaopeng
2015-10-30 5:27 ` [dpdk-dev] [PATCH v2 05/11] eal/linux: add intr api to report multi-vector capability Cunming Liang
2015-10-30 7:13 ` He, Shaopeng
2015-11-02 15:59 ` David Marchand
2015-11-04 1:21 ` Liang, Cunming
2015-10-30 5:27 ` [dpdk-dev] [PATCH v2 06/11] ixgbe: fix rx intr compatible issue with PF mbox Cunming Liang
2015-10-30 5:27 ` [dpdk-dev] [PATCH v2 07/11] ixgbevf: cleanup unnecessary interrupt handler Cunming Liang
2015-11-02 16:06 ` David Marchand
2015-11-04 1:37 ` Liang, Cunming
2015-10-30 5:27 ` [dpdk-dev] [PATCH v2 08/11] igb: fix rx intr compatible issue with PF mbox Cunming Liang
2015-10-30 5:27 ` [dpdk-dev] [PATCH v2 09/11] i40e: add rx interrupt support Cunming Liang
2015-10-30 7:33 ` Zhang, Helin
2015-10-30 7:35 ` Wu, Jingjing
2015-10-30 5:27 ` [dpdk-dev] [PATCH v2 10/11] i40evf: " Cunming Liang
2015-10-30 7:36 ` Wu, Jingjing
2015-10-30 7:38 ` Zhang, Helin
2015-10-30 5:27 ` [dpdk-dev] [PATCH 11/11] doc: release note update for intr mode Cunming Liang
2015-10-30 8:21 ` [dpdk-dev] [PATCH v2 00/11] interrupt mode for i40e Zhang, Helin
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=1446626740-28824-2-git-send-email-cunming.liang@intel.com \
--to=cunming.liang@intel.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).