From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-f66.google.com (mail-wm1-f66.google.com [209.85.128.66]) by dpdk.org (Postfix) with ESMTP id 83CB24C8C for ; Thu, 8 Nov 2018 19:01:44 +0100 (CET) Received: by mail-wm1-f66.google.com with SMTP id p2-v6so2058355wmc.2 for ; Thu, 08 Nov 2018 10:01:44 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=0deAv3v00Qbt1pYJ03/ChtMVASuhzEmwfPG0LtFYhdI=; b=CuNkaz84Dd0kDGRvIfD/1T7f5yJS0H9PcA4CeFwLw8DC5ITc/flYEHKulcaAXSkCji vG+2QnbuChpMfyx2qPM5OyR9WtuYjazxm18ytgJb8r7recoLXK7U0+rl2SoqRWc7HLKw 0jiFYsmzY71nVv/GsHdakp3CTOsZZF3KJDbIeXChy9bGyKysicTfN/lm9GDwdlAPTeVf pkt4IaMRyAQbBR7AUhaS6reADxFkjAj5BsE4wYhYXWuk59lk9hOeXkZwAEkWU9LcH5Rk vq61ChKsCyX4jpP0DiMPkxpvCaoVh43YyKC2Rm0UsCAm88srbrEDSb2bGAD+O4AJRrBk knPw== X-Gm-Message-State: AGRZ1gIlFvwOoFugBObaAKak2YDuonoeXXe1dfdE3zroVsWeqfCTHJE4 rYs8SDjdOUafH8Q8/ZO9x9vquYs8 X-Google-Smtp-Source: AJdET5euLRjANZ6ivW7gmXAkf+IlQV1DgJQ5SqJY05wYgteMQ5k+AVDv7gmAMJnURPJjQpz1ZCmzsA== X-Received: by 2002:a1c:bc82:: with SMTP id m124-v6mr2163718wmf.47.1541700104070; Thu, 08 Nov 2018 10:01:44 -0800 (PST) Received: from localhost ([2a01:4b00:f419:6f00:8361:8946:ba2b:d556]) by smtp.gmail.com with ESMTPSA id v62-v6sm2749058wme.3.2018.11.08.10.01.43 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 08 Nov 2018 10:01:43 -0800 (PST) From: Luca Boccassi To: Alejandro Lucero Cc: Anatoly Burakov , dpdk stable Date: Thu, 8 Nov 2018 18:01:07 +0000 Message-Id: <20181108180111.25873-11-bluca@debian.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181108180111.25873-1-bluca@debian.org> References: <20181029125329.17729-20-bluca@debian.org> <20181108180111.25873-1-bluca@debian.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'bus/pci: compare kernel driver instead of interrupt handler' has been queued to LTS release 16.11.9 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, 08 Nov 2018 18:01:44 -0000 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 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 --- 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 #include +#include #include #include #include @@ -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 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@dpdk.org Signed-off-by: Alejandro Lucero Acked-by: Anatoly Burakov --- - 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 + #include ++#include + #include + #include + #include +@@ -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);