[dpdk-dev,v6,14/19] net/virtio: do not reference device type
Checks
Commit Message
Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
---
drivers/net/virtio/virtio_pci.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
Comments
On Wed, Jul 05, 2017 at 01:56:44AM +0200, Gaetan Rivet wrote:
> Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
> ---
> drivers/net/virtio/virtio_pci.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/virtio/virtio_pci.c b/drivers/net/virtio/virtio_pci.c
> index b7b3d61..6275359 100644
> --- a/drivers/net/virtio/virtio_pci.c
> +++ b/drivers/net/virtio/virtio_pci.c
> @@ -38,6 +38,7 @@
> #endif
>
> #include <rte_io.h>
> +#include <rte_bus.h>
>
> #include "virtio_pci.h"
> #include "virtio_logs.h"
> @@ -684,8 +685,8 @@ vtpci_init(struct rte_pci_device *dev, struct virtio_hw *hw)
> if (rte_pci_ioport_map(dev, 0, VTPCI_IO(hw)) < 0) {
> if (dev->kdrv == RTE_KDRV_UNKNOWN &&
> (!dev->device.devargs ||
> - dev->device.devargs->type !=
> - RTE_DEVTYPE_WHITELISTED_PCI)) {
> + dev->device.devargs->bus !=
> + rte_bus_find_by_name("PCI"))) {
Ah, this is the first, won't be last error of this type.
It should be "pci" instead.
Incidentally, it could be preferable to use
rte_bus_find_by_device(&dev->device) instead.
> PMD_INIT_LOG(INFO,
> "skip kernel managed virtio device.");
> return 1;
> --
> 2.1.4
>
@@ -38,6 +38,7 @@
#endif
#include <rte_io.h>
+#include <rte_bus.h>
#include "virtio_pci.h"
#include "virtio_logs.h"
@@ -684,8 +685,8 @@ vtpci_init(struct rte_pci_device *dev, struct virtio_hw *hw)
if (rte_pci_ioport_map(dev, 0, VTPCI_IO(hw)) < 0) {
if (dev->kdrv == RTE_KDRV_UNKNOWN &&
(!dev->device.devargs ||
- dev->device.devargs->type !=
- RTE_DEVTYPE_WHITELISTED_PCI)) {
+ dev->device.devargs->bus !=
+ rte_bus_find_by_name("PCI"))) {
PMD_INIT_LOG(INFO,
"skip kernel managed virtio device.");
return 1;