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 9FA7FA0032 for ; Fri, 18 Feb 2022 13:41:32 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9A80D40E2D; Fri, 18 Feb 2022 13:41:32 +0100 (CET) Received: from mail-wr1-f46.google.com (mail-wr1-f46.google.com [209.85.221.46]) by mails.dpdk.org (Postfix) with ESMTP id 4CF5440141 for ; Fri, 18 Feb 2022 13:41:31 +0100 (CET) Received: by mail-wr1-f46.google.com with SMTP id u1so14352067wrg.11 for ; Fri, 18 Feb 2022 04:41:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=OH6Y96uyo/9MJ5sjvWZKLq1jx1Cuv4cmBmB8NHXFWsE=; b=M2MkLAjkO1oiY4sieoDEkvwI/PLGbtGAQi7hn+Md1M/3ywbsl3vJyB1y7BsX5oWS9I SBUoaf7H8E0ZHuCbBj8MDLUAaBQWbmZcNNqCe65FmIicCtsPckyGkRDGhYPvEuFd1tlk YxdgGvjfe7k3xeyxxEwxMj/iGA1zC5beFgXwFhy+vUalOxnnwNfaafrT3xhimsPw0wPB NKhtdEzCtr4pi2gq2waF5hMr1mS1nJxrYcrtxd8QZjoORmkxBPkMZy9RQzCYwz6ebXp2 v6V2Rs/qdLDH9wQLQqv6+nJ1exQo7Xg9u0iLDZWN0+og19EnSI7j4AxmSzaLSJhFd+91 wmJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=OH6Y96uyo/9MJ5sjvWZKLq1jx1Cuv4cmBmB8NHXFWsE=; b=OArKTbSsMx9hdD9ATRAtjMseV7lZYy2YX+5u4IvnBW1FjM3oOZuGQ/tDk/ddz1NPVO 4zoX50lhhj6nyIIDRAm/xqBv4ugopFj9B83FeeFdTvpzb8D+26lA9KK3oaSgXfE5c/tV S2k2T89AlqFsN51BBzYMC5vk+zXMf7IEwyB1v3SfWWOJd7AeEvGH6NS4agze63sURhCa 1o6mXx3DAMSL1/OMGIyDocwyLyFMd9LxXmJFLR6EgE6K/XYb9nuVRfCDGiw3k2/r63f+ +tHCOhwm/5KUgrueWBAIIBhQ9oMGpzH31P2fTb4CwbEGlh96lQq9n9Ef3U0I9WDitjbA 6yfQ== X-Gm-Message-State: AOAM533kNeTFVyoPViptWpA2IJbsT2JKLTY9rZWtsHdgP+JzdIJaiYpq qUibWuWpH06fN5ZZIb4LPCV7bwsmcSDpqLp+ X-Google-Smtp-Source: ABdhPJwK8sd8oPPPsEz2tSPeyVNtiXt+weQm+RfbtVntmIFLvFJzM6sBK8jPrJFISj3ZgTcBXVKlSQ== X-Received: by 2002:a5d:6d4e:0:b0:1e3:3636:b104 with SMTP id k14-20020a5d6d4e000000b001e33636b104mr6141296wri.605.1645188091057; Fri, 18 Feb 2022 04:41:31 -0800 (PST) Received: from localhost ([2a01:4b00:f41a:3600:360b:9754:2e3a:c344]) by smtp.gmail.com with ESMTPSA id d12sm32814056wrx.47.2022.02.18.04.41.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Feb 2022 04:41:30 -0800 (PST) From: luca.boccassi@gmail.com 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 20.11.5 Date: Fri, 18 Feb 2022 12:38:06 +0000 Message-Id: <20220218123931.1749595-37-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220218123931.1749595-1-luca.boccassi@gmail.com> References: <20220218123931.1749595-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 20.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 02/20/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/bluca/dpdk-stable This queued commit can be viewed at: https://github.com/bluca/dpdk-stable/commit/a5018b1aa636999e8b7cf3c1f9e06113e7a28714 Thanks. Luca Boccassi --- >From a5018b1aa636999e8b7cf3c1f9e06113e7a28714 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 9932d725ef..6e63d7673b 100644 --- a/drivers/net/axgbe/axgbe_ethdev.c +++ b/drivers/net/axgbe/axgbe_ethdev.c @@ -10,6 +10,8 @@ #include "axgbe_regs.h" #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); static int axgbe_dev_start(struct rte_eth_dev *dev); @@ -1923,28 +1925,27 @@ static void axgbe_default_config(struct axgbe_port *pdata) pdata->power_down = 0; } -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; } /* @@ -1986,7 +1987,7 @@ 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; } else { -- 2.30.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2022-02-18 12:37:39.534177636 +0000 +++ 0037-net-axgbe-use-PCI-root-complex-device-to-distinguish.patch 2022-02-18 12:37:37.626790491 +0000 @@ -1 +1 @@ -From b0db927b5ebafac7b9aa1bacaad8d464fba7d5a6 Mon Sep 17 00:00:00 2001 +From a5018b1aa636999e8b7cf3c1f9e06113e7a28714 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit b0db927b5ebafac7b9aa1bacaad8d464fba7d5a6 ] + @@ -15 +16,0 @@ -Cc: stable@dpdk.org @@ -24 +25 @@ -index 76e12d12f0..e9546469f3 100644 +index 9932d725ef..6e63d7673b 100644 @@ -36 +37 @@ -@@ -2117,28 +2119,27 @@ static void axgbe_default_config(struct axgbe_port *pdata) +@@ -1923,28 +1925,27 @@ static void axgbe_default_config(struct axgbe_port *pdata) @@ -82 +83 @@ -@@ -2180,7 +2181,7 @@ eth_axgbe_dev_init(struct rte_eth_dev *eth_dev) +@@ -1986,7 +1987,7 @@ eth_axgbe_dev_init(struct rte_eth_dev *eth_dev)