[dpdk-stable] patch 'bus/pci: compare kernel driver instead of interrupt handler' has been queued to LTS release 17.11.5

Yongseok Koh yskoh at mellanox.com
Fri Nov 30 00:11:20 CET 2018


Hi,

FYI, your patch has been queued to LTS release 17.11.5

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 12/01/18. 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. If the code is different (ie: not only metadata diffs), due for example to
a change in context or macro names, please double check it.

Thanks.

Yongseok

---
>From d49d8866f1aaa7823b6fed991309ad76e4b6d486 Mon Sep 17 00:00:00 2001
From: Alejandro Lucero <alejandro.lucero at netronome.com>
Date: Thu, 25 Oct 2018 11:49:28 +0100
Subject: [PATCH] bus/pci: compare kernel driver instead of interrupt handler

[ upstream commit 630deed612ca382f48a3ef4b65dfc74b7cd09cf9 ]

Invoking the right pci read/write functions is based on interrupt
handler type. However, this is not configured for secondary processes
precluding to use those functions.

This patch fixes the issue using the driver name the device is bound
to instead.

Fixes: 632b2d1deeed ("eal: provide functions to access PCI config")

Signed-off-by: Alejandro Lucero <alejandro.lucero at netronome.com>
Acked-by: Anatoly Burakov <anatoly.burakov at intel.com>
---
 drivers/bus/pci/linux/pci.c | 32 ++++++++++++++------------------
 1 file changed, 14 insertions(+), 18 deletions(-)

diff --git a/drivers/bus/pci/linux/pci.c b/drivers/bus/pci/linux/pci.c
index 44440f223..fc4981038 100644
--- a/drivers/bus/pci/linux/pci.c
+++ b/drivers/bus/pci/linux/pci.c
@@ -703,23 +703,21 @@ rte_pci_get_iommu_class(void)
 int rte_pci_read_config(const struct rte_pci_device *device,
 		void *buf, size_t len, off_t offset)
 {
+	char devname[RTE_DEV_NAME_MAX_LEN] = "";
 	const struct rte_intr_handle *intr_handle = &device->intr_handle;
 
-	switch (intr_handle->type) {
-	case RTE_INTR_HANDLE_UIO:
-	case RTE_INTR_HANDLE_UIO_INTX:
+	switch (device->kdrv) {
+	case RTE_KDRV_IGB_UIO:
 		return pci_uio_read_config(intr_handle, buf, len, offset);
-
 #ifdef VFIO_PRESENT
-	case RTE_INTR_HANDLE_VFIO_MSIX:
-	case RTE_INTR_HANDLE_VFIO_MSI:
-	case RTE_INTR_HANDLE_VFIO_LEGACY:
+	case RTE_KDRV_VFIO:
 		return pci_vfio_read_config(intr_handle, buf, len, offset);
 #endif
 	default:
+		rte_pci_device_name(&device->addr, devname,
+				    RTE_DEV_NAME_MAX_LEN);
 		RTE_LOG(ERR, EAL,
-			"Unknown handle type of fd %d\n",
-					intr_handle->fd);
+			"Unknown driver type for %s\n", devname);
 		return -1;
 	}
 }
@@ -728,23 +726,21 @@ int rte_pci_read_config(const struct rte_pci_device *device,
 int rte_pci_write_config(const struct rte_pci_device *device,
 		const void *buf, size_t len, off_t offset)
 {
+	char devname[RTE_DEV_NAME_MAX_LEN] = "";
 	const struct rte_intr_handle *intr_handle = &device->intr_handle;
 
-	switch (intr_handle->type) {
-	case RTE_INTR_HANDLE_UIO:
-	case RTE_INTR_HANDLE_UIO_INTX:
+	switch (device->kdrv) {
+	case RTE_KDRV_IGB_UIO:
 		return pci_uio_write_config(intr_handle, buf, len, offset);
-
 #ifdef VFIO_PRESENT
-	case RTE_INTR_HANDLE_VFIO_MSIX:
-	case RTE_INTR_HANDLE_VFIO_MSI:
-	case RTE_INTR_HANDLE_VFIO_LEGACY:
+	case RTE_KDRV_VFIO:
 		return pci_vfio_write_config(intr_handle, buf, len, offset);
 #endif
 	default:
+		rte_pci_device_name(&device->addr, devname,
+				    RTE_DEV_NAME_MAX_LEN);
 		RTE_LOG(ERR, EAL,
-			"Unknown handle type of fd %d\n",
-					intr_handle->fd);
+			"Unknown driver type for %s\n", devname);
 		return -1;
 	}
 }
-- 
2.11.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2018-11-29 15:01:49.010917062 -0800
+++ 0086-bus-pci-compare-kernel-driver-instead-of-interrupt-h.patch	2018-11-29 15:01:45.235964000 -0800
@@ -1,8 +1,10 @@
-From 630deed612ca382f48a3ef4b65dfc74b7cd09cf9 Mon Sep 17 00:00:00 2001
+From d49d8866f1aaa7823b6fed991309ad76e4b6d486 Mon Sep 17 00:00:00 2001
 From: Alejandro Lucero <alejandro.lucero at netronome.com>
 Date: Thu, 25 Oct 2018 11:49:28 +0100
 Subject: [PATCH] bus/pci: compare kernel driver instead of interrupt handler
 
+[ upstream commit 630deed612ca382f48a3ef4b65dfc74b7cd09cf9 ]
+
 Invoking the right pci read/write functions is based on interrupt
 handler type. However, this is not configured for secondary processes
 precluding to use those functions.
@@ -11,7 +13,6 @@
 to instead.
 
 Fixes: 632b2d1deeed ("eal: provide functions to access PCI config")
-Cc: stable at dpdk.org
 
 Signed-off-by: Alejandro Lucero <alejandro.lucero at netronome.com>
 Acked-by: Anatoly Burakov <anatoly.burakov at intel.com>
@@ -20,10 +21,10 @@
  1 file changed, 14 insertions(+), 18 deletions(-)
 
 diff --git a/drivers/bus/pci/linux/pci.c b/drivers/bus/pci/linux/pci.c
-index d5faa893d..45c24ef7e 100644
+index 44440f223..fc4981038 100644
 --- a/drivers/bus/pci/linux/pci.c
 +++ b/drivers/bus/pci/linux/pci.c
-@@ -674,23 +674,21 @@ rte_pci_get_iommu_class(void)
+@@ -703,23 +703,21 @@ rte_pci_get_iommu_class(void)
  int rte_pci_read_config(const struct rte_pci_device *device,
  		void *buf, size_t len, off_t offset)
  {
@@ -54,7 +55,7 @@
  		return -1;
  	}
  }
-@@ -699,23 +697,21 @@ int rte_pci_read_config(const struct rte_pci_device *device,
+@@ -728,23 +726,21 @@ int rte_pci_read_config(const struct rte_pci_device *device,
  int rte_pci_write_config(const struct rte_pci_device *device,
  		const void *buf, size_t len, off_t offset)
  {


More information about the stable mailing list