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 2C841A04DD for ; Wed, 18 Nov 2020 17:38:03 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 8995BC966; Wed, 18 Nov 2020 17:37:34 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by dpdk.org (Postfix) with ESMTP id 5A26AC954 for ; Wed, 18 Nov 2020 17:37:32 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1605717450; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=KqsdAhGjDBGEY3F5zoMBksiSL1xVu2y2HcFW1DE3NOI=; b=hxlFqjyZWA6tE8T1H+99amHLGFoXrYRnHYTLVKbvGpsSJlsQtaZjiVJmKtAC92D83JAp5l uQg+cWBe4CJO76e6g7c51GhL+IN2VAhEdViRTKNznKEfCfsRiQFDUnl7wRxk6XE42/HpKe d9Ql2OCGaraBx9G6oRNgA61pwjHPo5A= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-86-e0ExiP6nPoWahIYMAyuz0g-1; Wed, 18 Nov 2020 11:37:27 -0500 X-MC-Unique: e0ExiP6nPoWahIYMAyuz0g-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C56A910509DA; Wed, 18 Nov 2020 16:37:18 +0000 (UTC) Received: from rh.redhat.com (ovpn-113-249.ams2.redhat.com [10.36.113.249]) by smtp.corp.redhat.com (Postfix) with ESMTP id 75F9F5C1A3; Wed, 18 Nov 2020 16:37:17 +0000 (UTC) From: Kevin Traynor To: Thomas Monjalon Cc: David Marchand , dpdk stable Date: Wed, 18 Nov 2020 16:35:23 +0000 Message-Id: <20201118163558.1101823-37-ktraynor@redhat.com> In-Reply-To: <20201118163558.1101823-1-ktraynor@redhat.com> References: <20201118163558.1101823-1-ktraynor@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=ktraynor@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" Subject: [dpdk-stable] patch 'bus/pci: remove unused scan by address' has been queued to LTS release 18.11.11 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 LTS release 18.11.11 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/24/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. Queued patches are on a temporary branch at: https://github.com/kevintraynor/dpdk-stable-queue This queued commit can be viewed at: https://github.com/kevintraynor/dpdk-stable-queue/commit/f453331f4b544a76f58d27dce07baf6b78a00ce3 Thanks. Kevin. --- >From f453331f4b544a76f58d27dce07baf6b78a00ce3 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 d09f8ee5a6..b760a4428d 100644 --- a/drivers/bus/pci/bsd/pci.c +++ b/drivers/bus/pci/bsd/pci.c @@ -387,53 +387,4 @@ rte_pci_get_iommu_class(void) } -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, diff --git a/drivers/bus/pci/linux/pci.c b/drivers/bus/pci/linux/pci.c index 280e779155..b447661a65 100644 --- a/drivers/bus/pci/linux/pci.c +++ b/drivers/bus/pci/linux/pci.c @@ -396,16 +396,4 @@ pci_scan_one(const char *dirname, const struct rte_pci_addr *addr) } -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 9e1baf3efd..f79eb63554 100644 --- a/drivers/bus/pci/private.h +++ b/drivers/bus/pci/private.h @@ -56,17 +56,4 @@ 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.26.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2020-11-18 16:33:38.640356387 +0000 +++ 0037-bus-pci-remove-unused-scan-by-address.patch 2020-11-18 16:33:37.937215067 +0000 @@ -1 +1 @@ -From 59440fbabfbcfae350e0efa6f47201b5cf0bd625 Mon Sep 17 00:00:00 2001 +From f453331f4b544a76f58d27dce07baf6b78a00ce3 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 59440fbabfbcfae350e0efa6f47201b5cf0bd625 ] + @@ -12 +13,0 @@ -Cc: stable@dpdk.org @@ -17,5 +18,4 @@ - 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(-) @@ -24 +24 @@ -index 97c611737a..4b8a208781 100644 +index d09f8ee5a6..b760a4428d 100644 @@ -27 +27 @@ -@@ -402,53 +402,4 @@ pci_device_iova_mode(const struct rte_pci_driver *pdrv __rte_unused, +@@ -387,53 +387,4 @@ rte_pci_get_iommu_class(void) @@ -82 +82 @@ -index 619d209ad2..2e1808b902 100644 +index 280e779155..b447661a65 100644 @@ -85 +85 @@ -@@ -398,16 +398,4 @@ pci_scan_one(const char *dirname, const struct rte_pci_addr *addr) +@@ -396,16 +396,4 @@ pci_scan_one(const char *dirname, const struct rte_pci_addr *addr) @@ -103 +103 @@ -index 16f997c701..f566943f5e 100644 +index 9e1baf3efd..f79eb63554 100644 @@ -106 +106 @@ -@@ -67,17 +67,4 @@ void rte_pci_insert_device(struct rte_pci_device *exist_pci_dev, +@@ -56,17 +56,4 @@ void rte_pci_insert_device(struct rte_pci_device *exist_pci_dev, @@ -123,21 +123 @@ - * 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 -@@ -50,15 +50,4 @@ 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 + * Map the PCI resource of a PCI device in virtual memory