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 38B9E43255; Tue, 31 Oct 2023 18:37:35 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DE89E402ED; Tue, 31 Oct 2023 18:37:34 +0100 (CET) Received: from NAM04-DM6-obe.outbound.protection.outlook.com (mail-dm6nam04on2054.outbound.protection.outlook.com [40.107.102.54]) by mails.dpdk.org (Postfix) with ESMTP id E56134029E for ; Tue, 31 Oct 2023 18:37:33 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bYH5qmzVy/qbZliPh5OJhNNDqRAt+VyTVil51LMGj+xekezrSWHfbTj7zIk9hJbICn7+Uttsb0nfVO7PhdTSsF5qq1qNUSC6BxS2rjPfdY5cIdsXEXScLc+bHqu8dLOBG5dBcOJmfgW6n9rRvZsMn5NfL1HijEFEkxX25CwFt23XQCNj+tZdNNCXGjNBWmdlJ5pXpN2M42EmymkanWZgTXTBOd8SdpskSh12s1cfWFCe57DSL08fl81LINCzC6RKnUp2hmNH7jpm+A0SN3eDGfvljaTEfxNWOyouY/bYUa5s7f4hUI32ujU9UARb5ZzH3mo0itZ560xy1tx3Go6WHQ== 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=N9ftwTY0KvI1QxhZJTN0dD9RWxrYgU0BoZp81JPZ/+E=; b=WiJ6El7pTTO5C16wANUq5J/pSImb9IPkMkLhZOdnaYGqqciq3XILfHpzyr1glQljlVt0cV7OeN+Me97jYDA9xe2zDr+5iefKQ9dZGKc60DTUKkd9v0TKkfMXbK9ij8lRmUBaBihswqk3irNQtRRKLAK3u5UQbKqApJBskumCR8qVJaMHnnA4kFnT9yhyPQcQSs8N2xJjz6m/tZOP7ESIQg1Q8anGbcteftiCeSQESPsAZZw9W4a0p6eaaO4xkz8NwTLzJ+WBGVg4X3IxxXrPmhXUBVkkvXC3ijeztOibZmqZPMGVeUHCD+aX9X0AP+JKQ2lZNyY/74doIZzbGs/HDw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=N9ftwTY0KvI1QxhZJTN0dD9RWxrYgU0BoZp81JPZ/+E=; b=T5E0SwHjBbgpwKVgrIOIcQvrisSUU+eFIyY32caUtvUxZGoS5gtfC2SbXZSKHzI9GAVdtRiwf2/e0Nu96E7TtU+O+ABGwCg6RcPO/xqiwarPW0ymDmRODhdY57TmFTBCgFAKtpPYSQcQ5lIWEAvVRmz500bGKDPqMbyzrDUPCvb7h7cU2SqKHJkjDjVzXfl4kyqwifwK2SbCjvVswmAkJPMTyWaYIw6VMDFCpx0nksHC5VOsf23ty1eVOuqvRI5hVrRmJhR4UuhWyF5ufj7aL/dFSicrIHMHKXXACdFSJmQpXR/zQTCAHBSrjYAl5OKyoAGRgF4pA6gxpj5B32KDqQ== Received: from IA1PR12MB8311.namprd12.prod.outlook.com (2603:10b6:208:3fa::12) by MN6PR12MB8566.namprd12.prod.outlook.com (2603:10b6:208:47c::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6933.28; Tue, 31 Oct 2023 17:37:31 +0000 Received: from IA1PR12MB8311.namprd12.prod.outlook.com ([fe80::1131:5ccb:c3f2:b0c6]) by IA1PR12MB8311.namprd12.prod.outlook.com ([fe80::1131:5ccb:c3f2:b0c6%2]) with mapi id 15.20.6933.029; Tue, 31 Oct 2023 17:37:31 +0000 From: Dariusz Sosnowski To: Stephen Hemminger CC: Matan Azrad , Slava Ovsiienko , Ori Kam , Suanming Mou , "dev@dpdk.org" , Raslan Darawsheh Subject: RE: [PATCH 4/8] net/mlx5: add sysfs check for Multiport E-Switch Thread-Topic: [PATCH 4/8] net/mlx5: add sysfs check for Multiport E-Switch Thread-Index: AQHaDAaA4ys2WpTT7Uu+8B6UzqSpc7BkEReAgAANyWA= Date: Tue, 31 Oct 2023 17:37:31 +0000 Message-ID: References: <20231031142733.2009166-1-dsosnowski@nvidia.com> <20231031142733.2009166-5-dsosnowski@nvidia.com> <20231031090905.7cf14956@fedora> In-Reply-To: <20231031090905.7cf14956@fedora> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: IA1PR12MB8311:EE_|MN6PR12MB8566:EE_ x-ms-office365-filtering-correlation-id: 66eecd34-c792-44a6-5388-08dbda380f7e x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: P3pFbYpXPGaOEKTLmVMwWZndG6YrI9Zq3W8v3t7ZHTLlomjOFnge1lHOr2gioofAJYv7zAGZmo1iTMuE8Q3zFd/OIBeenqgfNJ1S6mFyFKcbpvW+vpn7xPETC7nhsulc7khxQZ45lCkZjnY0KPLC++RA2uO5Fij964GwBLapY+eXmdJn9joowEcET9GdF0w8tvmVANRUOKuzLGj1yW8uAMvX3zJkGaEiRQqp9sJwglCmAXOIXU8k0Kw2OPs10JF9xeloxe4VPAojDI/OIlOwvswIa/N6/nTREweYA05vBi2nStiXLpC3QLvd8KEls3pAD/k/iUiYJPVp5OlWHdXUgbGyrQs7BUNH/k9BceD2HmGEK/krrd++MM3dy95eweAMh1QeGCcMQbakHC6Fs9pnTeWNwd3QtnEYMu90QPDgFqbi+EtxbNyuPVOPdjLrtChOJkZf9bHatxn0JUdFaam5bd97P9HCevjNBQD0Gy/R4A5NwXBPyvW5f+2PT6T9UQacLJGHMwuvTYoS0JQ0qtfwqBjui0hrXPpFIf1MAbzscEbWJ2Yn0M+KowOHnODjkkZ/PwfZc/fF/SYWkMtODalRnO12NrtcOZsyq1BeyiJHpAc9d99a7IvRMhm+ivc1mAW04kD9sdUX64PHUl2i6HdcfLzV51J4+TTvwdFv/x938C4= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:IA1PR12MB8311.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(39860400002)(366004)(376002)(136003)(346002)(396003)(230922051799003)(230173577357003)(230273577357003)(451199024)(1800799009)(64100799003)(186009)(107886003)(6506007)(83380400001)(26005)(2906002)(38100700002)(71200400001)(5660300002)(66946007)(54906003)(66476007)(66446008)(6916009)(64756008)(76116006)(316002)(66556008)(52536014)(8676002)(8936002)(4326008)(53546011)(7696005)(9686003)(41300700001)(478600001)(122000001)(86362001)(33656002)(38070700009)(55016003); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?ufRvDtUtnvD7ixv8S1W2Z8JDt/Kj2ZeGPIN9y+JMCZ/pVxVpOuVUcPXBPXAw?= =?us-ascii?Q?y2wXloXk1mxc+lJHkZRbTS2LINGrDzTtZ6XoN6pwkyPlH9mor4V90Qunfpzb?= =?us-ascii?Q?ENs/8Iq5Cmm3pgI1hnJhOql5k7cUNjzgBfoVGksyQ6MMNBzEH56Hr7rImUZ+?= =?us-ascii?Q?imgNMWYXKincofqDeUyGFQxCEfN+yx8eKOmT77YWa9AGUGLioDEqVc1s7L45?= =?us-ascii?Q?Iho0HruutgJLBeD7xGhTZ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vYxgnZceszJw2pnY5tOo1zBEyToYUqbEFj1iobBs1OlHjwKT+6c6ouT?= =?us-ascii?Q?hovFSfFxNOQRGaaK8Me2LifKJpeo0pXvpaV9kBOooShVtjEuaYpzOa6l00iG?= =?us-ascii?Q?/mPV1wSWPW26eg146n/oCYrQpKg6hwHtZKGqT2auXryDanEK3wqGrhitMnLV?= =?us-ascii?Q?TlmWHTDfOIaTJN+3cl4BNf6NktywE0aA875wrsE1mG547wHJTZYoz2P+h6PS?= =?us-ascii?Q?JFWj3LZsTjJ+t6m2l7ElJTV14YDqv1Jq2cwS42zv816bbqF+VSnCVUw6Um/6?= =?us-ascii?Q?RkMJPcf1TowOqFPzOHNv3YZWRchCGxNIXBAfaqJE5v0giSoCs6gBE1rQ7Gdh?= =?us-ascii?Q?8bsRC5YQh6/rWYDQwoivaprDBIzF9xMtUVBNEAl0PgQ5LVQix6irEzBzGHpU?= =?us-ascii?Q?+N5pRXG8u72cdqqajHsTAPbsp5lJ07c9eIEZx85j?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: IA1PR12MB8311.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 66eecd34-c792-44a6-5388-08dbda380f7e X-MS-Exchange-CrossTenant-originalarrivaltime: 31 Oct 2023 17:37:31.5666 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: U2wnyzoYcLhKVZXRJCx2IEE1m4XtyAFQOjxQsW2WKlNwjt2axa8snAk0kynDhQ1vDbkZyqkNDGJhDRj6mzmMSw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN6PR12MB8566 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 Hi Stephen, Thank you for your comment. > -----Original Message----- > From: Stephen Hemminger > Sent: Tuesday, October 31, 2023 17:09 > To: Dariusz Sosnowski > Cc: Matan Azrad ; Slava Ovsiienko > ; Ori Kam ; Suanming Mou > ; dev@dpdk.org; Raslan Darawsheh > > Subject: Re: [PATCH 4/8] net/mlx5: add sysfs check for Multiport E-Switch >=20 > External email: Use caution opening links or attachments >=20 >=20 > On Tue, 31 Oct 2023 16:27:29 +0200 > Dariusz Sosnowski wrote: >=20 > > + MKSTR(sysfs_if_path, "/sys/class/net/%s", ifname); > > + if (mlx5_get_pci_addr(sysfs_if_path, &if_pci_addr)) > > + continue; > > + if (pci_addr->domain !=3D if_pci_addr.domain || > > + pci_addr->bus !=3D if_pci_addr.bus || > > + pci_addr->devid !=3D if_pci_addr.devid || > > + pci_addr->function !=3D if_pci_addr.function) > > + continue; > > + MKSTR(sysfs_mpesw_path, > > + > > + "/sys/class/net/%s/compat/devlink/lag_port_select_mode", ifname); >=20 > There are lots of DPDK code that reads sysfs, but eal and each driver end= s up > coding there own way of handling this. Would be good to have common > helpers in EAL. Agreed. >From a quick glance, I see that there are a few sysfs paths with which seve= ral drivers interact with e.g.: - /sys/class/net - /sys/bus/pci/devices - /sys/devices I think that, introducing common sysfs utilities (for example, some way of = interacting with such common paths or just constructing sysfs paths) in DPD= K could be beneficial. We definitely can look into it, to see if it is viable. Best regards, Dariusz Sosnowski