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 BEC714246D; Thu, 26 Jan 2023 09:30:07 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5ED6940697; Thu, 26 Jan 2023 09:30:07 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id 2ED30400D7 for ; Thu, 26 Jan 2023 09:30:06 +0100 (CET) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 30Q7VmJu014125; Thu, 26 Jan 2023 00:30:05 -0800 Received: from nam10-dm6-obe.outbound.protection.outlook.com (mail-dm6nam10lp2108.outbound.protection.outlook.com [104.47.58.108]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3nbn720abn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 26 Jan 2023 00:30:05 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=O710F96uf6sZ+UpG+f8bq29MZ2ONgHp8mDYY4UvFrYmksPSx2/Z7y24FzJotis+v3f8O7voBATM6FPLH/NFU8WRlBatTHIMOJR6NbU6mBuMMduwlWVMkFahhweMzXODods5jwl5zL3i6lywgkEOKTfzWbB2pm4TgeagE/gC3+wYZl1x9+O6J5HOfnt5+yaGZ1P5UA+A7Vqh5Gqz1f2xOgcwXsqyCVRSQE/eBRQHYtmHsJWVD1fhmjdZVXte+3qhpZ1wH2borhiYVyYiRSvSWmQ3DSJLGKiIX9/IYhLKVp7Px3D5+MgCcI8urUoYaRRLbWsaqTs0wbmQOiSI07eQ+FA== 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=kG4pgjf7TZQc54cyhknZ+WLTCt2M5b5ZgKEzhswNXxM=; b=cD87MP8DdiFxPctIgl7prgzOIGsEtyxRFMaIyLT+x+rwyxqTDLdN6qlIkB3QGyPB1Lt3Ld717nQhlIMecV/Vxy9l4G737Uq2h4Hm4hZKIlxCVJcFh6FuZt48ExdJ8DWFUmWFg7f0bGrA4EaL+dVOpizp47hbq2zjobCadwS8aoae89dnRFUIEdKM9xfmTgSFbIZWlj2wP/Pb4FKdvS/vubH+wPzMqKSKD9MBrYavsqQCMu8Yb9Lh/yvluATWrJB2il2ZxGx81JG92VhI/jxFv4L2GFE3G5gmXdF38CgirG/I9+Eus+JCxso66D7XY/Mwj/Y4f/yWtCisx6kYQSix9A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=marvell.com; dmarc=pass action=none header.from=marvell.com; dkim=pass header.d=marvell.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.onmicrosoft.com; s=selector1-marvell-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=kG4pgjf7TZQc54cyhknZ+WLTCt2M5b5ZgKEzhswNXxM=; b=jkh+3qiQrsNG/0TawefLOkXhKefYNfCuLGbWXklBQuEyXf4o7Ch8hZ+teomPro+mkMfd7D3C5WZzBEfggkGevpqXvQYs7DnDxOO0AhwKEbjNpMjwxiXB4X9gQP/lmO/60tXtppVZx5/elbI9nfkNtZzu25vweXQpxdXZGgPDvDE= Received: from DM4PR18MB4368.namprd18.prod.outlook.com (2603:10b6:5:39d::6) by SA1PR18MB4551.namprd18.prod.outlook.com (2603:10b6:806:1e2::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.22; Thu, 26 Jan 2023 08:30:01 +0000 Received: from DM4PR18MB4368.namprd18.prod.outlook.com ([fe80::3117:f51c:37c2:fa05]) by DM4PR18MB4368.namprd18.prod.outlook.com ([fe80::3117:f51c:37c2:fa05%9]) with mapi id 15.20.6043.021; Thu, 26 Jan 2023 08:30:01 +0000 From: Tomasz Duszynski To: Tyler Retzlaff , Thomas Monjalon CC: "dev@dpdk.org" , Jerin Jacob Kollanukkaran , "stephen@networkplumber.org" , "chenbo.xia@intel.com" , "david.marchand@redhat.com" , "bruce.richardson@intel.com" Subject: RE: [EXT] Re: [PATCH 1/2] lib: add helper to read strings from sysfs files Thread-Topic: [EXT] Re: [PATCH 1/2] lib: add helper to read strings from sysfs files Thread-Index: AQHZMKh3Sk3R3bTHMEOe9a9tMB63m66u8UsAgABeCwCAAQOf0A== Date: Thu, 26 Jan 2023 08:30:01 +0000 Message-ID: References: <20230110234642.1188550-1-tduszynski@marvell.com> <20230125103311.1249988-1-tduszynski@marvell.com> <20230125103311.1249988-2-tduszynski@marvell.com> <73101748.RN2Pgac3cq@thomas> <20230125161606.GA7184@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> In-Reply-To: <20230125161606.GA7184@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: DM4PR18MB4368:EE_|SA1PR18MB4551:EE_ x-ms-office365-filtering-correlation-id: e91cb27b-7edf-438e-65eb-08daff77844b x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: MtsVrXw7zWYWUbFljQOe29sz4xMt0R+oNMYEpYhHYr6L6xU1TCHlUutsrZwpx1EaNyVcbxKMoLQIEKWc/4nRERajeR4GUc3Hx1CkEw3v0Gp0f/Ydh/S5+gXtLMjPZ6YbMH32oG3tY9RknaXe951ab7jfyLBR8WxAJnKUfxmM+kCQ2qDVem0xjEfRHgL287Umm8GDsN6/N/KynakETcxAXjY9gBOiYbKY0ly0GoN4GfNAJE0Ao8Dm/G0Qb0x2GN7hPnxootpiw6rb5biA8MZczNWuzZfTHqiFlBJqijhalvQ0fr2VTpK29vMqi2VVFqOGIIVo4Tk5q6RuEnvnIwQseEYhcpIJUYae17vW7yI4iv9FCQZ0bqBIo2BDsyXLpEBprcLbPi1XeusHuAs/XUp1dfbutceNiOK673z8GRowcHHK70UNE0VEo4+VzXi33arD85Qifm1C99Yd9oMNs24tYLaox7LlelObYy/ovU04ZT8unJttJ/iTY48qpIFOVbvQV8iFth+OTHe3+LZEfFDLvyJD3IMQ9rDyTvVKMy065W1t4Y3fuw84U7bwc3sqE8FQT/+nm0iwRpRu8JN2Z4qu0tDP0p0Ff19H/+JMm8dIWWslE8Ilkt976e0TIDaP4/zg7EGVQaVb9uM1vWW4aLhS7seq4JR4GjR08mSqNoY28Xv1cuznJA2ECRtLA678HmCt x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM4PR18MB4368.namprd18.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230025)(4636009)(396003)(136003)(39860400002)(376002)(346002)(366004)(451199018)(478600001)(7696005)(186003)(26005)(9686003)(66899018)(71200400001)(83380400001)(110136005)(316002)(54906003)(41300700001)(8676002)(38100700002)(122000001)(6506007)(86362001)(33656002)(5660300002)(52536014)(38070700005)(8936002)(76116006)(66946007)(4326008)(66476007)(66556008)(64756008)(66446008)(2906002)(55016003); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?RrvGAXhArEKBDrfl7FpEDRORNgTwHOFGmMcXWYvAdK6bfxI9jTAth2vZLlzd?= =?us-ascii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75hMArA+ygJCFjheBty9oD4mn/yf66b8?= =?us-ascii?Q?vXB4x/2ne7CqSfUmHqnyiH/KLaFt4HlBtakz3nRCo7ZLBZhLPvH/wBjjFh5Q?= =?us-ascii?Q?CvFjLz9lCQx5geaJdzqttJyVUo0kNxaoEPkNiCFjsSpqrpUuTaP98hTf1nUV?= =?us-ascii?Q?4yxVM1FV56MferAOGmUnn0ZjGB5K1VBkyxnBfTCYpzZNZIeVercdSRDXZ/z7?= =?us-ascii?Q?4JR4GQ7xChsEllR8+K59iDGPkv3C1VkmLhJ5yUcVZnj2qShhb99pPRt3xG+s?= =?us-ascii?Q?sg9wjACsg6+aO+J2dilMUYXZb0EPpaecXLr9zVGnDHpxrxM6NDWQl47Vvzlw?= =?us-ascii?Q?YSxy3qENM+xBJBXqka8BUibrvOXebHBVuef7ciRqdVcgqRhPeXVLG2ILcMfQ?= =?us-ascii?Q?vsnH+vIVir8DvyZ9obv9kXWfFTi9Fq05eFyPdATZPwWa/AQYP2PBAdGTxUFy?= =?us-ascii?Q?ms8NMW5K5nSNEZ00otB+8lywVOaccLjWKDXA+LvdypX5M87a/Ba5HugCcpX4?= =?us-ascii?Q?TtRzZnZdA1ZdIc4JC7g9O4GcYsr4NsQizTYTrMfrOYnyVZ8va6su3Pt0lCo/?= =?us-ascii?Q?ojJz/J0oIICPqpnTG7WCx5Wvqf25twYzL4aX+jiiZeWh4cnV3drF0HANJq8J?= =?us-ascii?Q?5qFIneJkHm9GmfiTYuKvKjEiqswYjDJdA/r5OIcN?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: marvell.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM4PR18MB4368.namprd18.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: e91cb27b-7edf-438e-65eb-08daff77844b X-MS-Exchange-CrossTenant-originalarrivaltime: 26 Jan 2023 08:30:01.1915 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 70e1fb47-1155-421d-87fc-2e58f638b6e0 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: clqv63YtHsC+vt2z7qdcqRMIqfpOXamwe1aE3jGZ9fY0ixkPD9qmSg1kAblZR9Wr355VWgA7853t2H81hMOxUg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR18MB4551 X-Proofpoint-GUID: Y5EdB46rymWN8U9cr9uReqcf0B1-mQwI X-Proofpoint-ORIG-GUID: Y5EdB46rymWN8U9cr9uReqcf0B1-mQwI X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.930,Hydra:6.0.562,FMLib:17.11.122.1 definitions=2023-01-26_02,2023-01-25_01,2022-06-22_01 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 >-----Original Message----- >From: Tyler Retzlaff >Sent: Wednesday, January 25, 2023 5:16 PM >To: Thomas Monjalon >Cc: Tomasz Duszynski ; dev@dpdk.org; Jerin Jacob K= ollanukkaran >; stephen@networkplumber.org; chenbo.xia@intel.com; da= vid.marchand@redhat.com; >bruce.richardson@intel.com >Subject: [EXT] Re: [PATCH 1/2] lib: add helper to read strings from sysfs = files > >External Email > >---------------------------------------------------------------------- >On Wed, Jan 25, 2023 at 11:39:30AM +0100, Thomas Monjalon wrote: >> 25/01/2023 11:33, Tomasz Duszynski: >> > Reading strings from sysfs files is a re-occurring pattern hence add >> > helper for doing that. >> >> In general it would be to nice to clean sysfs parsing in libs and >> drivers, so they all use some functions from EAL. > >maybe there should be a general utility library for dealing with sysfs sep= arate from the core EAL >that drivers / platform specific libs can share? reading/writing of sysfs files is scattered around the codebase and this ha= s been piling up with each and and every new pmd/lib that requires it. So generally a few si= mple utility functions=20 in one place may be a good idea.=20 Would following make sense? rte_sysfs_write_int() rte_sysfs_write_string() rte_sysfs_read_int() rte_sysfs_read_string()=20 Also seems that pattern where file gets opened once and keeps being written= to until closed is=20 reoccurring as well. So there might be some utils for that as well. Thought= s?=20