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 6900D44088; Tue, 21 May 2024 14:43:53 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id EBC01402BA; Tue, 21 May 2024 14:43:52 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.18]) by mails.dpdk.org (Postfix) with ESMTP id 91CA64028B for ; Tue, 21 May 2024 14:43:51 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1716295432; x=1747831432; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=O2C2ttL/A185x6QuQ/B25hchtPQfC0os8qZEjxkgrzw=; b=ZlwWNtt1P4iK4Sq+UpHXbsHNpVOhh3vsKQal0HUWVwsW/gvtAMcpvh+I BlghcrE1Gcn2J1gNTG5crE0mLaPvz+qiNLJT0n9knR8y1tk6xUGn2XIvO pBLxjJaEvlxqwWAoI8RmfC1811uXe3vKtU5JQXRL6XXzDUg37laWhkWKT G4ISprCx7C7tphcM1hJ7kqMH3+Y0INuy/2SeFFg1BOsZGH5sJMxO6tQKZ 09YqVBnT9ivmNq3D4pl0wsyW/pRgeW7NSIILmdnjxjktcQbqzw5NqSSiw Au5hPNLNojaZxPLIB6jA44PBV7pyE+mR6XYhXKgRYhJT5lUc+vxM0fgjL w==; X-CSE-ConnectionGUID: 1EW7w0WHSpOfgTdIpu/1IA== X-CSE-MsgGUID: 0iVSUnUiR6u6S+5RwLIzHw== X-IronPort-AV: E=McAfee;i="6600,9927,11078"; a="12274146" X-IronPort-AV: E=Sophos;i="6.08,177,1712646000"; d="scan'208";a="12274146" Received: from orviesa008.jf.intel.com ([10.64.159.148]) by fmvoesa112.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 May 2024 05:43:50 -0700 X-CSE-ConnectionGUID: 36DcsM6pTUyqUmmyW2QJkg== X-CSE-MsgGUID: LjkkY8prSeSFge7pxObtqA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,177,1712646000"; d="scan'208";a="33465821" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by orviesa008.jf.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 21 May 2024 05:43:49 -0700 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Tue, 21 May 2024 05:43:48 -0700 Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) by fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39 via Frontend Transport; Tue, 21 May 2024 05:43:48 -0700 Received: from NAM04-BN8-obe.outbound.protection.outlook.com (104.47.74.41) by edgegateway.intel.com (192.55.55.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Tue, 21 May 2024 05:43:48 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=efXTejecP87hhTDZ9922iSMEAwOfJwVpcK6AO5oeDSZP08W7kIPrIsgiR7wEk1JaRYaLrYhzNt6g5CNWTFvwPNG+wZq9daZmnMNVrRGp6KC1eQxrs7C8Nag0Q4ok9qa3YAx8ZTi5NxOcMGgDwEl3OdFpqCw/nlC/M8vrx7mx043Y5SRq7k84XNGS5Je27eotyIjXn+ExIDWLoDA6W31iPEWAEaL909GgzgPxDcpFcz2/SdS8a9A4KX5ugXmkZ4A5SrkBwPrv1+hxm4bmznr7jgMb/9VnyLONOcBShfTub/S5vXzHl+O+y+EaNC5BWB6pExEaiEHpeo3YsOY0Rxx31Q== 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=VymRZO3XTKDHpO8Z9erXNoig4TsS92j64LS7CD3uXVM=; b=QVwkRXxi1z7tqF7SxeZB59Qy55gTY0wFLnw8fLmW+O2XeDmcfNIBVkNXSAKvWTVovlw15ejWNCZS2TyIeo+ZsJJD09AydwYX7Tu9nlVgj4CD9WGPdIEgzj6WZxW83dhUKtUhomuMEn2G3C8BJ+KYKUT4I0POsxEUBtiC2s3Jxi91jaPLGnQRpsQ/uf5q+mjMjqzDvUZnkwFWl7lC3vnyKUlAFGzJG00DBHQUjfISJXZcdGc2KScJfkio7wiAaCdy+zA5qHaL2LDjrj/tW/XrwpfyXscKGmT9DhSZ+qGRsBkm2NNaJU03L8ksi79g0SFHxeFsDFOGfHPH09bnwWBZMQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Received: from SJ0PR11MB5918.namprd11.prod.outlook.com (2603:10b6:a03:42c::22) by CO1PR11MB4803.namprd11.prod.outlook.com (2603:10b6:303:95::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7587.31; Tue, 21 May 2024 12:43:46 +0000 Received: from SJ0PR11MB5918.namprd11.prod.outlook.com ([fe80::891b:9bb3:428a:c72a]) by SJ0PR11MB5918.namprd11.prod.outlook.com ([fe80::891b:9bb3:428a:c72a%5]) with mapi id 15.20.7587.030; Tue, 21 May 2024 12:43:46 +0000 From: "Wani, Shaiq" To: "dev@dpdk.org" CC: "stephen@networkplumber.org" Subject: RE: [PATCH v1] net/cpfl: get running host ID for CPFL PMD Thread-Topic: [PATCH v1] net/cpfl: get running host ID for CPFL PMD Thread-Index: AQHaqnCEfuZLp77s6keuh9n/kHEB07GgcYgAgAEyBBA= Date: Tue, 21 May 2024 12:43:46 +0000 Message-ID: References: <20240520044415.2307157-1-shaiq.wani@intel.com> <20240520112618.717dc714@hermes.local> In-Reply-To: <20240520112618.717dc714@hermes.local> 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=intel.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: SJ0PR11MB5918:EE_|CO1PR11MB4803:EE_ x-ms-office365-filtering-correlation-id: c29edf47-ad0c-4a0d-ec8d-08dc7993a7dc x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; ARA:13230031|366007|376005|1800799015|38070700009; x-microsoft-antispam-message-info: =?us-ascii?Q?i2cBUfaIAjJSJbHYVOW2r7oblUdA8sRfYdkxROVZVvE8lZgBZ9z26hwlwBeb?= =?us-ascii?Q?1pWrOlSOG+UNoZ39h9GMrIu0IPTvHRRrsJwIEUndTNJfiiRGVlAd9fizmtVa?= =?us-ascii?Q?e+4hk0kQxFnlNRI3/XfKh+54UxPZUMsZR67aghUFIWXo8X5hJK1MQL+YztTC?= =?us-ascii?Q?J+ArAGgYgSy2TwC2vy8esbraocQnhYpX7Xu7J6bGe+hiCtn6wPp4oDzbAMoT?= =?us-ascii?Q?TFr5v3q6kTRA0G9rG96OyqvXArvfwDna2uWSHTFzIvBdC/+IK9L0lE9iSSXd?= =?us-ascii?Q?HhXMC6tFKefF7M95AcZsXfV8hsKuVDulMzUtJn+CWKI4H45laErlFrSU9WtH?= =?us-ascii?Q?v2cECmR+s/nthoeLnNdn+dFQtA9H2qPvM6rLTew5hHmUCgF6TRTcAEqsgyjJ?= =?us-ascii?Q?Gs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ZIq5VHby6bsyH?= =?us-ascii?Q?BRyYbpWOycx0pdPPJTyvbb94kvkfxxfslsAbQDx5rfMaKQ=3D=3D?= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SJ0PR11MB5918.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(366007)(376005)(1800799015)(38070700009); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?YYq9nPNk1FHuKi7/wce4j/HbTkeuFQ2M7JPGBXamrbDvUvcnRUDHGvXHIOC4?= =?us-ascii?Q?RMjLIMwcMnOVWjmJ67db7l8Pk+h8ik2xIQcxZB7DnlYFh1p1rNh/BwMKi8I2?= =?us-ascii?Q?mwUWRApVfvwh0hbBYmauWmsn6ak/3O7FDspEhfe4fqnAWjYKbq2pH5BUuLE1?= =?us-ascii?Q?Gxwo65dxRsb82wuKVsZcc+h0VzjRgiCPF2D9Wupne38e6oA3IgYeQEYXSYaD?= =?us-ascii?Q?cvCfVic9IYmVA6ujIWs4WD5xMx+lhoN7t3rAPDS65aEIj1NGWzqkfSKQs4/H?= =?us-ascii?Q?KOG70tXA1mfdMZCm0/DZIhigk84lj+wsnT+Sld+1W8UlnsE0iAka0lqcLmQL?= =?us-ascii?Q?ikmBv15nOyGrTvyJP4//kDY3VNe9/2LdFOtZyRHohMdkm4+sB7bmNEJND6rA?= =?us-ascii?Q?M4HwV5TydF71NChyFQIiBTNXe54vHLe1dt8mFaghi3qqCu2E7g/Rdnnkh5D1?= =?us-ascii?Q?y1IIMpHPNJwx8rz+rz42Ja3KF8KPHnwi14vopo3HCbxDsIPirMYaOhSZkPdq?= =?us-ascii?Q?Oqv7wBxEvWWrCYtVyFEqb4VahmHysP93SeWtZzgOWhENbHWWNcslHjUTAR6Q?= =?us-ascii?Q?lVFnwyQ4x8trxTlRY3+I9BVJHU19SUNEaHVu9S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1rKadHc6RDfludF/cQ7yJp4K9j+lhuXymtNlCfQROa5f1pQEH6iGtc5x1b?= =?us-ascii?Q?rtUnGlQ9AAuklbCjRIyZZ12NHTILolKNfCDU3xhk?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SJ0PR11MB5918.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: c29edf47-ad0c-4a0d-ec8d-08dc7993a7dc X-MS-Exchange-CrossTenant-originalarrivaltime: 21 May 2024 12:43:46.3113 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: fH11gHliQyT4B2RqRqhMx2Du6zeZFNrxlCvYPGic9lZhA3DzAm5rnLwT6bDlUl5p+xkH94+0rcUEceAB5XhFxw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO1PR11MB4803 X-OriginatorOrg: intel.com 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: Stephen Hemminger =20 Sent: Monday, May 20, 2024 11:56 PM To: Wani, Shaiq Cc: dev@dpdk.org Subject: Re: [PATCH v1] net/cpfl: get running host ID for CPFL PMD On Mon, 20 May 2024 04:44:15 +0000 Shaiq Wani wrote: > +static uint8_t > +get_running_host_id(void) > +{ > + char buf[BUFSIZ]; > + FILE *fd; > + uint8_t host_id =3D CPFL_INVALID_HOST_ID; > + > + fd =3D fopen("/etc/issue.net", "r"); > + if (fd =3D=3D NULL) { > + PMD_INIT_LOG(ERR, "Cannot open /etc/issue.net\n"); > + return host_id; > + } > =20 > + if (fgets(buf, sizeof(buf), fd)) { > + /* get the first line */ > + if (strstr(buf, "IMC")) > + PMD_INIT_LOG(ERR, "CPFL PMD cannot running on IMC."); > + else if (strstr(buf, "ACC")) > + host_id =3D CPFL_HOST_ID_ACC; > + else > + host_id =3D CPFL_HOST_ID_HOST; > + } > =20 > + fclose(fd); > + return host_id; > +} This seems weird and problematic. You are making assumptions about /etc/iss= ue.net which the is the message file used by SSH for login message. On an embedded firmware ROM this may work. But on other platforms this is a= user modifiable file. Thanks for your comment. I will look for another approach to implement this.