X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fplugins%2Fdpdk%2Fdevice%2Fcommon.c;h=b9ba161423bf5aa824858906ad233acb6e8353a0;hb=3901a038edf4;hp=8699dc8689b6867380584d1a8eefc4b80ff7c556;hpb=59a829533c1345945dc1b6decc3afe29494e85cd;p=vpp.git diff --git a/src/plugins/dpdk/device/common.c b/src/plugins/dpdk/device/common.c index 8699dc8689b..b9ba161423b 100644 --- a/src/plugins/dpdk/device/common.c +++ b/src/plugins/dpdk/device/common.c @@ -345,6 +345,19 @@ dpdk_port_state_callback (dpdk_portid_t port_id, return dpdk_port_state_callback_inline (port_id, type, param); } +/* If this device is PCI return pointer to info, otherwise NULL */ +struct rte_pci_device * +dpdk_get_pci_device (const struct rte_eth_dev_info *info) +{ + const struct rte_bus *bus; + + bus = rte_bus_find_by_device (info->device); + if (bus && !strcmp (bus->name, "pci")) + return RTE_DEV_TO_PCI (info->device); + else + return NULL; +} + /* * fd.io coding-style-patch-verification: ON *