DPDK patches and discussions
 help / color / mirror / Atom feed
From: Wei Dai <wei.dai@intel.com>
To: wenzhuo.lu@intel.com, konstantin.ananyev@intel.com
Cc: dev@dpdk.org, Wei Dai <wei.dai@intel.com>, stable@dpdk.org
Subject: [dpdk-dev] [PATCH] net/ixgbe: fix VFIO interrupt mapping in PF
Date: Wed, 20 Sep 2017 18:24:03 +0800	[thread overview]
Message-ID: <1505903043-51967-1-git-send-email-wei.dai@intel.com> (raw)
In-Reply-To: <1505895102-58446-1-git-send-email-wei.dai@intel.com>

When a PF port is bound to VFIO-PIC, only miscellaneous interrupt
is mapped to VFIO vector 0 in ixgbe_dev_init( ).
In ixgbe_dev_start(), if previous VFIO interrupt mapping set in
ixgbe_dev_init( ) is not cleard, it will fail when calling
rte_intr_enable( ) tries to map Rx queue interrupt to other VFIO
vectors. This patch clears the VFIO interrupt mappings before
setting both miscellaneous and Rx queue interrupt mappings again
to avoid failure.

Fixes: 0a45657a6794 ("pci: rework interrupt handling")
Cc: stable@dpdk.org

Signed-off-by: Wei Dai <wei.dai@intel.com>
---
 drivers/net/ixgbe/ixgbe_ethdev.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index 9ca5cbc..5292694 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -2692,6 +2692,15 @@ ixgbe_dev_start(struct rte_eth_dev *dev)
 				     " no intr multiplex");
 	}
 
+	/* When a PF port is bound to VFIO-PCI only miscellaneous interrupt
+	 * is mapped to VFIO vector 0 in ixgbe_dev_init( ).
+	 * If previous VFIO interrupt mapping set in ixgbe_dev_init( ) is
+	 * not cleared, it will fail when following rte_intr_enable( ) tries
+	 * to map Rx queue interrupt to other VFIO vectors.
+	 * So clear uio/vfio intr/evevnfd first to avoid failure.
+	 */
+	rte_intr_disable(intr_handle);
+
 	/* check if rxq interrupt is enabled */
 	if (dev->data->dev_conf.intr_conf.rxq != 0 &&
 	    rte_intr_dp_is_en(intr_handle))
-- 
2.7.5

  reply	other threads:[~2017-09-20 10:36 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-20  8:11 Wei Dai
2017-09-20 10:24 ` Wei Dai [this message]
2018-01-09  8:23   ` [dpdk-dev] " Wenzhuo Lu
2018-01-10  6:28     ` Yang, Qiming
2018-01-22  7:03       ` Dai, Wei

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=1505903043-51967-1-git-send-email-wei.dai@intel.com \
    --to=wei.dai@intel.com \
    --cc=dev@dpdk.org \
    --cc=konstantin.ananyev@intel.com \
    --cc=stable@dpdk.org \
    --cc=wenzhuo.lu@intel.com \
    /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).