From patchwork Wed Sep 20 08:11:42 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Dai X-Patchwork-Id: 28978 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 2CB4C101B; Wed, 20 Sep 2017 10:24:18 +0200 (CEST) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id 9D34B201; Wed, 20 Sep 2017 10:24:15 +0200 (CEST) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 20 Sep 2017 01:24:14 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos; i="5.42,420,1500966000"; d="scan'208"; a="1174064929" Received: from dpdk6.bj.intel.com ([172.16.182.87]) by orsmga001.jf.intel.com with ESMTP; 20 Sep 2017 01:24:12 -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 16:11:42 +0800 Message-Id: <1505895102-58446-1-git-send-email-wei.dai@intel.com> X-Mailer: git-send-email 2.7.5 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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..9030d3d 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))