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

Luca Boccassi bluca at debian.org
Thu Nov 8 19:01:07 CET 2018


Hi,

FYI, your patch has been queued to LTS release 16.11.9

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 11/10/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.

Luca Boccassi

---
>From 0df09603d47c1e38140b747baa8b712e70f5df51 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>
---
 lib/librte_eal/linuxapp/eal/eal_pci.c | 33 ++++++++++++---------------
 1 file changed, 15 insertions(+), 18 deletions(-)

diff --git a/lib/librte_eal/linuxapp/eal/eal_pci.c b/lib/librte_eal/linuxapp/eal/eal_pci.c
index 02ec24150..85c7b3139 100644
--- a/lib/librte_eal/linuxapp/eal/eal_pci.c
+++ b/lib/librte_eal/linuxapp/eal/eal_pci.c
@@ -36,6 +36,7 @@
 
 #include <rte_log.h>
 #include <rte_pci.h>
+#include <rte_ethdev.h>
 #include <rte_eal_memconfig.h>
 #include <rte_malloc.h>
 #include <rte_devargs.h>
@@ -526,23 +527,21 @@ error:
 int rte_eal_pci_read_config(const struct rte_pci_device *device,
 			    void *buf, size_t len, off_t offset)
 {
+	char devname[RTE_ETH_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_eal_pci_device_name(&device->addr, devname,
+				    RTE_ETH_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;
 	}
 }
@@ -551,23 +550,21 @@ int rte_eal_pci_read_config(const struct rte_pci_device *device,
 int rte_eal_pci_write_config(const struct rte_pci_device *device,
 			     const void *buf, size_t len, off_t offset)
 {
+	char devname[RTE_ETH_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_eal_pci_device_name(&device->addr, devname,
+				    RTE_ETH_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.19.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2018-11-08 17:59:30.267313264 +0000
+++ 0011-bus-pci-compare-kernel-driver-instead-of-interrupt-h.patch	2018-11-08 17:59:30.060751011 +0000
@@ -1,8 +1,10 @@
-From 630deed612ca382f48a3ef4b65dfc74b7cd09cf9 Mon Sep 17 00:00:00 2001
+From 0df09603d47c1e38140b747baa8b712e70f5df51 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,23 +13,30 @@
 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>
 ---
- drivers/bus/pci/linux/pci.c | 32 ++++++++++++++------------------
- 1 file changed, 14 insertions(+), 18 deletions(-)
+ lib/librte_eal/linuxapp/eal/eal_pci.c | 33 ++++++++++++---------------
+ 1 file changed, 15 insertions(+), 18 deletions(-)
 
-diff --git a/drivers/bus/pci/linux/pci.c b/drivers/bus/pci/linux/pci.c
-index d5faa893d..45c24ef7e 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)
- int rte_pci_read_config(const struct rte_pci_device *device,
- 		void *buf, size_t len, off_t offset)
+diff --git a/lib/librte_eal/linuxapp/eal/eal_pci.c b/lib/librte_eal/linuxapp/eal/eal_pci.c
+index 02ec24150..85c7b3139 100644
+--- a/lib/librte_eal/linuxapp/eal/eal_pci.c
++++ b/lib/librte_eal/linuxapp/eal/eal_pci.c
+@@ -36,6 +36,7 @@
+ 
+ #include <rte_log.h>
+ #include <rte_pci.h>
++#include <rte_ethdev.h>
+ #include <rte_eal_memconfig.h>
+ #include <rte_malloc.h>
+ #include <rte_devargs.h>
+@@ -526,23 +527,21 @@ error:
+ int rte_eal_pci_read_config(const struct rte_pci_device *device,
+ 			    void *buf, size_t len, off_t offset)
  {
-+	char devname[RTE_DEV_NAME_MAX_LEN] = "";
++	char devname[RTE_ETH_NAME_MAX_LEN] = "";
  	const struct rte_intr_handle *intr_handle = &device->intr_handle;
  
 -	switch (intr_handle->type) {
@@ -45,8 +54,8 @@
  		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_eal_pci_device_name(&device->addr, devname,
++				    RTE_ETH_NAME_MAX_LEN);
  		RTE_LOG(ERR, EAL,
 -			"Unknown handle type of fd %d\n",
 -					intr_handle->fd);
@@ -54,11 +63,11 @@
  		return -1;
  	}
  }
-@@ -699,23 +697,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)
+@@ -551,23 +550,21 @@ int rte_eal_pci_read_config(const struct rte_pci_device *device,
+ int rte_eal_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] = "";
++	char devname[RTE_ETH_NAME_MAX_LEN] = "";
  	const struct rte_intr_handle *intr_handle = &device->intr_handle;
  
 -	switch (intr_handle->type) {
@@ -76,8 +85,8 @@
  		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_eal_pci_device_name(&device->addr, devname,
++				    RTE_ETH_NAME_MAX_LEN);
  		RTE_LOG(ERR, EAL,
 -			"Unknown handle type of fd %d\n",
 -					intr_handle->fd);


More information about the stable mailing list