From: Pallavi Kadam Date: Wed, 10 Feb 2021 20:36:54 +0000 (-0800) Subject: bus/pci: skip probing some Windows NDIS devices X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=de04405b336ed01e234db39fc211b4592b79c2b3;p=dpdk.git bus/pci: skip probing some Windows NDIS devices Implement rte_pci_map_device() to distinguish between the devices bound to netuio and NDIS devices. Only return success for the netuio devices. Fixes: c76ec01b4591 ("bus/pci: support netuio on Windows") Cc: stable@dpdk.org Suggested-by: Dmitry Kozlyuk Signed-off-by: Pallavi Kadam Reviewed-by: Ranjit Menon Acked-by: Tal Shnaiderman Acked-by: Narcisa Vasile Tested-by: Narcisa Vasile --- diff --git a/drivers/bus/pci/windows/pci.c b/drivers/bus/pci/windows/pci.c index f662584528..00e7849b05 100644 --- a/drivers/bus/pci/windows/pci.c +++ b/drivers/bus/pci/windows/pci.c @@ -23,20 +23,22 @@ DEFINE_DEVPROPKEY(DEVPKEY_Device_Numa_Node, 0x540b947e, 0x8b40, 0x45bc, * the registry hive for PCI devices. */ -/* The functions below are not implemented on Windows, +/* Some of the functions below are not implemented on Windows, * but need to be defined for compilation purposes */ /* Map pci device */ int -rte_pci_map_device(struct rte_pci_device *dev __rte_unused) +rte_pci_map_device(struct rte_pci_device *dev) { - /* This function is not implemented on Windows. - * We really should short-circuit the call to these functions by - * clearing the RTE_PCI_DRV_NEED_MAPPING flag - * in the rte_pci_driver flags. + /* Only return success for devices bound to netuio. + * Devices that are bound to netuio are mapped at + * the bus probing stage. */ - return 0; + if (dev->kdrv == RTE_PCI_KDRV_NIC_UIO) + return 0; + else + return -1; } /* Unmap pci device */