From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id D45EFA034E for ; Mon, 21 Feb 2022 16:38:56 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CF37540DF6; Mon, 21 Feb 2022 16:38:56 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id D60F14013F for ; Mon, 21 Feb 2022 16:38:55 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1645457935; 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=8x6sFQttI4sgRg0/GEkA94hsfkKFJUccnLkglM4YOyY=; b=BXZtygclciMfg8w8RAHBLEvvxjFn0h+EcP9vEBSmJv0nTZ8jTz7nfXoNUTtXApaJ6F9jrW dRzRtV4ugCgQ89uZ0WENNzNmzghFDdGy67qVuA3AsTDPRq6qxWeu6KcviMWGvbm9nypyqK GvFkCjz/Qh5DPIlSWV2ht+Uk5kcGH5o= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-646-QkBMgWWNMam3o_i5HhvKrQ-1; Mon, 21 Feb 2022 10:38:51 -0500 X-MC-Unique: QkBMgWWNMam3o_i5HhvKrQ-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 764C81091DA2; Mon, 21 Feb 2022 15:38:50 +0000 (UTC) Received: from rh.Home (unknown [10.39.195.12]) by smtp.corp.redhat.com (Postfix) with ESMTP id 665C07E2EA; Mon, 21 Feb 2022 15:38:49 +0000 (UTC) From: Kevin Traynor To: Chandubabu Namburu Cc: Selwin Sebastian , dpdk stable Subject: patch 'net/axgbe: use PCI root complex device to distinguish device' has been queued to stable release 21.11.1 Date: Mon, 21 Feb 2022 15:34:18 +0000 Message-Id: <20220221153625.152324-69-ktraynor@redhat.com> In-Reply-To: <20220221153625.152324-1-ktraynor@redhat.com> References: <20220221153625.152324-1-ktraynor@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 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" X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 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 Hi, FYI, your patch has been queued to stable release 21.11.1 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 02/26/22. 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 This queued commit can be viewed at: https://github.com/kevintraynor/dpdk-stable/commit/181ddedb1a1e9d58c9f1d6283bf234b4d3d9a041 Thanks. Kevin --- >From 181ddedb1a1e9d58c9f1d6283bf234b4d3d9a041 Mon Sep 17 00:00:00 2001 From: Chandubabu Namburu Date: Thu, 2 Dec 2021 16:10:34 +0000 Subject: [PATCH] net/axgbe: use PCI root complex device to distinguish device [ upstream commit b0db927b5ebafac7b9aa1bacaad8d464fba7d5a6 ] "bus/pci: optimize bus scan" broke axgbe on V1000/R1000. RV root complex pci device does not have any kernel driver assigned so it is removed from pci scan list which is used in "net/axgbe: add a HW quirk for register definitions". Get root complex device id directly from pci sysfs instead of pci scan list. Fixes: 991e0b1dbc4a ("net/axgbe: add a HW quirk for register definitions") Signed-off-by: Chandubabu Namburu Acked-by: Selwin Sebastian --- drivers/net/axgbe/axgbe_ethdev.c | 39 ++++++++++++++++---------------- 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/drivers/net/axgbe/axgbe_ethdev.c b/drivers/net/axgbe/axgbe_ethdev.c index 76e12d12f0..e9546469f3 100644 --- a/drivers/net/axgbe/axgbe_ethdev.c +++ b/drivers/net/axgbe/axgbe_ethdev.c @@ -11,4 +11,6 @@ #include "rte_time.h" +#include "eal_filesystem.h" + static int eth_axgbe_dev_init(struct rte_eth_dev *eth_dev); static int axgbe_dev_configure(struct rte_eth_dev *dev); @@ -2118,26 +2120,25 @@ static void axgbe_default_config(struct axgbe_port *pdata) } -static int -pci_device_cmp(const struct rte_device *dev, const void *_pci_id) +/* + * Return PCI root complex device id on success else 0 + */ +static uint16_t +get_pci_rc_devid(void) { - const struct rte_pci_device *pdev = RTE_DEV_TO_PCI_CONST(dev); - const struct rte_pci_id *pcid = _pci_id; + char pci_sysfs[PATH_MAX]; + const struct rte_pci_addr pci_rc_addr = {0, 0, 0, 0}; + unsigned long device_id; - if (pdev->id.vendor_id == AMD_PCI_VENDOR_ID && - pdev->id.device_id == pcid->device_id) + snprintf(pci_sysfs, sizeof(pci_sysfs), "%s/" PCI_PRI_FMT "/device", + rte_pci_get_sysfs_path(), pci_rc_addr.domain, + pci_rc_addr.bus, pci_rc_addr.devid, pci_rc_addr.function); + + /* get device id */ + if (eal_parse_sysfs_value(pci_sysfs, &device_id) < 0) { + PMD_INIT_LOG(ERR, "Error in reading PCI sysfs\n"); return 0; - return 1; -} + } -static bool -pci_search_device(int device_id) -{ - struct rte_bus *pci_bus; - struct rte_pci_id dev_id; - - dev_id.device_id = device_id; - pci_bus = rte_bus_find_by_name("pci"); - return (pci_bus != NULL) && - (pci_bus->find_device(NULL, pci_device_cmp, &dev_id) != NULL); + return (uint16_t)device_id; } @@ -2181,5 +2182,5 @@ eth_axgbe_dev_init(struct rte_eth_dev *eth_dev) * Use root complex device ID to differentiate RV AXGBE vs SNOWY AXGBE */ - if (pci_search_device(AMD_PCI_RV_ROOT_COMPLEX_ID)) { + if ((get_pci_rc_devid()) == AMD_PCI_RV_ROOT_COMPLEX_ID) { pdata->xpcs_window_def_reg = PCS_V2_RV_WINDOW_DEF; pdata->xpcs_window_sel_reg = PCS_V2_RV_WINDOW_SELECT; -- 2.34.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2022-02-21 15:22:46.147501762 +0000 +++ 0069-net-axgbe-use-PCI-root-complex-device-to-distinguish.patch 2022-02-21 15:22:44.149704256 +0000 @@ -1 +1 @@ -From b0db927b5ebafac7b9aa1bacaad8d464fba7d5a6 Mon Sep 17 00:00:00 2001 +From 181ddedb1a1e9d58c9f1d6283bf234b4d3d9a041 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit b0db927b5ebafac7b9aa1bacaad8d464fba7d5a6 ] + @@ -15 +16,0 @@ -Cc: stable@dpdk.org