[dpdk-stable] patch 'bus/pci: fix Windows kernel driver categories' has been queued to stable release 20.11.2

Xueming Li xuemingl at nvidia.com
Mon May 10 17:59:57 CEST 2021


Hi,

FYI, your patch has been queued to stable release 20.11.2

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/12/21. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://github.com/steevenlee/dpdk

This queued commit can be viewed at:
https://github.com/steevenlee/dpdk/commit/a7e79f5d2c09aa51a4826d583e908db3f8340eb6

Thanks.

Xueming Li <xuemingl at nvidia.com>

---
>From a7e79f5d2c09aa51a4826d583e908db3f8340eb6 Mon Sep 17 00:00:00 2001
From: Thomas Monjalon <thomas at monjalon.net>
Date: Tue, 16 Mar 2021 23:09:38 +0100
Subject: [PATCH] bus/pci: fix Windows kernel driver categories
Cc: Luca Boccassi <bluca at debian.org>

[ upstream commit 41e026c1b3fd07ee6520e3d5d4ec0787d0dac300 ]

In Windows probing, the value RTE_PCI_KDRV_NONE was used
instead of RTE_PCI_KDRV_UNKNOWN.
This value covers the mlx case where the kernel driver is in place,
offering a bifurcated mode to the userspace driver.
When the kernel driver is listed as unknown,
there is no special treatment in DPDK probing, contrary to UIO modes.

The value RTE_PCI_KDRV_NIC_UIO (FreeBSD) was re-used
instead of having a new RTE_PCI_KDRV_NET_UIO for Windows NetUIO.
While adding the new value RTE_PCI_KDRV_NET_UIO
(at the end for ABI compatibility),
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")

Signed-off-by: Thomas Monjalon <thomas at monjalon.net>
Acked-by: Dmitry Kozlyuk <dmitry.kozliuk at gmail.com>
Acked-by: Tal Shnaiderman <talshn at nvidia.com>
Acked-by: Ranjit Menon <ranjit.menon at intel.com>
---
 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..876abddefb 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,  /* may be misc UIO or bifurcated driver */
+	RTE_PCI_KDRV_IGB_UIO,      /* igb_uio for Linux */
+	RTE_PCI_KDRV_VFIO,         /* VFIO for Linux */
+	RTE_PCI_KDRV_UIO_GENERIC,  /* uio_pci_generic for Linux */
+	RTE_PCI_KDRV_NIC_UIO,      /* nic_uio for FreeBSD */
+	RTE_PCI_KDRV_NONE,         /* no attached driver */
+	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 00e7849b05..ad9d65efd8 100644
--- a/drivers/bus/pci/windows/pci.c
+++ b/drivers/bus/pci/windows/pci.c
@@ -35,7 +35,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;
@@ -204,14 +204,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:
+		/* bifurcated driver case - 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,
@@ -302,9 +302,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.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-05-10 23:59:27.919961300 +0800
+++ 0049-bus-pci-fix-Windows-kernel-driver-categories.patch	2021-05-10 23:59:26.390000000 +0800
@@ -1 +1 @@
-From 41e026c1b3fd07ee6520e3d5d4ec0787d0dac300 Mon Sep 17 00:00:00 2001
+From a7e79f5d2c09aa51a4826d583e908db3f8340eb6 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Luca Boccassi <bluca at debian.org>
+
+[ upstream commit 41e026c1b3fd07ee6520e3d5d4ec0787d0dac300 ]
@@ -21 +23,0 @@
-Cc: stable at dpdk.org
@@ -57 +59 @@
-index 8f906097f4..d39a7748b8 100644
+index 00e7849b05..ad9d65efd8 100644
@@ -60 +62 @@
-@@ -38,7 +38,7 @@ rte_pci_map_device(struct rte_pci_device *dev)
+@@ -35,7 +35,7 @@ rte_pci_map_device(struct rte_pci_device *dev)
@@ -69 +71 @@
-@@ -207,14 +207,14 @@ get_device_resource_info(HDEVINFO dev_info,
+@@ -204,14 +204,14 @@ get_device_resource_info(HDEVINFO dev_info,
@@ -88 +90 @@
-@@ -323,9 +323,9 @@ set_kernel_driver_type(PSP_DEVINFO_DATA device_info_data,
+@@ -302,9 +302,9 @@ set_kernel_driver_type(PSP_DEVINFO_DATA device_info_data,


More information about the stable mailing list