From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 238A97CE5; Wed, 20 Sep 2017 12:21:43 +0200 (CEST) Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 20 Sep 2017 03:21:43 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.42,421,1500966000"; d="scan'208";a="153977740" Received: from dpdk6.bj.intel.com ([172.16.182.87]) by fmsmga006.fm.intel.com with ESMTP; 20 Sep 2017 03:21:41 -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:09:06 +0800 Message-Id: <1505902146-50272-1-git-send-email-wei.dai@intel.com> X-Mailer: git-send-email 2.7.5 Subject: [dpdk-stable] [PATCH] net/ixgbe: fix VFIO interrupt mapping in VF X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Sep 2017 10:21:44 -0000 When a VF port is bound to VFIO-PIC, only miscellaneous interrupt is mapped to VFIO vector 0 in ixgbevf_dev_init( ). In ixgbevf_dev_start(), if previous VFIO interrupt mapping set in ixgbevf_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: 77234603fba0 ("net/ixgbe: support VF mailbox interrupt for link up/down") 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..f7a8dc8 100644 --- a/drivers/net/ixgbe/ixgbe_ethdev.c +++ b/drivers/net/ixgbe/ixgbe_ethdev.c @@ -5046,6 +5046,15 @@ ixgbevf_dev_start(struct rte_eth_dev *dev) } ixgbevf_configure_msix(dev); + /* 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); + rte_intr_enable(intr_handle); /* Re-enable interrupt for VF */ -- 2.7.5