RPM: Apex: Backport patch to dpdk to fix PCI walk to fix segfault to
[ovsnfv.git] / build / patches / dpdk-16.04-virtio-devargs.patch
1 diff --git a/drivers/net/virtio/virtio_pci.c b/drivers/net/virtio/virtio_pci.c
2 index c007959..3a25f82 100644
3 --- a/drivers/net/virtio/virtio_pci.c
4 +++ b/drivers/net/virtio/virtio_pci.c
5 @@ -626,6 +626,7 @@ next:
6   * Return -1:
7   *   if there is error mapping with VFIO/UIO.
8   *   if port map error when driver type is KDRV_NONE.
9 + *   if whitelisted but driver type is KDRV_UNKNOWN.
10   * Return 1 if kernel driver is managing the device.
11   * Return 0 on success.
12   */
13 @@ -650,7 +651,8 @@ vtpci_init(struct rte_pci_device *dev, struct virtio_hw *hw)
14         PMD_INIT_LOG(INFO, "trying with legacy virtio pci.");
15         if (legacy_virtio_resource_init(dev, hw) < 0) {
16                 if (dev->kdrv == RTE_KDRV_UNKNOWN &&
17 -                   dev->devargs->type != RTE_DEVTYPE_WHITELISTED_PCI) {
18 +                    (!dev->devargs ||
19 +                    dev->devargs->type != RTE_DEVTYPE_WHITELISTED_PCI)) {
20                         PMD_INIT_LOG(INFO,
21                                 "skip kernel managed virtio device.");
22                         return 1;