From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 1C6861B159; Wed, 20 Sep 2017 12:36:42 +0200 (CEST) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 20 Sep 2017 03:36:35 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.42,421,1500966000"; d="scan'208";a="137451907" Received: from dpdk6.bj.intel.com ([172.16.182.87]) by orsmga002.jf.intel.com with ESMTP; 20 Sep 2017 03:36:33 -0700 From: Wei Dai To: wenzhuo.lu@intel.com, konstantin.ananyev@intel.com Cc: dev@dpdk.org, Wei Dai , stable@dpdk.org Date: Wed, 20 Sep 2017 18:24:03 +0800 Message-Id: <1505903043-51967-1-git-send-email-wei.dai@intel.com> X-Mailer: git-send-email 2.7.5 In-Reply-To: <1505895102-58446-1-git-send-email-wei.dai@intel.com> References: <1505895102-58446-1-git-send-email-wei.dai@intel.com> Subject: [dpdk-dev] [PATCH] net/ixgbe: fix VFIO interrupt mapping in PF X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Sep 2017 10:36:43 -0000 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 --- 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