From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 68A082C4B for ; Fri, 26 Feb 2016 10:01:44 +0100 (CET) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga101.fm.intel.com with ESMTP; 26 Feb 2016 01:01:43 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,498,1449561600"; d="scan'208";a="895217388" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by orsmga001.jf.intel.com with ESMTP; 26 Feb 2016 01:01:43 -0800 Received: from fmsmsx154.amr.corp.intel.com (10.18.116.70) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.248.2; Fri, 26 Feb 2016 01:00:44 -0800 Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) by FMSMSX154.amr.corp.intel.com (10.18.116.70) with Microsoft SMTP Server (TLS) id 14.3.248.2; Fri, 26 Feb 2016 01:00:44 -0800 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.136]) by SHSMSX104.ccr.corp.intel.com ([169.254.5.132]) with mapi id 14.03.0248.002; Fri, 26 Feb 2016 17:00:36 +0800 From: "Xie, Huawei" To: David Marchand Thread-Topic: [PATCH v3 0/4] fix the issue that DPDK takes over virtio device blindly Thread-Index: AdFwXE5LNSeP5izFRJ2yyI3Aew9WpQ== Date: Fri, 26 Feb 2016 09:00:35 +0000 Message-ID: References: <20151222035041.GA7532@pxdev.xzpeter.org> <1453908082-92036-1-git-send-email-huawei.xie@intel.com> <33109608.rF1RQkQoo2@xps13> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Cc: "dev@dpdk.org" , "Troitsky, Nikita" Subject: Re: [dpdk-dev] [PATCH v3 0/4] fix the issue that DPDK takes over virtio device blindly X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Feb 2016 09:01:45 -0000 On 2/26/2016 4:41 PM, David Marchand wrote:=0A= > On Fri, Feb 26, 2016 at 7:09 AM, Xie, Huawei wrote= :=0A= >> On 2/24/2016 8:45 PM, Thomas Monjalon wrote:=0A= >>>> Huawei Xie (4):=0A= >>>> eal: make the comment more accurate=0A= >>>> eal: set kdrv to RTE_KDRV_NONE if kernel driver isn't manipulating t= he device.=0A= >>>> virtio: return 1 to tell the kernel we don't take over this device= =0A= >>>> virtio: check if kernel driver is manipulating the virtio device=0A= >>> The virtio PCI code has been refactored.=0A= >>> Please Huawei, would it be possible to rebase on master?=0A= >> OK. Since IO port map is moved to EAL layer, it is not straightforward= =0A= >> like before for virtio PMD to distinguish the reason why port map fails.= =0A= >> We have two choices. Return 1 to the upper layer to say that we don't=0A= >> take over the device for all the map failures or we check the driver=0A= >> type, return -1 for UIO/VFIO driver error, return 1 for kernel driver,= =0A= >> which is a bit overelaborate.=0A= > The important thing is to have eal report "none" driver first (your=0A= > 2nd patch) , then in ioport_map, "none" driver will trigger the x86=0A= > special case (see other discussion [1]).=0A= > For "uio" drivers, code (when fixed for uio_pci_generic) already does=0A= > the right stuff.=0A= > "vfio" is handled.=0A= > Anything else should fail once we have the "none" driver correctly report= ed.=0A= >=0A= =0A= in rte_eal_pci_map_device:=0A= case RTE_KDRV_NONE:=0A= #if defined(RTE_ARCH_X86)=0A= ret =3D pci_ioport_map(dev, bar, p);=0A= #endif=0A= break;=0A= }=0A= =0A= =0A= in vtpci_init:=0A= if (legacy_virtio_resource_init(dev, hw) < 0) {=0A= if (dev->kdrv =3D=3D RTE_KDRV_UNKNOWN) {=0A= PMD_INIT_LOG(INFO,=0A= "skip kernel managed virtio device.");=0A= return 1;=0A= }=0A= return -1;=0A= }=0A= =0A= =0A= in dev_init=0A= ret =3D vt_pci_init=0A= if (ret)=0A= return ret=0A= > What did I miss ?=0A= >=0A= >=0A= > [1] http://dpdk.org/ml/archives/dev/2016-February/034035.html=0A= >=0A= =0A=