From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id 29529108D for ; Fri, 31 Mar 2017 16:16:22 +0200 (CEST) Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga105.jf.intel.com with ESMTP; 31 Mar 2017 07:16:21 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.36,252,1486454400"; d="scan'208";a="81390272" Received: from fyigit-mobl1.ger.corp.intel.com (HELO [10.237.220.122]) ([10.237.220.122]) by orsmga005.jf.intel.com with ESMTP; 31 Mar 2017 07:16:16 -0700 To: Thomas Monjalon , Jianfeng Tan References: <1480696111-116651-1-git-send-email-jianfeng.tan@intel.com> <1480697146-118038-1-git-send-email-jianfeng.tan@intel.com> <1729096.OcIPJKQlaJ@xps13> Cc: dev@dpdk.org, stephen@networkplumber.org, jing.d.chen@intel.com From: Ferruh Yigit Message-ID: <6e872ad0-a212-2324-41ad-66ef6e6a30d3@intel.com> Date: Fri, 31 Mar 2017 15:16:16 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <1729096.OcIPJKQlaJ@xps13> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH] igb_uio: stop device when closing /dev/uioX 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: Fri, 31 Mar 2017 14:16:23 -0000 On 3/30/2017 9:22 PM, Thomas Monjalon wrote: > 2016-12-02 16:45, Jianfeng Tan: >> Depends-on: http://dpdk.org/dev/patchwork/patch/17493/ > > The above patch is marked as rejected. > Do we want to reject also this patch? Above patch rejected because it may have backward compatibility issues with the older DPDK (1.8 and older if I remember correct) with newer kernels. Plan was checking if this patch can be updated to remove dependency, and if not accepting above patch. But as far as I can see not worked on it. We may drop this if Jianfeng don't have any plan to work on it. > >> When a DPDK application grab a PCI device, device and driver work >> together to Rx/Tx packets. If the DPDK app crashes or gets killed, >> there's no chance for DPDK driver to stop the device, which means >> rte_eth_dev_stop() will not be called. >> >> This could result in problems. In virtio's case, the device (the >> vhost backend), will keep working. If packets come, the vhost will >> copy them into the vring, which is negotiated with the previous DPDK >> app. But the resources, especially hugepages, are recycled by VM >> kernel. What's worse, the memory could be allocated for other usage, >> and re-written. This leads to an uncertain situation. Like this post >> has reported, https://bugs.launchpad.net/qemu/+bug/1558175, QEMU's >> vhost finds out wrong value, and exits the whole QEMU process. >> >> To make it right, we need to restart (or reset) the device and make >> the device go into the initial state, when uio-generic or igb_uio >> recycles the PCI device. There's a chance in uio framework to disable >> devices when /dev/uioX gets closed. Here we enable the pci device >> in open() hook and disable it in release() hook. >> >> However, if device is not enabled in probe() phase any more, we can >> not register irq in probe() through uio_register_device(). To address >> that, we invoke request_irq() to register callback directly. >> >> Similar change needs to be done in uio-generic driver. And vfio-pci >> seems to have done that already. >> >> Signed-off-by: Jianfeng Tan >