From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by dpdk.org (Postfix) with ESMTP id 5AD831B50E for ; Fri, 30 Nov 2018 00:15:01 +0100 (CET) Received: from Internal Mail-Server by MTLPINE1 (envelope-from yskoh@mellanox.com) with ESMTPS (AES256-SHA encrypted); 30 Nov 2018 01:20:53 +0200 Received: from scfae-sc-2.mti.labs.mlnx (scfae-sc-2.mti.labs.mlnx [10.101.0.96]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id wATNCW8Q032075; Fri, 30 Nov 2018 01:14:58 +0200 From: Yongseok Koh To: Alejandro Lucero Cc: Anatoly Burakov , dpdk stable Date: Thu, 29 Nov 2018 15:11:20 -0800 Message-Id: <20181129231202.30436-86-yskoh@mellanox.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20181129231202.30436-1-yskoh@mellanox.com> References: <20181129231202.30436-1-yskoh@mellanox.com> Subject: [dpdk-stable] patch 'bus/pci: compare kernel driver instead of interrupt handler' has been queued to LTS release 17.11.5 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2018 23:15:01 -0000 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 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 Acked-by: Anatoly Burakov --- 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 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@dpdk.org Signed-off-by: Alejandro Lucero Acked-by: Anatoly Burakov @@ -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) {