[dpdk-users] using a KNI with vdevs

Cody Doucette doucette at bu.edu
Mon Oct 1 22:53:20 CEST 2018


Hi,

I'm trying to open a KNI using a virtual device (AF_PACKET), but am stuck
on trying to find something that's analogous to the PCI information for the
virtual device. I am using something like the code from the KNI example
application:

                        if (dev_info.device)
                                bus =
rte_bus_find_by_device(dev_info.device);
                        if (bus && !strcmp(bus->name, "pci")) {
                                pci_dev = RTE_DEV_TO_PCI(dev_info.device);
                                conf.addr = pci_dev->addr;
                                conf.id = pci_dev->id;
                        }

                        ...
                        kni = rte_kni_alloc(pktmbuf_pool, &conf, &ops);

But rte_bus_find_by_device() returns NULL and the program crashes when
calling rte_kni_alloc() because conf.addr is never set.

Is there a way to use a KNI with a vdev?

Cody


More information about the users mailing list