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 2A5496837 for ; Mon, 28 Dec 2015 06:29:10 +0100 (CET) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga101.fm.intel.com with ESMTP; 27 Dec 2015 21:29:09 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,489,1444719600"; d="scan'208";a="624597383" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by FMSMGA003.fm.intel.com with ESMTP; 27 Dec 2015 21:29:08 -0800 Received: from fmsmsx153.amr.corp.intel.com (10.18.125.6) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.248.2; Sun, 27 Dec 2015 21:29:08 -0800 Received: from shsmsx103.ccr.corp.intel.com (10.239.4.69) by FMSMSX153.amr.corp.intel.com (10.18.125.6) with Microsoft SMTP Server (TLS) id 14.3.248.2; Sun, 27 Dec 2015 21:29:07 -0800 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.111]) by SHSMSX103.ccr.corp.intel.com ([169.254.4.57]) with mapi id 14.03.0248.002; Mon, 28 Dec 2015 13:29:05 +0800 From: "Xie, Huawei" To: Yuanhan Liu Thread-Topic: [PATCH 4/4] virtio: check if any kernel driver is manipulating the device Thread-Index: AQHRQTAd/zrgClIUg0W+8sfCXlhWlp7f3opg Date: Mon, 28 Dec 2015 05:29:05 +0000 Message-ID: References: <20151222035041.GA7532@pxdev.xzpeter.org> <1450982292-129560-1-git-send-email-huawei.xie@intel.com> <1450982292-129560-5-git-send-email-huawei.xie@intel.com> <20151228052658.GE18863@yliu-dev.sh.intel.com> In-Reply-To: <20151228052658.GE18863@yliu-dev.sh.intel.com> 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" Subject: Re: [dpdk-dev] [PATCH 4/4] virtio: check if any kernel driver is manipulating the 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: Mon, 28 Dec 2015 05:29:10 -0000 > -----Original Message----- > From: Yuanhan Liu [mailto:yuanhan.liu@linux.intel.com] > Sent: Monday, December 28, 2015 1:27 PM > To: Xie, Huawei > Cc: dev@dpdk.org; Jayakumar, Muthurajan; Troitsky, Nikita; > peterx@redhat.com; stephen@networkplumber.org; > Changchun.ouyang@hotmail.com; thomas.monjalon@6wind.com > Subject: Re: [PATCH 4/4] virtio: check if any kernel driver is > manipulating the device >=20 > On Fri, Dec 25, 2015 at 02:38:12AM +0800, Huawei Xie wrote: > > virtio PMD could use IO port to configure the virtio device without > > using uio driver. > > > > There are two issues with previous implementation: > > 1) virtio PMD will take over each virtio device blindly even if some > > are not intended for DPDK. > > 2) driver conflict between virtio PMD and virtio-net kernel driver. > > > > This patch checks if there is any kernel driver manipulating the > virtio > > device before virtio PMD uses IO port to configure the device. > > > > Fixes: da978dfdc43b ("virtio: use port IO to get PCI resource") > > > > Signed-off-by: Huawei Xie > > --- > > drivers/net/virtio/virtio_ethdev.c | 7 +++++++ > > 1 file changed, 7 insertions(+) > > > > diff --git a/drivers/net/virtio/virtio_ethdev.c > b/drivers/net/virtio/virtio_ethdev.c > > index 00015ef..504346a 100644 > > --- a/drivers/net/virtio/virtio_ethdev.c > > +++ b/drivers/net/virtio/virtio_ethdev.c > > @@ -1138,6 +1138,13 @@ static int > virtio_resource_init_by_ioports(struct rte_pci_device *pci_dev) > > int found =3D 0; > > size_t linesz; > > > > + if (pci_dev->kdrv !=3D RTE_KDRV_NONE) { > > + PMD_INIT_LOG(ERR, > > + "%s(): kernel driver is manipulating this device." \ > > + " Please unbind the kernel driver.", __func__); >=20 > PMD_INIT_LOG already prints the function, no need to reference > __func__ > again here. Good. We have to fix the similar issue in virtio_resource_init_xx as well. >=20 > --yliu > > + return -1; > > + } > > + > > snprintf(pci_id, sizeof(pci_id), PCI_PRI_FMT, > > pci_dev->addr.domain, > > pci_dev->addr.bus, > > -- > > 1.8.1.4