From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id 54F5BC39C for ; Thu, 28 Jan 2016 10:55:27 +0100 (CET) Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (Postfix) with ESMTPS id A440E8F2EC; Thu, 28 Jan 2016 09:55:26 +0000 (UTC) Received: from sopuli.koti.laiskiainen.org (vpn1-4-63.ams2.redhat.com [10.36.4.63]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u0S9tOHV029825; Thu, 28 Jan 2016 04:55:25 -0500 To: Huawei Xie , dev@dpdk.org, thomas.monjalon@6wind.com References: <20151222035041.GA7532@pxdev.xzpeter.org> <1453908082-92036-1-git-send-email-huawei.xie@intel.com> <1453908082-92036-5-git-send-email-huawei.xie@intel.com> From: Panu Matilainen Message-ID: <56A9E58C.4000802@redhat.com> Date: Thu, 28 Jan 2016 11:55:24 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: <1453908082-92036-5-git-send-email-huawei.xie@intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 Cc: nikita.troitsky@intel.com Subject: Re: [dpdk-dev] [PATCH v3 4/4] virtio: check if kernel driver is manipulating the virtio 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: Thu, 28 Jan 2016 09:55:28 -0000 On 01/27/2016 05:21 PM, Huawei Xie wrote: > v3 changes: > change log message to tell user that the virtio device is skipped > due to it is managed by kernel driver, instead of asking user to > unbind it from kernel driver. > > v2 changes: > change LOG level from ERR to INFO > > virtio PMD could use IO port to configure the virtio device without > using uio driver(vfio-noniommu mode should work as well). > > 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 | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c > index e815acd..ea1874a 100644 > --- a/drivers/net/virtio/virtio_ethdev.c > +++ b/drivers/net/virtio/virtio_ethdev.c > @@ -1138,6 +1138,11 @@ static int virtio_resource_init_by_ioports(struct rte_pci_device *pci_dev) > int found = 0; > size_t linesz; > > + if (pci_dev->kdrv != RTE_KDRV_NONE) { > + PMD_INIT_LOG(INFO, "skip kernel managed virtio device."); > + return -1; > + } > + > snprintf(pci_id, sizeof(pci_id), PCI_PRI_FMT, > pci_dev->addr.domain, > pci_dev->addr.bus, > "Manage" is a good term for this, much better than "manipulate" used in the subject of this patch and patch 2/4. "Check if kernel is manipulating foo" sounds like something that is happening right now, as in "wait until kernel has stopped fiddling with it and then do our own stuff while its quiet", managed makes is clear its about the overall state instead. Not asking you to submit v4 just because of that, but if the need arises for other reasons it'd be nice to fix it as well, otherwise perhaps Thomas can adjust it while committing? - Panu -