From patchwork Thu Sep 28 02:28:33 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Dai X-Patchwork-Id: 29221 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id A901E2C36; Thu, 28 Sep 2017 04:41:14 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id BAD422B99; Thu, 28 Sep 2017 04:41:13 +0200 (CEST) Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Sep 2017 19:41:12 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.42,447,1500966000"; d="scan'208";a="156935572" Received: from dpdk6.bj.intel.com ([172.16.182.87]) by fmsmga006.fm.intel.com with ESMTP; 27 Sep 2017 19:41:10 -0700 From: Wei Dai To: wenzhuo.lu@intel.com, konstantin.ananyev@intel.com, cunming.liang@intel.com, jianwei.ma@intel.com Cc: dev@dpdk.org, Wei Dai , stable@dpdk.org Date: Thu, 28 Sep 2017 10:28:33 +0800 Message-Id: <1506565713-70534-1-git-send-email-wei.dai@intel.com> X-Mailer: git-send-email 2.7.5 In-Reply-To: <1505902146-50272-1-git-send-email-wei.dai@intel.com> References: <1505902146-50272-1-git-send-email-wei.dai@intel.com> Subject: [dpdk-dev] [PATCH v2] net/ixgbe: fix VFIO interrupt mapping in VF 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" When a VF port is bound to VFIO-PIC, only miscellaneous interrupt is mapped to VFIO vector 0 in eth_ixgbevf_dev_init( ). In ixgbevf_dev_start(), if previous VFIO interrupt mapping set in eth_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 Acked-by: Wenzhuo Lu Tested-by: Jianwei Ma --- 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..f49c616 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 VF port is bound to VFIO-PCI, only miscellaneous interrupt + * is mapped to VFIO vector 0 in eth_ixgbevf_dev_init( ). + * If previous VFIO interrupt mapping setting in eth_ixgbevf_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 */