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 43803A0543 for ; Fri, 11 Nov 2022 06:41:10 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 337E3410F2; Fri, 11 Nov 2022 06:41:10 +0100 (CET) Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2072.outbound.protection.outlook.com [40.107.94.72]) by mails.dpdk.org (Postfix) with ESMTP id 05B9B400EF; Fri, 11 Nov 2022 06:41:08 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LefxJTnjKjiuKqDsA1AuAeAmpXoo920O8J2WL7UZUent+0+abYPD1oXO99pBfSoN1uwMjscKJv1DerNZ98mX0WtLJf6Tv4yE/GJ+wiY5Y+aMOApp9TwV2InzxxBrougDfVZWbSWFmkFL1ufB4MnNwrkQaC8dqtQ0XDgQy1pv9pRtN45dxjKY6jKPIT+/uPx5QxRcAglmn99conESzR3hWQ+zNytesA8riwun1+DYy6ryZStnKBaBqcuxHC1fWGMZRt6M6uHit0/eGPzokX19D6OW/H3aSRUTkQIltmbDwb/Oasf687a8UjfNLAXI6V7ZY9UtiA5K9f+9k0EYdyGdVA== 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=k4f4RhHeKH9tQfg5oABnrzw3d5UUcqBN8WZ3HkVaBUQ=; b=NbifzCMn7D6NZsJGDK0KJZLopvQwu3bxoPgAliB/11WFGfqf6lLwl82D9xd4WojKwcj1950FXBScKv30Jvd4vrD2XeDPSxYcfbcGRTWDRQ9eDi6ETqcKbqfBy8plUCu8ksgYkc+R93dbrjwjrgLqIJmzlcOjkOTiFrXTL/UMZ4aXFA1yOIJGX0b3IfnAoS49DEQo3JVQ3mrUNv9ALwyihJRqH3qWPIGKRU/1GR1N3Dy/+56zosqLQ8CnmXuTq4xbykTff2VJZrb8jvGSTzCTfOUczkVu73hi3GOa/EWKfLUmo8ktrwwY4pJ8qtQpoOTC9Lx3Igm9O+jP3hLN0A7hXg== 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=k4f4RhHeKH9tQfg5oABnrzw3d5UUcqBN8WZ3HkVaBUQ=; b=LbSXbHzBqZJesi0eK+5TiUQbQeBq0BKgdHNyjO0yqyXP99Ep4J6jR86wSdGWnb2e1Wi9GmOWiKVz5R2tmi5SzegZYtqe/42wfO69svrMU/bnQQp/roJxrBdxD1pjiT1xCipcUdLTxaTiV2QhRv50ZXqY/A3/ei1z47XaF2/NzHg6PoaoP70FyzB9rAb/yteOX50gan2zhtw9dlb6/Gp2DKGQ2dsZRmv3GqWJdQc2vo/xdB5djR1gcq0g8ILIrf0D5ugrqF1LYxwedzxG6ZIgLA3qWFAAOZT5ft4cphl2zLo1Hg6IGV1K4iUML0FjTR4+2suzU7Sc/7a76n22Oix48w== Received: from DM4PR12MB5184.namprd12.prod.outlook.com (2603:10b6:5:397::18) by CH2PR12MB4136.namprd12.prod.outlook.com (2603:10b6:610:a4::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5813.13; Fri, 11 Nov 2022 05:41:05 +0000 Received: from DM4PR12MB5184.namprd12.prod.outlook.com ([fe80::c77:450:89e7:886b]) by DM4PR12MB5184.namprd12.prod.outlook.com ([fe80::c77:450:89e7:886b%9]) with mapi id 15.20.5813.013; Fri, 11 Nov 2022 05:41:05 +0000 From: Bing Zhao To: Stephen Hemminger CC: Slava Ovsiienko , Matan Azrad , "dev@dpdk.org" , Raslan Darawsheh , "stable@dpdk.org" Subject: RE: [PATCH] common/mlx5: fix the sysfs port name translation Thread-Topic: [PATCH] common/mlx5: fix the sysfs port name translation Thread-Index: AQHY9R00CGqXQd8EmE2t9X0UWjCpVq44Vt0AgAC79hA= Date: Fri, 11 Nov 2022 05:41:05 +0000 Message-ID: References: <20221110155726.649190-1-bingz@nvidia.com> <20221110082154.118781cd@hermes.local> In-Reply-To: <20221110082154.118781cd@hermes.local> Accept-Language: en-US, zh-CN 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: DM4PR12MB5184:EE_|CH2PR12MB4136:EE_ x-ms-office365-filtering-correlation-id: f997ecf6-5514-4f77-5e62-08dac3a753c2 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: aJvmDryQUAfPl08c+qrbs+lclrO36RdSZUf6V1WMBej5UxiuNxmddtKuWu+NbtseaiWmN2I6CosabUoMcxUE00Gwi4GMRIIJXSRZvZPe+ieX97WtDYB6f0zb+8PWKRfVbUEJa15OjTTL0IzrQN5hxhXTA1EwEKuhwAybOW2IyZaoRStBk4fnXyKX49bik62C6bvFXkPTgjiKssN0i4VVjzYQtiLe/L+O46GXAP+8VP/hURkGoYc+uCDBZZ+BavWNGCEhNZhYAVw4OLGPZ20oQbWfKL3R7JjbNo4Ib415+v+qdrI4oGuA/RCr8HJ2BWTC40sirrAD9MKzi/DFhUsjeUBaxglHxkSFBWqGkmuWLR4VvaaIJsTwehiDxy+8GhClR41IYSYNY6nEv/kY5idI6/3A1FncZ9xRoSdi4ji1s8U2E/BjckGyPuxcqiqOEZ/5Y2GnZPffegrnNlk0e1Ppm+Ep2hfWUe5mYm0qKCdw9qWxASJnCI112UJm4IOHj+wSt/2CEnSBMEdJryF1WgKaBHM2aH4Jz/JNe0OpS3U+G2yG64yDTaA/mEt9noZn0ubjWJjKAti1hSgrYRzxB2D7OmhkAaB8plJnOCvHxZ9LQFh9h7TpIcX3zQc94GbySl7NB99Fq7thhskMVzrnSIV5gdD1YavTVh1ddbvRo5fxzCamQ2tVViEamu0vrFy0gf9HtuaaXU+NJ/66aUF4NLISYmKEFhBfLdDd0hpuwcDEHnnMch4DmkdyUcm/mXpTv2WCRfXtO5vxkc5qyZTgwyNeUQ== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM4PR12MB5184.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(4636009)(396003)(39860400002)(346002)(376002)(136003)(366004)(451199015)(2906002)(33656002)(4326008)(6506007)(38070700005)(7696005)(122000001)(38100700002)(4744005)(86362001)(5660300002)(186003)(41300700001)(83380400001)(54906003)(52536014)(64756008)(66946007)(66476007)(76116006)(66446008)(9686003)(26005)(53546011)(478600001)(6916009)(8936002)(66556008)(316002)(55016003)(71200400001)(8676002); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?8jqpM4wpsoRnZlvDdlCvoYDMbo6xQWb56HdGzfNFU+z1THahaq8alno6EXdg?= =?us-ascii?Q?KI2rzcN3uJrG3eZ7UupYlxnHeUYojuyTFRk+5kcL2UV11RVVyS0g1kDBIoV6?= =?us-ascii?Q?r3tcYEnGdbgQR9NzGtnFmwD6fGqbgTorpAqUHnTB3bCjHfXpins77HKQfcau?= =?us-ascii?Q?kfSox2rQcY/bEkaU55Cg9VvLPXODQ+8cE5W6yhKnd3UIW/CjuoSSk0NJd1Ns?= =?us-ascii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1vAEtkiEjg7vA?= =?us-ascii?Q?bqQiUBJXCRNfxr15lAHO5w3NbhTG8V/KZb+y4r8k2Ic62CjVF9VSLT45DMqk?= =?us-ascii?Q?enC7qYMe4DY8dL7YksKGbwnkJ4Fzc28/EZIFYGBVfst97NdcaPmH3yKDYSzr?= =?us-ascii?Q?bnOfpO+nZ4d/+hrpsR2U+XbqsWh9+he6lkMXEMC2hFUqWtxsDWt27JhzwE/r?= =?us-ascii?Q?iGDp1TWYMQysj9lyGrSfdYz5OyfuTfOS7BsJczX8IZZfI8Cx/lllAIi3bT19?= =?us-ascii?Q?j1en+ZnxTHtqHjkjKO30jNkRJo8CqqvCD77aMAqhnI6uBfdohpoR5l7kwNmi?= =?us-ascii?Q?aoidSN6fcsrCGGNAIjkKRMimCB3HjLtVrsrlMECDxw5IP2iaVzjKLWE7+HKh?= =?us-ascii?Q?rYzYKR0y/d3mpLlWgNSVHK7+GavJgChNYdJt3VYyWqQbLzuohe8sRdBIzPB4?= =?us-ascii?Q?pE0ukhXNTJhAnzuZf7k=3D?= 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: DM4PR12MB5184.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: f997ecf6-5514-4f77-5e62-08dac3a753c2 X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Nov 2022 05:41:05.8079 (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: 45uYjEi5OlSl0VngTRAV7gwwt/IbgG5BgjBU8+q1Xy132B5PA3mY3dU0MWWwG0/KTi/k37S8vL1tOPSp6olpaA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR12MB4136 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Hi Stephen, > -----Original Message----- > From: Stephen Hemminger > Sent: Friday, November 11, 2022 12:22 AM > To: Bing Zhao > Cc: Slava Ovsiienko ; Matan Azrad > ; dev@dpdk.org; Raslan Darawsheh > ; stable@dpdk.org > Subject: Re: [PATCH] common/mlx5: fix the sysfs port name > translation >=20 > External email: Use caution opening links or attachments >=20 >=20 > On Thu, 10 Nov 2022 17:57:26 +0200 > Bing Zhao wrote: >=20 > > With some OFED or upstream kernel of mlx5, the port name fetched > from > > "/sys/class/net/[DEV]/phys_port_name" may have a tailing "\n" as > the > > EOL. The sscanf() will return the scanned items number with this > EOL. >=20 > Why not fix the DPDK driver to strip off the new line when the port > name is read? The code in mlx5_os.c should do it there. Thanks for your comments. Yes, IF_NAMESIZE is large enough to read all the = characters including the newline into the buffer. After fgets(), the strlen() or strchr() can be used to remove the tailing n= ewline character. BR. Bing