From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH v2 4/4] virtio: check if any kernel driver is manipulating the virtio device Date: Wed, 27 Jan 2016 13:43:49 +0100 Message-ID: <34618638.VfLxKTif05@xps13> References: <20151222035041.GA7532@pxdev.xzpeter.org> <1451843773-103006-5-git-send-email-huawei.xie@intel.com> <568E7382.9060406@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: dev@dpdk.org To: Huawei Xie Return-path: Received: from mail-wm0-f50.google.com (mail-wm0-f50.google.com [74.125.82.50]) by dpdk.org (Postfix) with ESMTP id 2AFE795AB for ; Wed, 27 Jan 2016 13:44:59 +0100 (CET) Received: by mail-wm0-f50.google.com with SMTP id l66so710013wml.0 for ; Wed, 27 Jan 2016 04:44:59 -0800 (PST) In-Reply-To: <568E7382.9060406@redhat.com> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 2016-01-07 16:17, Panu Matilainen: > On 01/03/2016 07:56 PM, Huawei Xie wrote: > > v2 changes: > > change LOG level from ERR to INFO > > > > 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 e815acd..7a50dac 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 = 0; > > size_t linesz; > > > > + if (pci_dev->kdrv != RTE_KDRV_NONE) { > > + PMD_INIT_LOG(INFO, > > + "kernel driver is manipulating this device." \ > > + " Please unbind the kernel driver."); > > At the very least this message needs to be changed. > > Like said earlier, I think the message could just as well be dropped > entirely, but at least it should be something to the tune of "ignoring > kernel owned device" instead of asking the user to break their > configuration. Huawei, a v3 is required. Thanks