From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id C21C19A81 for ; Tue, 1 Mar 2016 08:54:04 +0100 (CET) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga104.fm.intel.com with ESMTP; 29 Feb 2016 23:54:04 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,522,1449561600"; d="scan'208";a="898232413" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by orsmga001.jf.intel.com with ESMTP; 29 Feb 2016 23:54:03 -0800 Received: from fmsmsx118.amr.corp.intel.com (10.18.116.18) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.248.2; Mon, 29 Feb 2016 23:54:02 -0800 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by fmsmsx118.amr.corp.intel.com (10.18.116.18) with Microsoft SMTP Server (TLS) id 14.3.248.2; Mon, 29 Feb 2016 23:54:02 -0800 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.136]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.18]) with mapi id 14.03.0248.002; Tue, 1 Mar 2016 15:54:00 +0800 From: "Xie, Huawei" To: Thomas Monjalon Thread-Topic: [PATCH v4 4/4] virtio: return 1 to tell the upper layer we don't take over this device Thread-Index: AdFzj4MuUDrymegJT1SI/9bUpaqDKw== Date: Tue, 1 Mar 2016 07:53:59 +0000 Message-ID: References: <20151222035041.GA7532@pxdev.xzpeter.org> <1456451636-118476-1-git-send-email-huawei.xie@intel.com> <1456451636-118476-5-git-send-email-huawei.xie@intel.com> <1870056.1ZGr9B153f@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 v4 4/4] virtio: return 1 to tell the upper layer we don't take over this device 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: Tue, 01 Mar 2016 07:54:05 -0000 On 3/1/2016 3:18 PM, Thomas Monjalon wrote:=0A= > Hi Huawei,=0A= >=0A= > 2016-02-26 09:53, Huawei Xie:=0A= >> --- a/drivers/net/virtio/virtio_ethdev.c=0A= >> +++ b/drivers/net/virtio/virtio_ethdev.c=0A= >> @@ -1,4 +1,5 @@=0A= >> /*-=0A= >> +=0A= > This new line seems useless :)=0A= =0A= Sorry, would fix.=0A= =0A= >=0A= >> * BSD LICENSE=0A= >> *=0A= > [...]=0A= >> @@ -1037,8 +1039,11 @@ eth_virtio_dev_init(struct rte_eth_dev *eth_dev)= =0A= >> =0A= >> pci_dev =3D eth_dev->pci_dev;=0A= >> =0A= >> - if (vtpci_init(pci_dev, hw) < 0)=0A= >> - return -1;=0A= >> + ret =3D vtpci_init(pci_dev, hw);=0A= >> + if (ret) {=0A= >> + rte_free(eth_dev->data->mac_addrs);=0A= > The freeing seems not related to this patch.=0A= =0A= I can send a separate patch, ok within this patchset?=0A= =0A= >=0A= >> + return ret;=0A= >> + }=0A= > [...]=0A= >> PMD_INIT_LOG(INFO, "trying with legacy virtio pci.");=0A= >> - if (legacy_virtio_resource_init(dev, hw) < 0)=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= > You cannot skip a device if it was whitelisted.=0A= > I think you should check RTE_DEVTYPE_WHITELISTED_PCI and throw an error= =0A= > in this case.=0A= =0A= I feel there is a subtle difference on the understanding of -w args. To=0A= me, without it, probe all devices; with it, only probe whiltelisted API.=0A= That is all.=0A= Do you mean that -w implies that devices whitelisted must be probed=0A= successfully otherwise we throw an error? If i get it right, then what=0A= about the devices whitelisted but without PMD driver?=0A= =0A= I will fix, :).=0A= if (dev->kdrv =3D=3D RTE_KDRV_UNKNOWN && dev->devargs->type !=3D=0A= RTE_DEVTYPE_WHITELISTED_PCI) {=0A= ....=0A= return 1;=0A= }=0A= =0A= =0A= >=0A= >=0A= =0A=