On 6/26/2020 3:04 PM, Maxime Coquelin wrote: > This patch introduces vDPA device class. It will enable > application to iterate over the vDPA devices. > > Acked-by: Adrián Moreno <amore...@redhat.com> > Signed-off-by: Maxime Coquelin <maxime.coque...@redhat.com>
<...> > +static int > +vdpa_dev_match(struct rte_vdpa_device *dev, > + const struct rte_device *rte_dev) > +{ > + struct rte_vdpa_dev_addr addr; > + > + /* Only PCI bus supported for now */ > + if (strcmp(rte_dev->bus->name, "pci") != 0) > + return -1; > + > + addr.type = VDPA_ADDR_PCI; > + > + if (rte_pci_addr_parse(rte_dev->name, &addr.pci_addr) != 0) Overall patchset is good, but there is a build error in this patch [1] because 'rte_pci' library not linked with vhost library. Fixing it while merging [2], but since this function is removed in the next patch the changes are taken back in next patch, so the result of the patchset should be exact same, please double check. [1] /usr/bin/ld: vdpa.o: in function `vdpa_dev_iterate': vdpa.c:(.text+0x9f): undefined reference to `rte_pci_addr_parse' collect2: error: ld returned 1 exit status [2] diff --git a/lib/Makefile b/lib/Makefile index e0e5eb4d8..5c269e65c 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -47,7 +47,8 @@ DIRS-$(CONFIG_RTE_LIBRTE_RAWDEV) += librte_rawdev DEPDIRS-librte_rawdev := librte_eal librte_ethdev DIRS-$(CONFIG_RTE_LIBRTE_VHOST) += librte_vhost DEPDIRS-librte_vhost := librte_eal librte_mempool librte_mbuf librte_ethdev \ - librte_net librte_hash librte_cryptodev + librte_net librte_hash librte_cryptodev \ + librte_pci DIRS-$(CONFIG_RTE_LIBRTE_HASH) += librte_hash DEPDIRS-librte_hash := librte_eal librte_ring DIRS-$(CONFIG_RTE_LIBRTE_EFD) += librte_efd diff --git a/lib/librte_vhost/Makefile b/lib/librte_vhost/Makefile index e592795f2..7004a6307 100644 --- a/lib/librte_vhost/Makefile +++ b/lib/librte_vhost/Makefile @@ -35,6 +35,7 @@ ifeq ($(CONFIG_RTE_LIBRTE_VHOST_NUMA),y) LDLIBS += -lnuma endif LDLIBS += -lrte_eal -lrte_mempool -lrte_mbuf -lrte_ethdev -lrte_net +LDLIBS += -lrte_pci # all source are stored in SRCS-y SRCS-$(CONFIG_RTE_LIBRTE_VHOST) := fd_man.c iotlb.c socket.c vhost.c \ diff --git a/lib/librte_vhost/vdpa.c b/lib/librte_vhost/vdpa.c index a42984169..333ea12cb 100644 --- a/lib/librte_vhost/vdpa.c +++ b/lib/librte_vhost/vdpa.c @@ -12,6 +12,7 @@ #include <rte_class.h> #include <rte_malloc.h> +#include <rte_pci.h> #include "rte_vdpa.h" #include "vhost.h"