From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 1DBC4A04DD for ; Wed, 28 Oct 2020 11:57:00 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 18A9FCB38; Wed, 28 Oct 2020 11:56:58 +0100 (CET) Received: from mail-wr1-f66.google.com (mail-wr1-f66.google.com [209.85.221.66]) by dpdk.org (Postfix) with ESMTP id 24D9ECAE0 for ; Wed, 28 Oct 2020 11:56:57 +0100 (CET) Received: by mail-wr1-f66.google.com with SMTP id n18so5181990wrs.5 for ; Wed, 28 Oct 2020 03:56:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=NmxhNtgrwaSTqNXXK8mnF8k4RSKWByZ0zOnSDQiQbl8=; b=TxUlfPTFsRUTIveY6Sshm+IWlgYehQUSf/NNE9206EQ8P6Ui/Y3Utf56N7mq3jspOf oJUOUwg+3MlpooTxfKcuU3weGVXD46/Om5BfQrXLH6cZO9beZpO8nAx1pQlEDIrc3/SW A0cs/J3TcIrIVVs6RQrh1VWmKMAZ0qlekimJc8AxNyNd9ZwWZAJK2fA3dxOd9Ro2nZXY aT7sWkeZXDlUKYuuod/ex/oYjngOMSubwK0OYcSwDCw3UtMFeFN/ljyinVaAl3uPD7Fd qnhvoPNcoqYJXKP3jeZKAIyq+48nw/RxNLiN9EwEuEGJGv4Lkx+objm9OqBt38BU3Bil geqQ== 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=NmxhNtgrwaSTqNXXK8mnF8k4RSKWByZ0zOnSDQiQbl8=; b=LVaxA2/71JLhD4WO2u0u83hMOZGuHlSFVpRTAw9Nm8pPyN26XbTpXXLfSfgDNSjpk5 TCR0i5sFap4twvGMTlTHwBSKbbxmxd5YJD877s6Xpibrgh2FPVO9ul1NHTFYO7q3eS29 uwmSmsNgNKf+IshhuseD6F6sefOBraWAgwKHh/RNEivI3iwT0dmcpqGY+z+Lai4bqIUZ /yd+5PgYrd7hraVFM8RPHozpdX5HMD+1l9aZ4NmBjMePtd35766uIXPg9JZeb/6TQL6B mTCzG8Ca6hsXdLg/btCVgMCqPGFEx90Vp30HrvYrFE3YcZnZ/iace+ADUOzDhf82mAEt QPWQ== X-Gm-Message-State: AOAM530IJ250IYiwlDmk7nEnVu+4krp4o1ShUg0jd3lggcdhjo2HLlHD SeoI4vssMPRNFTape6+fVOhmtKT1U44Ivzic X-Google-Smtp-Source: ABdhPJyAs/HD2tQxbDYte+VECVsQS6x6Coa3s0a5DMXYk22dzyW0oUIG3PwxxFPQPS7gYDwKt7X+Yw== X-Received: by 2002:adf:e643:: with SMTP id b3mr8078083wrn.408.1603882615799; Wed, 28 Oct 2020 03:56:55 -0700 (PDT) Received: from localhost ([88.98.246.218]) by smtp.gmail.com with ESMTPSA id r18sm4032396wrj.50.2020.10.28.03.56.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Oct 2020 03:56:55 -0700 (PDT) From: luca.boccassi@gmail.com To: Thomas Monjalon Cc: David Marchand , dpdk stable Date: Wed, 28 Oct 2020 10:46:03 +0000 Message-Id: <20201028104606.3504127-204-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20201028104606.3504127-1-luca.boccassi@gmail.com> References: <20201028104606.3504127-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'bus/pci: remove unused scan by address' has been queued to stable release 19.11.6 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: , Errors-To: stable-bounces@dpdk.org Sender: "stable" Hi, FYI, your patch has been queued to stable release 19.11.6 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 10/30/20. 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. Thanks. Luca Boccassi --- >From edd51184ee9d3971e676f1095ec0642803d442fb Mon Sep 17 00:00:00 2001 From: Thomas Monjalon Date: Wed, 14 Oct 2020 22:18:13 +0200 Subject: [PATCH] bus/pci: remove unused scan by address [ upstream commit 59440fbabfbcfae350e0efa6f47201b5cf0bd625 ] The function pci_update_device was used to scan a device for probing by PCI address. This private function (and implementations) are unused since such probing is removed. Fixes: f3bac43b60da ("bus/pci: remove unused function to probe by address") Signed-off-by: Thomas Monjalon Acked-by: David Marchand --- drivers/bus/pci/bsd/pci.c | 49 ------------------------------------- drivers/bus/pci/linux/pci.c | 12 --------- drivers/bus/pci/private.h | 13 ---------- 3 files changed, 74 deletions(-) diff --git a/drivers/bus/pci/bsd/pci.c b/drivers/bus/pci/bsd/pci.c index ebbfeb13a8..081c62ab06 100644 --- a/drivers/bus/pci/bsd/pci.c +++ b/drivers/bus/pci/bsd/pci.c @@ -392,55 +392,6 @@ pci_device_iova_mode(const struct rte_pci_driver *pdrv __rte_unused, return RTE_IOVA_PA; } -int -pci_update_device(const struct rte_pci_addr *addr) -{ - int fd; - struct pci_conf matches[2]; - struct pci_match_conf match = { - .pc_sel = { - .pc_domain = addr->domain, - .pc_bus = addr->bus, - .pc_dev = addr->devid, - .pc_func = addr->function, - }, - }; - struct pci_conf_io conf_io = { - .pat_buf_len = 0, - .num_patterns = 1, - .patterns = &match, - .match_buf_len = sizeof(matches), - .matches = &matches[0], - }; - - fd = open("/dev/pci", O_RDONLY); - if (fd < 0) { - RTE_LOG(ERR, EAL, "%s(): error opening /dev/pci\n", __func__); - goto error; - } - - if (ioctl(fd, PCIOCGETCONF, &conf_io) < 0) { - RTE_LOG(ERR, EAL, "%s(): error with ioctl on /dev/pci: %s\n", - __func__, strerror(errno)); - goto error; - } - - if (conf_io.num_matches != 1) - goto error; - - if (pci_scan_one(fd, &matches[0]) < 0) - goto error; - - close(fd); - - return 0; - -error: - if (fd >= 0) - close(fd); - return -1; -} - /* Read PCI config space. */ int rte_pci_read_config(const struct rte_pci_device *dev, void *buf, size_t len, off_t offset) diff --git a/drivers/bus/pci/linux/pci.c b/drivers/bus/pci/linux/pci.c index 71b0a3053d..dba87f1275 100644 --- a/drivers/bus/pci/linux/pci.c +++ b/drivers/bus/pci/linux/pci.c @@ -394,18 +394,6 @@ pci_scan_one(const char *dirname, const struct rte_pci_addr *addr) return 0; } -int -pci_update_device(const struct rte_pci_addr *addr) -{ - char filename[PATH_MAX]; - - snprintf(filename, sizeof(filename), "%s/" PCI_PRI_FMT, - rte_pci_get_sysfs_path(), addr->domain, addr->bus, addr->devid, - addr->function); - - return pci_scan_one(filename, addr); -} - /* * split up a pci address into its constituent parts. */ diff --git a/drivers/bus/pci/private.h b/drivers/bus/pci/private.h index 9d14769a7e..81735e4c0a 100644 --- a/drivers/bus/pci/private.h +++ b/drivers/bus/pci/private.h @@ -55,19 +55,6 @@ void rte_pci_add_device(struct rte_pci_device *pci_dev); void rte_pci_insert_device(struct rte_pci_device *exist_pci_dev, struct rte_pci_device *new_pci_dev); -/** - * Update a pci device object by asking the kernel for the latest information. - * - * This function is private to EAL. - * - * @param addr - * The PCI Bus-Device-Function address to look for - * @return - * - 0 on success. - * - negative on error. - */ -int pci_update_device(const struct rte_pci_addr *addr); - /** * Map the PCI resource of a PCI device in virtual memory * -- 2.20.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2020-10-28 10:35:18.003825377 +0000 +++ 0204-bus-pci-remove-unused-scan-by-address.patch 2020-10-28 10:35:11.812834558 +0000 @@ -1,30 +1,30 @@ -From 59440fbabfbcfae350e0efa6f47201b5cf0bd625 Mon Sep 17 00:00:00 2001 +From edd51184ee9d3971e676f1095ec0642803d442fb Mon Sep 17 00:00:00 2001 From: Thomas Monjalon Date: Wed, 14 Oct 2020 22:18:13 +0200 Subject: [PATCH] bus/pci: remove unused scan by address +[ upstream commit 59440fbabfbcfae350e0efa6f47201b5cf0bd625 ] + The function pci_update_device was used to scan a device for probing by PCI address. This private function (and implementations) are unused since such probing is removed. Fixes: f3bac43b60da ("bus/pci: remove unused function to probe by address") -Cc: stable@dpdk.org Signed-off-by: Thomas Monjalon Acked-by: David Marchand --- - drivers/bus/pci/bsd/pci.c | 49 ----------------------------------- - drivers/bus/pci/linux/pci.c | 12 --------- - drivers/bus/pci/private.h | 13 ---------- - drivers/bus/pci/windows/pci.c | 11 -------- - 4 files changed, 85 deletions(-) + drivers/bus/pci/bsd/pci.c | 49 ------------------------------------- + drivers/bus/pci/linux/pci.c | 12 --------- + drivers/bus/pci/private.h | 13 ---------- + 3 files changed, 74 deletions(-) diff --git a/drivers/bus/pci/bsd/pci.c b/drivers/bus/pci/bsd/pci.c -index 97c611737a..4b8a208781 100644 +index ebbfeb13a8..081c62ab06 100644 --- a/drivers/bus/pci/bsd/pci.c +++ b/drivers/bus/pci/bsd/pci.c -@@ -401,55 +401,6 @@ pci_device_iova_mode(const struct rte_pci_driver *pdrv __rte_unused, +@@ -392,55 +392,6 @@ pci_device_iova_mode(const struct rte_pci_driver *pdrv __rte_unused, return RTE_IOVA_PA; } @@ -81,10 +81,10 @@ int rte_pci_read_config(const struct rte_pci_device *dev, void *buf, size_t len, off_t offset) diff --git a/drivers/bus/pci/linux/pci.c b/drivers/bus/pci/linux/pci.c -index 619d209ad2..2e1808b902 100644 +index 71b0a3053d..dba87f1275 100644 --- a/drivers/bus/pci/linux/pci.c +++ b/drivers/bus/pci/linux/pci.c -@@ -397,18 +397,6 @@ pci_scan_one(const char *dirname, const struct rte_pci_addr *addr) +@@ -394,18 +394,6 @@ pci_scan_one(const char *dirname, const struct rte_pci_addr *addr) return 0; } @@ -104,10 +104,10 @@ * split up a pci address into its constituent parts. */ diff --git a/drivers/bus/pci/private.h b/drivers/bus/pci/private.h -index 16f997c701..f566943f5e 100644 +index 9d14769a7e..81735e4c0a 100644 --- a/drivers/bus/pci/private.h +++ b/drivers/bus/pci/private.h -@@ -66,19 +66,6 @@ void rte_pci_add_device(struct rte_pci_device *pci_dev); +@@ -55,19 +55,6 @@ void rte_pci_add_device(struct rte_pci_device *pci_dev); void rte_pci_insert_device(struct rte_pci_device *exist_pci_dev, struct rte_pci_device *new_pci_dev); @@ -125,30 +125,8 @@ -int pci_update_device(const struct rte_pci_addr *addr); - /** - * A structure describing a PCI mapping. - */ -diff --git a/drivers/bus/pci/windows/pci.c b/drivers/bus/pci/windows/pci.c -index 10bb0e9cf1..b450346bdc 100644 ---- a/drivers/bus/pci/windows/pci.c -+++ b/drivers/bus/pci/windows/pci.c -@@ -49,17 +49,6 @@ rte_pci_unmap_device(struct rte_pci_device *dev __rte_unused) - */ - } - --int --pci_update_device(const struct rte_pci_addr *addr __rte_unused) --{ -- /* This function is not implemented on Windows. -- * We really should short-circuit the call to these functions by -- * clearing the RTE_PCI_DRV_NEED_MAPPING flag -- * in the rte_pci_driver flags. -- */ -- return 0; --} -- - /* Read PCI config space. */ - int - rte_pci_read_config(const struct rte_pci_device *dev __rte_unused, + * Map the PCI resource of a PCI device in virtual memory + * -- 2.20.1