[dpdk-stable] [dpdk-dev] [PATCH] bus/pci: fix Windows kernel driver categories

Slava Ovsiienko viacheslavo at nvidia.com
Thu Mar 18 09:36:35 CET 2021


Hi, Thomas

> -----Original Message-----
> From: dev <dev-bounces at dpdk.org> On Behalf Of Thomas Monjalon
> Sent: Wednesday, March 17, 2021 1:12
> To: dev at dpdk.org
> Cc: dmitry.kozliuk at gmail.com; stable at dpdk.org; Tal Shnaiderman
> <talshn at nvidia.com>; Narcisa Vasile <navasile at linux.microsoft.com>; Ranjit
> Menon <ranjit.menon at intel.com>; John Alexander
> <john.alexander at datapath.co.uk>; Pallavi Kadam
> <pallavi.kadam at intel.com>
> Subject: [dpdk-dev] [PATCH] bus/pci: fix Windows kernel driver categories
> 
> In Windows probing, the value RTE_PCI_KDRV_NONE was used instead of
> RTE_PCI_KDRV_UNKNOWN (mlx case), and RTE_PCI_KDRV_NIC_UIO
> (FreeBSD) was re-used instead of having a new RTE_PCI_KDRV_NET_UIO for
> Windows NetUIO.

As far as I understand - under Windows there is always some kernel driver
backing the device, hence, RTE_PCI_KDRV_NONE is not an option and
RTE_PCI_KDRV_UNKNOWN is more appropriate. I would add this extra
explanation in commit message.

With best regards,
Slava
> 
> While adding the new value RTE_PCI_KDRV_NET_UIO, the enum of kernel
> driver categories is annotated.
> 
> Fixes: b762221ac24f ("bus/pci: support Windows with bifurcated drivers")
> Fixes: c76ec01b4591 ("bus/pci: support netuio on Windows")
> Cc: stable at dpdk.org
> 
> Signed-off-by: Thomas Monjalon <thomas at monjalon.net>
> ---
>  drivers/bus/pci/rte_bus_pci.h | 13 +++++++------
> drivers/bus/pci/windows/pci.c | 14 +++++++-------
>  2 files changed, 14 insertions(+), 13 deletions(-)
> 
> diff --git a/drivers/bus/pci/rte_bus_pci.h b/drivers/bus/pci/rte_bus_pci.h
> index fdda046515..3d009cc74b 100644
> --- a/drivers/bus/pci/rte_bus_pci.h
> +++ b/drivers/bus/pci/rte_bus_pci.h
> @@ -52,12 +52,13 @@ TAILQ_HEAD(rte_pci_driver_list, rte_pci_driver);
> struct rte_devargs;
> 
>  enum rte_pci_kernel_driver {
> -	RTE_PCI_KDRV_UNKNOWN = 0,
> -	RTE_PCI_KDRV_IGB_UIO,
> -	RTE_PCI_KDRV_VFIO,
> -	RTE_PCI_KDRV_UIO_GENERIC,
> -	RTE_PCI_KDRV_NIC_UIO,
> -	RTE_PCI_KDRV_NONE,
> +	RTE_PCI_KDRV_UNKNOWN = 0,  /* not listed - may be a bifurcated
> driver */
> +	RTE_PCI_KDRV_IGB_UIO,      /* igb_uio for Linux */
> +	RTE_PCI_KDRV_VFIO,         /* VFIO for Linux */
> +	RTE_PCI_KDRV_UIO_GENERIC,  /* uio_generic for Linux */
> +	RTE_PCI_KDRV_NIC_UIO,      /* nic_uio for FreeBSD */
> +	RTE_PCI_KDRV_NONE,         /* error */
> +	RTE_PCI_KDRV_NET_UIO,      /* NetUIO for Windows */
>  };
> 
>  /**
> diff --git a/drivers/bus/pci/windows/pci.c b/drivers/bus/pci/windows/pci.c
> index 8f906097f4..3f0ce1fb83 100644
> --- a/drivers/bus/pci/windows/pci.c
> +++ b/drivers/bus/pci/windows/pci.c
> @@ -38,7 +38,7 @@ rte_pci_map_device(struct rte_pci_device *dev)
>  	 * Devices that are bound to netuio are mapped at
>  	 * the bus probing stage.
>  	 */
> -	if (dev->kdrv == RTE_PCI_KDRV_NIC_UIO)
> +	if (dev->kdrv == RTE_PCI_KDRV_NET_UIO)
>  		return 0;
>  	else
>  		return -1;
> @@ -207,14 +207,14 @@ get_device_resource_info(HDEVINFO dev_info,
>  	int ret;
> 
>  	switch (dev->kdrv) {
> -	case RTE_PCI_KDRV_NONE:
> -		/* mem_resource - Unneeded for RTE_PCI_KDRV_NONE */
> +	case RTE_PCI_KDRV_UNKNOWN:
> +		/* mem_resource is unneeded */
>  		dev->mem_resource[0].phys_addr = 0;
>  		dev->mem_resource[0].len = 0;
>  		dev->mem_resource[0].addr = NULL;
>  		break;
> -	case RTE_PCI_KDRV_NIC_UIO:
> -		/* get device info from netuio kernel driver */
> +	case RTE_PCI_KDRV_NET_UIO:
> +		/* get device info from NetUIO kernel driver */
>  		ret = get_netuio_device_info(dev_info, dev_info_data,
> dev);
>  		if (ret != 0) {
>  			RTE_LOG(DEBUG, EAL,
> @@ -323,9 +323,9 @@ set_kernel_driver_type(PSP_DEVINFO_DATA
> device_info_data,  {
>  	/* set kernel driver type based on device class */
>  	if (IsEqualGUID(&(device_info_data->ClassGuid),
> &GUID_DEVCLASS_NETUIO))
> -		dev->kdrv = RTE_PCI_KDRV_NIC_UIO;
> +		dev->kdrv = RTE_PCI_KDRV_NET_UIO;
>  	else
> -		dev->kdrv = RTE_PCI_KDRV_NONE;
> +		dev->kdrv = RTE_PCI_KDRV_UNKNOWN;
>  }
> 
>  static int
> --
> 2.30.1



More information about the stable mailing list