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 EBE04A0351; Mon, 10 Jan 2022 07:38:20 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3C531411B5; Mon, 10 Jan 2022 07:38:20 +0100 (CET) Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2069.outbound.protection.outlook.com [40.107.93.69]) by mails.dpdk.org (Postfix) with ESMTP id F19E14013F; Mon, 10 Jan 2022 07:38:18 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mwUPiXjHNQw+XylJZZ028wUEzptrgTQ5B4BMqDnR61uUlUC6U0l0ZkN1zcnJFFEGhleqS5KQTHTH4NH5RQAe+38MnQPi652VpLTKl4a7B5H8ptP4eMWjuhXAyV+xocvtu0CpF+6tNGf3qXrdcvf+qEI5MdkBfMdhL6sdmtfw+f1RvqRR/BjlyTMly9Uyu3Ls4+ijo/D6MUKD6T8Km6KZth0W8P1zmLCorTYvD2gBG2lzZ/ZIU3NLndIClH3yzTIvup1xisB9iH/LJ7oMcmZCv7RTt9313imisx/WnVjKJN71kQjJpWWUbx/sSw3t/KVVruu7ckkPyIkl8dWd74ikRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=NwPhlEeNiKRjzQ7sviOYKJHcVj0DLWdy65hXI15w6P4=; b=A5E87hNLE9xq+I5SlYUC4qF24RBGF7uv7OXVTJNYPTgEbysTEMUHu2VBG4TJpeOSDKngo5AdBCXxdUGX5O6n65F/05P+LVK35cEEJI7IX4WVjtG7/Z7Ch/8ngyxRPMoD3Mka25580Ii0Q9KJNBUN8j+MqLOiHteQHoxA1gQ/ZR2/XagdkVGkPD5v341x2uDNkzERtjIPJXzO1LW6rJ+XATGU4VOh+lnFOn8J2ncTwDdlEcA/J5O6XQA8wF/KpKcNoBSrdFsQOBN5TaExtW/I3THP0R5pzbKdbjLiSDJTpyFHmGkH/+olqFfAW5M+gPRy/Z9IAZ90A1DSeM4EqvgSIg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=NwPhlEeNiKRjzQ7sviOYKJHcVj0DLWdy65hXI15w6P4=; b=cgXWt8QuM0hrC8XYX2J5X2WBuY6Qyb6fQ9YhcO13kD67hEGH6QZ6CtjzVwLh9qSGE/UHOHMUqUEsUxypJsZtQvlT5n1LRNf+DBRzmgC6UKicbewl6P6P07Q2SzL7ulyvQIrd/1rUodaa7sSOHAFu7NjuF4zYByIdze5c2H/j22I= Received: from BN8PR12MB4772.namprd12.prod.outlook.com (2603:10b6:408:73::19) by BN6PR12MB1777.namprd12.prod.outlook.com (2603:10b6:404:104::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4867.7; Mon, 10 Jan 2022 06:38:16 +0000 Received: from BN8PR12MB4772.namprd12.prod.outlook.com ([fe80::e0d8:f436:d394:6b25]) by BN8PR12MB4772.namprd12.prod.outlook.com ([fe80::e0d8:f436:d394:6b25%5]) with mapi id 15.20.4867.012; Mon, 10 Jan 2022 06:38:16 +0000 From: "Namburu, Chandu-babu" To: "dev@dpdk.org" , "david.marchand@redhat.com" , "ferruh.yigit@intel.com" CC: "Sebastian, Selwin" , "Arsalan_Awan@mentor.com" , "stable@dpdk.org" Subject: RE: [PATCH v2] net/axgbe: use PCI root complex device to distinguish AMD hardware Thread-Topic: [PATCH v2] net/axgbe: use PCI root complex device to distinguish AMD hardware Thread-Index: AQHX55c3Zccbd8+00k6EShDY4vddU6w+W9NQgB2trPA= Date: Mon, 10 Jan 2022 06:38:16 +0000 Message-ID: References: <20211126102403.13223-1-chandu@amd.com> <20211202161034.519226-1-chandu@amd.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_d4243a53-6221-4f75-8154-e4b33a5707a1_Enabled=true; MSIP_Label_d4243a53-6221-4f75-8154-e4b33a5707a1_SetDate=2021-12-22T09:23:02Z; MSIP_Label_d4243a53-6221-4f75-8154-e4b33a5707a1_Method=Privileged; MSIP_Label_d4243a53-6221-4f75-8154-e4b33a5707a1_Name=Public-AIP 2.0; MSIP_Label_d4243a53-6221-4f75-8154-e4b33a5707a1_SiteId=3dd8961f-e488-4e60-8e11-a82d994e183d; MSIP_Label_d4243a53-6221-4f75-8154-e4b33a5707a1_ActionId=ab2a6fb5-a4a9-472b-8b26-ba52a3c4e30b; MSIP_Label_d4243a53-6221-4f75-8154-e4b33a5707a1_ContentBits=1 msip_label_d4243a53-6221-4f75-8154-e4b33a5707a1_enabled: true msip_label_d4243a53-6221-4f75-8154-e4b33a5707a1_setdate: 2022-01-10T06:38:12Z msip_label_d4243a53-6221-4f75-8154-e4b33a5707a1_method: Privileged msip_label_d4243a53-6221-4f75-8154-e4b33a5707a1_name: Public-AIP 2.0 msip_label_d4243a53-6221-4f75-8154-e4b33a5707a1_siteid: 3dd8961f-e488-4e60-8e11-a82d994e183d msip_label_d4243a53-6221-4f75-8154-e4b33a5707a1_actionid: a60e2fcd-68bd-4ada-9619-6f1dbf42a917 msip_label_d4243a53-6221-4f75-8154-e4b33a5707a1_contentbits: 0 authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 6bb4cc61-9aa0-4429-a25b-08d9d403c874 x-ms-traffictypediagnostic: BN6PR12MB1777:EE_ x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:1728; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: MR/VRHg67DdXty7bCaxSqbRAmeOalWEoLnQqJBTJOJAtJmI296p3TR9uPWlu7JSEO+TeODegN5p28X21YpDyquOa7l573lgtufGnB9H3gwODLZN/dqkoSAKjUKQVuoC/ExzywgQ7qKtmbLMtcBXAe2Gaftypv/p8V0FBtqyHjX7PnNHkRY3DSAug7Qnpw5woaOHM0nX0kjciUCaU2qr/ZljKe050dW5q/a/7p+9jVaCA6PpalwUJ4euZ1O2p3F7X9hjZ3NhzLwCHz3kqDpwrhYzONjPN3sYKWqLURgKtYSG5paIfhhYHuAY6seeOqaSq4TOcFOFeiIEPxVOqHDQEFUHvF4V5z3eUY807n04X51T7dM/umS0/Gd7xnQMwyaKetajqCWHrKxFlYGdgB0OUUgGs7Mi0OkMzbzXoc3ZkfEzm+PfuCqJ3/r/Q3/+fvXgemxEUpWffTciZd0O9mb0lCnahRkGTOXrxkD/ZViEq+zOJh1aQsIfzq8B78PGlxKzIA6YNr0jtim7wo5FF6xSuWehWU+zhIwPRTNGJbh2D/WYYtu8X5JKhunZMwada9hlRTx1pnluMfjJK89XgdrfjGhTtPJI/G9wlSY/tfhx9ewCjdx6DjQ5pIIMU7YxPPpIH4CXCVVeZr6UFD9gmYIKwfoxKtgQM7AJzivyL4PAzVitzw5/hKQD/M6y8ku/dZXrqhUPhcEWd5fdsammimSlpzQ== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BN8PR12MB4772.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(71200400001)(38070700005)(508600001)(86362001)(5660300002)(83380400001)(316002)(52536014)(54906003)(6506007)(53546011)(66446008)(64756008)(66556008)(7696005)(66476007)(8676002)(8936002)(110136005)(33656002)(4326008)(122000001)(9686003)(38100700002)(2906002)(66946007)(76116006)(26005)(186003)(55016003); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?DvvDQQr7KfleohRJ0hZIg44YcEX9ICWO5Y+OOUj8yL1Ccn9RiGoDkddWVHOY?= =?us-ascii?Q?+L1fqfhU7LcN80ElXH4muK7aSTzECT4JZ1JW+s4lq0vS/eiKU8qOnr41bOiq?= =?us-ascii?Q?cuL6I7d0MXgU8u2iRsFA1Rz6uEV+vNGbwjcTnL8ofXG54bHTC1mxLGcX2P21?= =?us-ascii?Q?HGopcEneCWbPkJdJyaPyFCSSdUb1Sq8MIuUC6q7bcXkbaJpGwVtV1VmgdHUN?= =?us-ascii?Q?GLaQTLVT3BWLhBaT5Rg28YZcLCKqHF12/6cPh2XMFjC6Jdg1Y+8sQkRyja0Y?= =?us-ascii?Q?qAUP6LKgxRvU9jIgpd2gAsXTn6DveBkzI/Ja0TbIsq8XIfVBbeyQNxmMBwpP?= =?us-ascii?Q?Sk2JHvqrrCKj10BCmn2CU8gQfeJ17V6dbNLknlg7cgpEQYCyLu8cU39Ab3te?= =?us-ascii?Q?xkGfByCF7dnWFnlIQCAuvngDGUDIhn22regiW8n2tB0+VV969HLcA7CFULlC?= =?us-ascii?Q?ICuhOHqC3/FXAbTrqVEEfodcX49LZbRZlVHY1mn7SkLCVlA0l8HRGnQyYJT8?= =?us-ascii?Q?T472GoK2Xc3AJ82aeYt6w5px6zIuTOzdXfpvpkkXCAd1aIYOx8z4AM65YikU?= =?us-ascii?Q?rdk028DC34WAR9fTgriEP5wiRLtsKAM0L7nGuzrDAlTv/6AY0qLCSM1hE9rE?= =?us-ascii?Q?tQ/PBRbxxzlhYWwkVVeh2o/HhNv+mwHqanqa1oQMtPovEvd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XGfME2eyMWkTOpq54LIaDvcJq3yF5cB3hQX?= =?us-ascii?Q?/MFJMcBqDepeKwg8PktvqNg=3D?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BN8PR12MB4772.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6bb4cc61-9aa0-4429-a25b-08d9d403c874 X-MS-Exchange-CrossTenant-originalarrivaltime: 10 Jan 2022 06:38:16.1463 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 9xAflkS4PVTFeWjNx2KVwHQh2uyEqzVQPJULkjpYZqwL4EJBkRNsVC7owHzApc89s5rSE89xiryMREwGH39OUA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR12MB1777 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org [Public] Hi, Gentle reminder. This is patch is required to submit changes for new AMD products. Please re= view and let us know if any modification are required. Regards, Chandu -----Original Message----- From: Namburu, Chandu-babu=20 Sent: Wednesday, December 22, 2021 2:58 PM To: dev@dpdk.org; david.marchand@redhat.com; ferruh.yigit@intel.com Cc: Sebastian, Selwin ; Arsalan_Awan@mentor.com; = stable@dpdk.org Subject: RE: [PATCH v2] net/axgbe: use PCI root complex device to distingui= sh AMD hardware [Public] Hi David Marchand, I have submitted v2 patch with your suggestion in git log. Please review ch= anges. Regards, Chandu -----Original Message----- From: Namburu, Chandu-babu Sent: Thursday, December 2, 2021 9:41 PM To: dev@dpdk.org; david.marchand@redhat.com Cc: Sebastian, Selwin ; Arsalan_Awan@mentor.com; = ferruh.yigit@intel.com; Namburu, Chandu-babu ; stable@dpdk.= org Subject: [PATCH v2] net/axgbe: use PCI root complex device to distinguish A= MD hardware "bus/pci: optimize bus scan" broke axgbe on V1000/R1000. RV root complex pci device does not have any kernel driver assigned so it i= s 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) Cc: stable@dpdk.org Signed-off-by: Chandubabu Namburu --- 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_eth= dev.c index 7d40c18a86..7b8d94ca3c 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" =20 +#include "eal_filesystem.h" + static int eth_axgbe_dev_init(struct rte_eth_dev *eth_dev); static int a= xgbe_dev_configure(struct rte_eth_dev *dev); static int axgbe_dev_start(s= truct rte_eth_dev *dev); @@ -2117,28 +2119,27 @@ static void axgbe_default_= config(struct axgbe_port *pdata) pdata->power_down =3D 0; } =20 -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=20 +uint16_t +get_pci_rc_devid(void) { - const struct rte_pci_device *pdev =3D RTE_DEV_TO_PCI_CONST(dev); - const struct rte_pci_id *pcid =3D _pci_id; + char pci_sysfs[PATH_MAX]; + const struct rte_pci_addr pci_rc_addr =3D {0, 0, 0, 0}; + unsigned long device_id; =20 - if (pdev->id.vendor_id =3D=3D AMD_PCI_VENDOR_ID && - pdev->id.device_id =3D=3D pcid->device_id) - return 0; - return 1; -} + 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); =20 -static bool -pci_search_device(int device_id) -{ - struct rte_bus *pci_bus; - struct rte_pci_id dev_id; + /* 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; + } =20 - dev_id.device_id =3D device_id; - pci_bus =3D rte_bus_find_by_name("pci"); - return (pci_bus !=3D NULL) && - (pci_bus->find_device(NULL, pci_device_cmp, &dev_id) !=3D NULL); + return (uint16_t)device_id; } =20 /* @@ -2180,7 +2181,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()) =3D=3D AMD_PCI_RV_ROOT_COMPLEX_ID) { pdata->xpcs_window_def_reg =3D PCS_V2_RV_WINDOW_DEF; pdata->xpcs_window_sel_reg =3D PCS_V2_RV_WINDOW_SELECT; } else { -- 2.25.1