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 54D4EA034F; Mon, 17 Jan 2022 06:40:53 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3AB2841143; Mon, 17 Jan 2022 06:40:53 +0100 (CET) Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2055.outbound.protection.outlook.com [40.107.93.55]) by mails.dpdk.org (Postfix) with ESMTP id 4F2B3410F7; Mon, 17 Jan 2022 06:40:51 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cpVWQ5jTHHwqywj1SYWVgm1KCAE1zt1qjUIou7KLeoyfHq3nPv29NZ88xX+1Ce/W9epY9BQggdpXxv6I8y64ZMhoQG7VqJpFXHJru3ETYNxZ2KK6iiQRtSr+w1lEFs22ddz8hOmPADJSjczTGy9vScResaxkuAxuLYQJTOB7xuvl8QrY5pwX59gdMy6jyzdKhL6d8RSvGQoE5ifOmgmn9mIap17gTJqDA3q+h7s/83TmOl5oYzcyrt1S1B5Vuth5UhHkira/0qr5bl8+XgM2WJv9RTgrvLVyqDbM4VycUxFSpb7MRQNIJyWisv+UwS1JfsW/rUpuj1CFTaIGicosUQ== 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=CJLTaVjErR3Nb5GMPo+7N2MPpU7JCZcAqqSNcFWRLBo=; b=WceDcBGxPONsy/QHDQWI3h0CRrhn5rvVl2I5f2158pXx43bPG4ZuKWi3Jr6oCe/nQ9fUOtKyiT2zMwfnhk+kWn3e93BSSXC6KJ0FnRFj577K1oQbF+C2mzChxlTOtpIUj0KxFu5g7BHCKKGUWob3jmo/7hkvqYHAOiujsQOcOc6X0XlK7XbpcLZwadseq/WQEZQbbA5uvIroFlEtTueQxFjYv49pjG+eTczpFDj4RySzxnSRdAljEPaOG3FV5VxUmHgQ/PMvhT2MUCNFAXLrOcgpOTrHrpUxTeOpuBtc0YvY5Y+0YoF/tGk0cs6YDVUnhoRbAtXeDWpfT3Rd7CN9PQ== 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=CJLTaVjErR3Nb5GMPo+7N2MPpU7JCZcAqqSNcFWRLBo=; b=0hsd0bh2q+yVKBy9S+Lks7L/rEmuM/LSzYvgLA8qv0ch3diqu4s4f/dMJk9tourG6H5JLfhEPdEMGzsMagMPQJyvuB8DYhqSCd1YmFrYCVzjThcq0oGGTMHmOPu2F8r54iTme6NtU/z2eU9zYbMkhuLhgQLsbU48yf8SsrkTwls= Received: from DM4PR12MB5055.namprd12.prod.outlook.com (2603:10b6:5:38a::5) by BL0PR12MB4690.namprd12.prod.outlook.com (2603:10b6:208:8e::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4888.10; Mon, 17 Jan 2022 05:40:46 +0000 Received: from DM4PR12MB5055.namprd12.prod.outlook.com ([fe80::48fc:e36b:cc35:a3e0]) by DM4PR12MB5055.namprd12.prod.outlook.com ([fe80::48fc:e36b:cc35:a3e0%5]) with mapi id 15.20.4888.013; Mon, 17 Jan 2022 05:40:46 +0000 From: "Sebastian, Selwin" To: "Namburu, Chandu-babu" , "dev@dpdk.org" , "david.marchand@redhat.com" , "ferruh.yigit@intel.com" CC: "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: AQHX55c3uqHVHcc7dkC60l1luVPVyaw+XR4AgB2s/wCACu/EcA== Date: Mon, 17 Jan 2022 05:40:46 +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 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: 344cfd8f-8fbc-4160-bdc9-08d9d97be927 x-ms-traffictypediagnostic: BL0PR12MB4690: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: iWTTJANNTcqaEnJJQ32iBHXPus+VL3ashK06ZPjEw0wwAJpvqlAeGGbiMP5cxB2Km/i0ndlq6c7rYamYWBRlcmLxaM9F3S+qSRoNFL/AssUcVzAOYa5lYppJon5GHvVgueYtDgzlfQ/VU0YOLPTOVdFONE398pNq2hHrxXSpjOFcYzbjw7FgznnePSYN45C9ZILfwamVOHthPLXZGVO+fayfyJD1v+8h/DcLh7I0KdCvV3F6oNQ7UKLY1h2IG7L+XP84iAK83syFtHkE8AUtD/g5uoCbfWiAW5vvfxB6AvAMgijGaj8V4IK/PHBMnsKgsswSQBaMEtUcsSAsuHsJzjfZ9J0heOhzzMGlYdr4OUSee2VN1jxND2IuPDQXXrCUxaZf+0dsC+yFLJTTKl6Sru49RKzo7nryztDW+y1QpA9uuocOhc0l13AqwrIcyaNpzoI8OX1P8F8TmdI8oDR/Jw8o5ySK8yXfgqcZ+xJMm2Bxcx3r+a0AxwPmXGC+dSWbTggyzKL78v6HcBdI6nbW0XSeXmCEXQbOgyvqeCwQy6GG9JpfcKY3yObhtWExPTpfwr0Jk3xNP5pnPt4CF8ZgvnVhr8IYQvvqRWlCwHAjvo2WqsmAq3N0DNQRWvgbhMQn0ftTFVj2ghz0uvLi8u38GZD5/b6Fl7tdBmTzr6Xq55df3P5uclY+w8ov8TOnB7RHYnOGPyFKZDqyqXZvAKp/PQ== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM4PR12MB5055.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(55016003)(64756008)(38100700002)(4326008)(5660300002)(8936002)(38070700005)(6506007)(33656002)(7696005)(53546011)(26005)(52536014)(2906002)(186003)(66556008)(110136005)(9686003)(316002)(76116006)(86362001)(66946007)(71200400001)(54906003)(8676002)(508600001)(83380400001)(122000001)(66476007)(66446008); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?8k0t3Xxw4iJ89DMLkMFwgJv8k/mZNKwKHXCU+WoEa9/HWnSakcjaPOiMxC2Q?= =?us-ascii?Q?bjqz1eyeDaRSmtcRbGFbqxad05N8nHT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2/vkWCI2pm4XhOy9skJITbdVbHafPtWX7Zmmhdn4FragaOc1v?= =?us-ascii?Q?Y61xe0VdzPtmvYNZbP2SogsoW6J4gfRXMOyRvh+w9f4Hc/ZNpOoKWtgeTbUX?= =?us-ascii?Q?V16HVpIx2gvWn3CNyKx/QSb7eB4HnO8rlWMbRyK8GXwamM1o03KF1s0pBZ09?= =?us-ascii?Q?HBo831DBq00Rwe+2X+aDgMV7oLYWX0DuSUqCMTeXaABBhzYAkvFt3lZ7OKc3?= =?us-ascii?Q?jJ9mkz74nPTd79NZZ3kwC6q+WG+o/wLZySATJaiu5+EVpjeIalcaQkMksie+?= =?us-ascii?Q?2nzplhFN8rBKhM0VgciLSgi02AJ7OqXIteEtX7OmOF8wTLqEfRYNqEp4PfCH?= =?us-ascii?Q?iXvgCSxlkfN4Iz9VMpEast01SuWV9yeuoU5GCxmw233OoP2ADlofogi27tTg?= =?us-ascii?Q?5Rz5n6pkuYe26zjzYTvp8wXbdiSjeN8p2+EQa7vZQtKkDmQpKxpnzs1enUH/?= =?us-ascii?Q?mNYhuNUh4CZLk+o1FMBZ7fA3vtFw7ctDsGwj9+iuBnvlLofHPe1KdeF4/myy?= =?us-ascii?Q?l+LhTltVYdpaqgAu6dQtwIPPiaw8IF+masYlnWFLgzhYvkoQdsfhKMRfjU0h?= =?us-ascii?Q?bc9GEFQ/QrFOzxEDfuKT2AiHu7PZJDjkfZDpxa3aMA2kiXkqUZ1axjnHxpmB?= =?us-ascii?Q?qzL1LrD1IgtuB5Il+pQH3gE=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: DM4PR12MB5055.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 344cfd8f-8fbc-4160-bdc9-08d9d97be927 X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Jan 2022 05:40:46.5067 (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: Zx1kDYnpO/3Jg/At04OBIKdp6u+YU0erVTiI9UbqEio9l9cD3GybSAp9c9YZwTm2ogaims5x1AymV7L44mryCQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL0PR12MB4690 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 Acked by: Selwin Sebastian -----Original Message----- From: Namburu, Chandu-babu =20 Sent: Monday, January 10, 2022 12:08 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, 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 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