From patchwork Fri Nov 3 00:51:00 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ferruh Yigit X-Patchwork-Id: 31144 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 6D8F31B64E; Fri, 3 Nov 2017 01:51:08 +0100 (CET) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by dpdk.org (Postfix) with ESMTP id A23BA1B3DE; Fri, 3 Nov 2017 01:51:06 +0100 (CET) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga104.jf.intel.com with ESMTP; 02 Nov 2017 17:51:05 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.44,336,1505804400"; d="scan'208";a="331424892" Received: from silpixa00372839.ir.intel.com (HELO silpixa00372839.ger.corp.intel.com) ([10.237.222.154]) by fmsmga004.fm.intel.com with ESMTP; 02 Nov 2017 17:51:02 -0700 From: Ferruh Yigit To: Thomas Monjalon Cc: dev@dpdk.org, Ferruh Yigit , stable@dpdk.org, Jianfeng Tan , Jingjing Wu , Shijith Thotton , Gregory Etelson , Harish Patil , George Prekas , Sergio Gonzalez Monroy , Rasesh Mody Date: Fri, 3 Nov 2017 00:51:00 +0000 Message-Id: <20171103005100.44633-1-ferruh.yigit@intel.com> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20171103003005.44339-1-ferruh.yigit@intel.com> References: <20171103003005.44339-1-ferruh.yigit@intel.com> Subject: [dpdk-dev] [PATCH v2] igb_uio: add config option to control reset 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" Adding a compile time configuration option to control device reset done during DPDK application exit. Config option is CONFIG_RTE_EAL_IGB_UIO_RESET and enabled by default, so by default reset will happen. Having this reset is safer to be sure device left in a proper case. But for special cases [1] it is possible to disable the config option to prevent the device reset. [1] http://dpdk.org/ml/archives/dev/2017-November/080927.html Fixes: b58eedfc7dd5 ("igb_uio: issue FLR during open and release of device file") Cc: stable@dpdk.org Signed-off-by: Ferruh Yigit Reviewed-by: Jianfeng Tan --- Cc: Jianfeng Tan Cc: Jingjing Wu Cc: Shijith Thotton Cc: Gregory Etelson Cc: Harish Patil Cc: George Prekas Cc: Sergio Gonzalez Monroy Cc: Rasesh Mody v2: * fix typo in commit log --- config/common_base | 1 + config/common_linuxapp | 1 + lib/librte_eal/linuxapp/igb_uio/igb_uio.c | 2 ++ 3 files changed, 4 insertions(+) diff --git a/config/common_base b/config/common_base index 82ee75456..2a9947420 100644 --- a/config/common_base +++ b/config/common_base @@ -102,6 +102,7 @@ CONFIG_RTE_LIBEAL_USE_HPET=n CONFIG_RTE_EAL_ALLOW_INV_SOCKET_ID=n CONFIG_RTE_EAL_ALWAYS_PANIC_ON_ERROR=n CONFIG_RTE_EAL_IGB_UIO=n +CONFIG_RTE_EAL_IGB_UIO_RESET=n CONFIG_RTE_EAL_VFIO=n CONFIG_RTE_MALLOC_DEBUG=n CONFIG_RTE_EAL_NUMA_AWARE_HUGEPAGES=n diff --git a/config/common_linuxapp b/config/common_linuxapp index 74c7d64ec..b3a602909 100644 --- a/config/common_linuxapp +++ b/config/common_linuxapp @@ -37,6 +37,7 @@ CONFIG_RTE_EXEC_ENV_LINUXAPP=y CONFIG_RTE_EAL_NUMA_AWARE_HUGEPAGES=y CONFIG_RTE_EAL_IGB_UIO=y +CONFIG_RTE_EAL_IGB_UIO_RESET=y CONFIG_RTE_EAL_VFIO=y CONFIG_RTE_KNI_KMOD=y CONFIG_RTE_LIBRTE_KNI=y diff --git a/lib/librte_eal/linuxapp/igb_uio/igb_uio.c b/lib/librte_eal/linuxapp/igb_uio/igb_uio.c index fd320d87d..0325722c0 100644 --- a/lib/librte_eal/linuxapp/igb_uio/igb_uio.c +++ b/lib/librte_eal/linuxapp/igb_uio/igb_uio.c @@ -360,7 +360,9 @@ igbuio_pci_release(struct uio_info *info, struct inode *inode) /* stop the device from further DMA */ pci_clear_master(dev); +#ifdef RTE_EAL_IGB_UIO_RESET pci_reset_function(dev); +#endif return 0; }