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 3C224A0C41; Thu, 2 Dec 2021 06:53:21 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 155C2406FF; Thu, 2 Dec 2021 06:53:21 +0100 (CET) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2063.outbound.protection.outlook.com [40.107.237.63]) by mails.dpdk.org (Postfix) with ESMTP id 4EDD140692 for ; Thu, 2 Dec 2021 06:53:19 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Ou72HWivcqq4dQZfKvi/zEY4qeIGnjDgol4H6KbOOdRcCA9jc3oHtOGyjmSYtZUkQRzkh3R8gJ20bPgJWvXnZAObL03K42pWqgZoEVYZvROZJJtumoXzLQvMHsk6uo9PWIy6axEsQalawEa7BBHZkbJ6MvxKXPDs5uNeE3lj/LQWhpl4QWpQh6abJzNuczCVsOM9TgJo4rD3yfLnoIDBAbK0Wa7oPSoIFriEF/ppSuJ4BtxMjknNuG5il6W6t/ZbP93Br8vU5aDtB7zWSBlz1WVJmAQQ/gtDYMdTFX2Z5i97Uy6vBKiPQopS+oGc/uZzP7MwvyGM4emz6JqYaBqYcw== 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=ReKTsR403nzjHfdFKTZb6xFpTQqu3T2SwIkg2xYynTM=; b=oa0A05KYOcwlXDsWNLrRV4P4LrRK2XF78hP1KH+0xlG6EUnoeW9VNsz89N1KuhSEE/aUXOHd7JcttPAOvRDaSFhPhaa5cuA8cdnbN/imWXhdQupkEQoRITYjGGHLvCmEr8+nQRXMTAIE0KEKq43TQIEKZnV0fT9jpG2LZnIYfsnG+H1E9dva0XkgSJ1NZxUuzksZAY3JoREsqorFLX5eoifaqN7mtEWJStf7ItVmk18+zvmeaXOykb+Y4HYz0+piBs5H88nVmu6HPfH5D7YHckiNFsOIQG6Qeh5G7MfXpU9hTEN2JTNgnBRKfQSuHpTNamid2n0ZL1fvbmYkVm4MUg== 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=ReKTsR403nzjHfdFKTZb6xFpTQqu3T2SwIkg2xYynTM=; b=D8jorkN3qPmjAryupn6pVXbWIYWgNRgWdsS4KrPAQ5CZdTHSCyRPu79+QxZ4HgopnPCpzSN/JZ8Do/LrKl25XqFhOqPuujlqhuZh0qGWHIwTXyK7NlZHx1OOhjMME09rT3a8YGAb+9qdf69tGMPhW22AZVnxyDEW5BS0AwgP4I4= Received: from DM4PR12MB5344.namprd12.prod.outlook.com (2603:10b6:5:39f::11) by DM4PR12MB5136.namprd12.prod.outlook.com (2603:10b6:5:393::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4734.24; Thu, 2 Dec 2021 05:53:17 +0000 Received: from DM4PR12MB5344.namprd12.prod.outlook.com ([fe80::a003:6e33:8c98:790f]) by DM4PR12MB5344.namprd12.prod.outlook.com ([fe80::a003:6e33:8c98:790f%4]) with mapi id 15.20.4734.024; Thu, 2 Dec 2021 05:53:17 +0000 From: "Namburu, Chandu-babu" To: David Marchand CC: dev , "Sebastian, Selwin" , "Arsalan_Awan@mentor.com" , "Yigit, Ferruh" Subject: RE: [PATCH v1] net/axgbe: use PCI root complex device to distinguish AMD hardware Thread-Topic: [PATCH v1] net/axgbe: use PCI root complex device to distinguish AMD hardware Thread-Index: AQHX4q/MAZfGbPWvBUOSonOldPOw5qwdXn6AgAFdo+A= Date: Thu, 2 Dec 2021 05:53:17 +0000 Message-ID: References: <20211126102403.13223-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-02T05:53: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=bef6c1ad-7fe5-4f54-8c75-28d8c2cd5453; 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: 2021-12-02T05:53:16Z 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: 61c26c41-2f8d-4823-905d-323201537a50 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: af9892a3-f4eb-4ef2-e27a-08d9b55809fe x-ms-traffictypediagnostic: DM4PR12MB5136: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:2399; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 1zAp4+paU4Aiu0dnqahwSuW7bJM/iW7VSQwbJlfdCaYfdeFT0LddFFisi4MXzhPAuwTYxLZNOYsYvcd/uGk/+syvNxIrmIwQKIcxUdpNUYcG8s6tR4cuuMibKIjSfx7L7xdeqe4cYpCZ4v4URsBBzKotA+H9zorF2pjVak8IEvWyDi49yaCrMhyZmrI+BTpnygbEmBrqKrAYIbysS9qpNM5wuzEabn8o33rtPU3YYXlsoojP4MTXk1IloNv3nu7d+wtiLlXmi/V+svZSl70ja3OC3yFNqnzHOYER1qErqv2noeFGifmkMme9QXYbwlFlkJxUsxRuT6WNLGDvvBOiMIxFpSK6MJLcC0R+dj+3T2qTdcH1jcbbpTuGi/83tnnFm1HMho+hS3LSL4aFCeWRI+YD92KrQ8CYW52ikqyyORBnt0Vsrn1BidXirz7811n/8fDJnaX1PrO7x/n+eFRs3vDLfZYPzx5wgbZrYVzD3kOcD1eOTlbEyz7mnGr+WH0cYhy+rA+RA6yTT3xpOcDAAkfOrc15xYuIbYvXkEJj+DPaudS9RHUysnjd7H+idnqVVRdjF3MXi8WZ1RWfXSk2PWQAUG5jZBpkNUg9mPK47WbqaDBvYbWQhTDOpJ8MMXZoGMwL+VO+MaV6M8kv6ZLhXkvxxGz1O4iByaoh1z37Rx6H5NjwApZGneB22Bu8xVkK6HyM3QM+AMbv1w0cpAcKUPjXhJrxhdeEbaLWOjxBFnOSheg6oUXzpE4qoobxe2+cXMC9raee5N5LHwVm0He336E9OLrfQYIDkrH1PmWjiq4= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM4PR12MB5344.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(76116006)(8676002)(66556008)(122000001)(38100700002)(2906002)(316002)(66946007)(7696005)(8936002)(186003)(508600001)(86362001)(83380400001)(9686003)(6916009)(45080400002)(6506007)(26005)(53546011)(54906003)(52536014)(38070700005)(66446008)(55016003)(64756008)(71200400001)(966005)(4326008)(66476007)(33656002)(5660300002); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?fWwPiCECeQKk6yDvWQhTvF0bWxk//gV4NAEL+AYaJvIKCH4GDFRmG0kbM6CT?= =?us-ascii?Q?T4lPxY2skfb8nZicsKtez5CJKjiIxx7IwyWdSL/44pA18PGFg8iMVgLA3PfO?= =?us-ascii?Q?Zqyrgfsa/8fdUhDLJr8iNMJ8Wjps08YciCIpLdqOIELCApsEpolyI6SdQ8n7?= =?us-ascii?Q?NfwIM9W8ulUA8ZgV6ZnoS8i5cTe9UZ0ZgXuqvRk2M9ePfvSfgXuGj1f1w2ME?= =?us-ascii?Q?KFPVbYMGjO2SjKJRPYw4Cn6itTDXygaRPkQZ5sr4uGvxxmOQyZ9c7aVpif0B?= =?us-ascii?Q?BcM1QyTTMvXW1R3uGa4qUYslr08nCwahlM1eMnQIjeFNr8b18R++8Ljh2Byb?= =?us-ascii?Q?oHNymvBC86qSzC9hnmOo29mf1xSN0WUG/4Sy4dQie6u516i9C5XEQEHFGKY8?= =?us-ascii?Q?jxa8D8xrJSlckzGcLJJ6aKKsJpv446/qFoTik1r02yggu+HoXtMVCifQKvoq?= =?us-ascii?Q?kBID7amjSodAL26uaepJ2LW/ph3d6vlZ3gqeP/JMKZwqWFWJNiupOhumONKY?= =?us-ascii?Q?OusIRA2CWzwQrhHyHTRQ2+tgBOYukmfwBOf7JFZgoVAQElZ4kBBMr/ZrnhuE?= =?us-ascii?Q?xU2aQO+XAZaKX4rDTeNr4rgafCDT8DfKeynbHQIIyycdjEzfGS7PLoRgnane?= =?us-ascii?Q?p3gjSU7KhmSNb+k06yv421+T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q?S2tEJJKMZdW/ivh8cVNZ8ELtO+4/ofvbUFYnpncMIPqxjVguBsg14Qhg0Bv4?= =?us-ascii?Q?mw=3D=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: DM4PR12MB5344.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: af9892a3-f4eb-4ef2-e27a-08d9b55809fe X-MS-Exchange-CrossTenant-originalarrivaltime: 02 Dec 2021 05:53:17.7879 (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: YprhPsKi5NJDK6wbspEERMALZNs6l9UltJas3PHIl36AIoNn69OfCCgjMZolZVV0zdj5kU4T5RWcOMi2MTwhFw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB5136 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 David Marchand, Thank you for your comments. Will change patch and submit v2 for review Regards, Chandu -----Original Message----- From: David Marchand =20 Sent: Wednesday, December 1, 2021 2:31 PM To: Namburu, Chandu-babu Cc: dev ; Sebastian, Selwin ; Arsal= an_Awan@mentor.com; Yigit, Ferruh Subject: Re: [PATCH v1] net/axgbe: use PCI root complex device to distingui= sh AMD hardware On Fri, Nov 26, 2021 at 11:24 AM Chandubabu Namburu wrote: > > "bus/pci: optimize bus scan" broke axgbe on V1000/R1000. > RV root complex pci device does not have any kernel driver assigned so=20 > 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=20 > list Please end the sentences with a '.'. As you described, this change is a fix. Please add a Fixes: tag and Cc: stable@dpdk.org in the commitlog if you thi= nk it should be backported to LTS releases. https://nam11.safelinks.protection.outlook.com/?url=3Dhttps%3A%2F%2Fdoc.dpd= k.org%2Fguides%2Fcontributing%2Fpatches.html%23patch-for-stable-releases&am= p;data=3D04%7C01%7Cchandu%40amd.com%7C6618c303ecb146be0b5908d9b4a91c01%7C3d= d8961fe4884e608e11a82d994e183d%7C0%7C0%7C637739460691977618%7CUnknown%7CTWF= pbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D= %7C3000&sdata=3DpiC1U%2BPcPP2A0xwM3%2FA5qDUFXNLAj2SrLBywTFc3DFM%3D&= reserved=3D0 > > Signed-off-by: Chandubabu Namburu > --- > drivers/net/axgbe/axgbe_ethdev.c | 39=20 > ++++++++++++++++---------------- > 1 file changed, 20 insertions(+), 19 deletions(-) > > diff --git a/drivers/net/axgbe/axgbe_ethdev.c=20 > b/drivers/net/axgbe/axgbe_ethdev.c > index 9cd056d04a..26babde354 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=20 > int axgbe_dev_configure(struct rte_eth_dev *dev); static int =20 > axgbe_dev_start(struct rte_eth_dev *dev); @@ -1923,28 +1925,27 @@=20 > static void axgbe_default_config(struct axgbe_port *pdata) > pdata->power_down =3D 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=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; > > - 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,=20 > + pci_rc_addr.function); The use of rte_pci_get_sysfs_path() and in general is ugly because it only = works for Linux. We could come up with a better API in the pci bus, but I don't think it is = worth it atm. We can live with your implementation since this driver is only compiled on = Linux. -- David Marchand