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 E6CFA939C for ; Tue, 5 Jan 2016 15:44:55 +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 D83428C1C0; Tue, 5 Jan 2016 14:44:54 +0000 (UTC) Received: from sopuli.koti.laiskiainen.org (vpn1-5-58.ams2.redhat.com [10.36.5.58]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u05EirtJ022776; Tue, 5 Jan 2016 09:44:54 -0500 To: "Xie, Huawei" , "dev@dpdk.org" 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> From: Panu Matilainen Message-ID: <568BD6E5.1060703@redhat.com> Date: Tue, 5 Jan 2016 16:44:53 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 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: Tue, 05 Jan 2016 14:44:56 -0000 On 01/04/2016 11:02 AM, Xie, Huawei wrote: > On 12/25/2015 6:33 PM, Xie, Huawei 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 = 0; >> size_t linesz; >> >> + if (pci_dev->kdrv != RTE_KDRV_NONE) { >> + PMD_INIT_LOG(ERR, > Better change ERR to INFO and revise the message followed, since user > might not want to use this device for DPDK. Indeed. The whole point of this exercise is to have a clear way of telling DPDK which virtio devices it should (and should not) use, so it should just act accordingly and shut up. >> + "%s(): kernel driver is manipulating this device." \ >> + " Please unbind the kernel driver.", __func__); I'd suggest just dropping the whole message, DPDK doesn't log such messages for any other devices either. That, or make it a generic debug-level log in pci_scan_one(). - Panu -