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 <huawei.xie at intel.com>
> ---
> 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.
> + "%s(): kernel driver is manipulating this device." \
> + " Please unbind the kernel driver.", __func__);
> + return -1;
> + }
> +
> snprintf(pci_id, sizeof(pci_id), PCI_PRI_FMT,
> pci_dev->addr.domain,
> pci_dev->addr.bus,- [dpdk-dev] [PATCH 0/4] check if any kernel driver is man... Huawei Xie
- [dpdk-dev] [PATCH 1/4] eal: make the comment more a... Huawei Xie
- [dpdk-dev] [PATCH 2/4] eal: set kdrv to RTE_KDRV_NO... Huawei Xie
- [dpdk-dev] [PATCH 2/4] eal: set kdrv to RTE_KDR... David Marchand
- [dpdk-dev] [PATCH 3/4] virtio: return 1 to tell the... Huawei Xie
- [dpdk-dev] [PATCH 3/4] virtio: return 1 to tell... Yuanhan Liu
- [dpdk-dev] [PATCH 3/4] virtio: return 1 to ... Xie, Huawei
- [dpdk-dev] [PATCH 4/4] virtio: check if any kernel ... Huawei Xie
- [dpdk-dev] [PATCH 4/4] virtio: check if any ker... Yuanhan Liu
- [dpdk-dev] [PATCH 4/4] virtio: check if any... Xie, Huawei
- [dpdk-dev] [PATCH 4/4] virtio: check if any ker... Xie, Huawei
- [dpdk-dev] [PATCH 4/4] virtio: check if any... Stephen Hemminger
- [dpdk-dev] [PATCH 4/4] virtio: check if any... Panu Matilainen
- [dpdk-dev] [PATCH 0/4] check if any kernel driver i... Peter Xu
- [dpdk-dev] [PATCH v2 0/4] fix the issue that DPDK takes ... Huawei Xie
- [dpdk-dev] [PATCH v2 1/4] eal: make the comment mor... Huawei Xie
- [dpdk-dev] [PATCH v2 2/4] eal: set kdrv to RTE_KDRV... Huawei Xie
- [dpdk-dev] [PATCH v2 3/4] virtio: return 1 to tell ... Huawei Xie
- [dpdk-dev] [PATCH v2 4/4] virtio: check if any kern... Huawei Xie
- [dpdk-dev] [PATCH v2 4/4] virtio: check if any ... Stephen Hemminger
- [dpdk-dev] [PATCH v2 4/4] virtio: check if ... Xie, Huawei

