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 0591245A68; Mon, 4 Nov 2024 10:57:33 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id EC628402AF; Mon, 4 Nov 2024 10:57:32 +0100 (CET) Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.14]) by mails.dpdk.org (Postfix) with ESMTP id F32794021F for ; Mon, 4 Nov 2024 10:57:30 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1730714251; x=1762250251; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=J7yNwoodNXMpem4Ax5ob1QR4toQg2mI9uw+IG9VrKYo=; b=cOvs7cvwQiNKm3Fldb+bq5Zxk/Ucits7eHubxfueu6BQF6MsfX3h+eve dapBlrACyT3lEpKg8Azy/VC6PxqyRbv5ZzLPKwQnsUx6CeP0HIapM10a6 GuO+8O8bxFOj/u4Y3eVj/OCix9n/oa3XZwUCECcS/XpeKJpeaUTW1BVN5 FirXOnpBDUBGOgAG/99RY0q4brp86zKKmvIsLQiMCs6CdnmI+qnquN0zU ObGBEgZ2e3b7yPt9x1vSE9qdVwG8LVQVhcSmWbI474WX5p1PpOmDajZZJ 4G/T1rwBwxLKuRiioO79X3ZHkY/CWDTVDKnThjGtUZqDTbbCUsOo0YHZB A==; X-CSE-ConnectionGUID: 4eWunll2QeKXjolrUn/1wA== X-CSE-MsgGUID: WzCfvF+NTBKCIvp0i2pwCA== X-IronPort-AV: E=McAfee;i="6700,10204,11245"; a="30622114" X-IronPort-AV: E=Sophos;i="6.11,256,1725346800"; d="scan'208";a="30622114" Received: from orviesa009.jf.intel.com ([10.64.159.149]) by fmvoesa108.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Nov 2024 01:57:30 -0800 X-CSE-ConnectionGUID: z9ct1bE2Q1WMfs92wvb8fQ== X-CSE-MsgGUID: a+oGoiBnSpK3LmMptjxH6A== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.11,256,1725346800"; d="scan'208";a="83488519" Received: from orsmsx602.amr.corp.intel.com ([10.22.229.15]) by orviesa009.jf.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 04 Nov 2024 01:57:30 -0800 Received: from orsmsx601.amr.corp.intel.com (10.22.229.14) by ORSMSX602.amr.corp.intel.com (10.22.229.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Mon, 4 Nov 2024 01:57:29 -0800 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by orsmsx601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39 via Frontend Transport; Mon, 4 Nov 2024 01:57:29 -0800 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (104.47.56.171) by edgegateway.intel.com (134.134.137.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Mon, 4 Nov 2024 01:57:29 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=oFzE2gMEnEOK/WoFGjUxT2WJW4ER+JI0pcuCsl3WAAqwW0BkiupQL5WK1kGzidCtZJfty2Hcy1sOSsCdWh+w7PcWK752XChlV+LybRaWeJXof+2vU21BRq2TswKZGhVNFDuAg2b7ERNLmgOttfXIUeFax9Fj96QAn6/kt0cKBl6Yry++kj9LEdDA751fVCm1bziw/NrdaLRqLVS485TMlQV7Keyi5a+GOR2+SnHb+ZO8CBfbHhmhIxQ2bDWa4saNnMVAjsDz+0/8ovfWnQacFFnqPcnwsh/ESxEZ00H2eJp6Z+k2yb9AE1xILJTKF1SG6GwtJBXS4URSDYClZZhv7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=sZX3lbOV2P26ESEnqG8nFiBee1PecXzutev/w3GPfaQ=; b=tsgQ9/pLoZoRH0B3H0Q1KnzWST7ZxEXaJMECb7bwy7hwb4OFUbC46Iw6FUiP4d0UZPUuIevSFmn5OxZo8PBUVmGUJReE0IeX/Vms54xqfl8GX6zUmjq7enbjW+YkjFCV6EvFwJ3BJdvkq/NeCC10/qxSX8DxTGvkX4KL3HicEuDB6p6a6XjzUNoeJbv/NWCHb3uWG0WtkLRWzecd/aErKD4HUbDQFHWjDcyCNZyQmONTwXpCbjs4N6jOibKQ/jpds3UDtxgI6zGnW80GEAzUBkgWdkg7/2krpUooQcHnd8SF/FKH4QceCRiuEJQUm01CkSWKE5kKbLa1CFNnY1X7eQ== 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 CO6PR11MB5602.namprd11.prod.outlook.com (2603:10b6:303:13a::5) by CY8PR11MB7083.namprd11.prod.outlook.com (2603:10b6:930:51::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8114.30; Mon, 4 Nov 2024 09:57:27 +0000 Received: from CO6PR11MB5602.namprd11.prod.outlook.com ([fe80::a7e3:721d:9cec:6093]) by CO6PR11MB5602.namprd11.prod.outlook.com ([fe80::a7e3:721d:9cec:6093%4]) with mapi id 15.20.8114.028; Mon, 4 Nov 2024 09:57:27 +0000 From: "Zeng, ZhichaoX" To: "Richardson, Bruce" CC: "dev@dpdk.org" , "Burakov, Anatoly" Subject: RE: [PATCH] net/ice: fix wrong DDP search path Thread-Topic: [PATCH] net/ice: fix wrong DDP search path Thread-Index: AQHbLDgks7Hoz7yQ1keoqCast0UB7LKiKoGAgAS8oAA= Date: Mon, 4 Nov 2024 09:57:27 +0000 Message-ID: References: <20241101084443.850674-1-zhichaox.zeng@intel.com> In-Reply-To: Accept-Language: zh-CN, en-US Content-Language: zh-CN 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: CO6PR11MB5602:EE_|CY8PR11MB7083:EE_ x-ms-office365-filtering-correlation-id: 9cfe6412-cf51-41cb-04da-08dcfcb71702 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; ARA:13230040|366016|376014|1800799024|38070700018; x-microsoft-antispam-message-info: =?us-ascii?Q?kxYMjXvUrEObSAQfPyzLZzpRYQNoce7lZYNnioGtxWEfpoLIcRoYE7Hs8R5p?= =?us-ascii?Q?dvqe7O6Moo0eJwIk6zYSTCGHeUu+wgj0p8LCuR9DdqAI9ez+VzkSOfo1VlV/?= =?us-ascii?Q?GR4XYdsyxZGtH4NakXgFTS4N0J51Z3VUJxHLHGg2w3WwYwb+i1Ufqtn5KjGw?= =?us-ascii?Q?Tg3vy+0XPza6XbqnXxi5ZN5pPBbQWwDRt1Yh/DTblhQXL4RGVDcxV60E29tB?= =?us-ascii?Q?Ktby0mhcIVbnRccA4NKo27GvLaPruuPG6jreZiV374w/3VxVcJc3F5mqo8Jz?= =?us-ascii?Q?JUSHrFnwpagpMLOmYD/46XWr3TBDJIPdSwa8Wtzb63eJFq/Abr1xGP0vCrJQ?= =?us-ascii?Q?tKNwR6utnon1eGFCw3TccYjp8FKQY9CJT1CBOFie723nhLEyA98rV2IRwS4M?= =?us-ascii?Q?MeG942oJy8XsYqr3gda2MHiAwE6r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-ascii?Q?gQKDvkYFR/xyKUgB4fTjiSLcV+IKi94fs2ziQZB5ZSmCb7p919jLfDJRBes1?= =?us-ascii?Q?E2Kx6mA=3D?= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CO6PR11MB5602.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(366016)(376014)(1800799024)(38070700018); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?V4J0qOIiTCECIGpJjvhEXh/Ge1+nYq/z5C3hyQfa0W4q2l1hoNFzH+tTKQCS?= =?us-ascii?Q?jR4l/DnsNiGN9gzx/Lbe+NMiZe+dQTCiumHivgCPXNnt4z/XKfzgIA/JjBBh?= =?us-ascii?Q?hjN3P7nk5xoy6I5sVMkGOHxMJv1Vf/McHpC92X4Jci5W9TldAIBF8jo7Ptq0?= =?us-ascii?Q?CgVCTq87MUAw6+EKZXyaL7SJJhdEX/mUvEu2azU3SHE+Hv1gogZISXLrNaCg?= =?us-ascii?Q?gh9aUKlyTNJX7erXdPZW2iorHIbjleku3JRItymw9keSgmDTBfCtswcdveFh?= =?us-ascii?Q?ZhE6wv0NkwGdMnDlgukDu1e4T5sqHmJWB1hJVdnZ1sN8lRtyGeoEZGxI4yiF?= =?us-ascii?Q?2qDZUBc6lzp4Y1ZFuGbka3VQbfRBimj5+9ld+FnY2JcRLvqMnp9g8avU4I6Z?= =?us-ascii?Q?S2w+ED4y03Bh1Tp7BySdvTDfOtyPtq7q6EqmrwfK6JKl0XLlyq39lwcIee8q?= =?us-ascii?Q?DD7nefl34R0BsQZv9a50kKnxTtyeHZ/tW8+XXSctLWlPBD70LO7poXL6omOj?= =?us-ascii?Q?K15zXHyphJaWJJ/FBmzzHIpu3GCa+e78pncHhreRD25NzVBW7r9FUm+XYBBF?= =?us-ascii?Q?kzDXtfkaekpkGKYL21VstOE89cL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q?o1noF2C8msliai+04cmBmJxUFHjDDp4s+K0I+1Gn1jclFK5DtI+xhAJmlsVb?= =?us-ascii?Q?6bVSqxzh8JFkU3dGeSgfoxBtOLebxarp8FCjqYJ2?= 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: CO6PR11MB5602.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9cfe6412-cf51-41cb-04da-08dcfcb71702 X-MS-Exchange-CrossTenant-originalarrivaltime: 04 Nov 2024 09:57:27.4720 (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: hteCBzfioRCh2Ev3joODAKs1xw6ob6XBiiVOybbCyDFbg+jidyL4E7dgGcO/39XTXP5Qz5vuMcN1xcxH+wDnuQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR11MB7083 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 Hi Bruce, Thanks for your suggestions, will send v2 patch. Regards Zhichao > -----Original Message----- > From: Richardson, Bruce > Sent: Friday, November 1, 2024 5:36 PM > To: Zeng, ZhichaoX > Cc: dev@dpdk.org; Burakov, Anatoly > Subject: Re: [PATCH] net/ice: fix wrong DDP search path >=20 > On Fri, Nov 01, 2024 at 04:44:43PM +0800, Zhichao Zeng wrote: > > In the previous implementation, when the user did not enter any value > > in "/sys/module/firmware_class/parameters/path", it would incorrectly > > search for DDP packages under "/". This commit fixes this issue. > > > > Fixes: 9207f93640a7 ("net/ice: support custom search path for DDP > > package") > > > > Signed-off-by: Zhichao Zeng > > --- > > drivers/net/ice/ice_ethdev.c | 5 ++++- > > 1 file changed, 4 insertions(+), 1 deletion(-) > > > > diff --git a/drivers/net/ice/ice_ethdev.c > > b/drivers/net/ice/ice_ethdev.c index d5e94a6685..0705f8e961 100644 > > --- a/drivers/net/ice/ice_ethdev.c > > +++ b/drivers/net/ice/ice_ethdev.c > > @@ -1922,8 +1922,11 @@ static int ice_read_customized_path(char > *pkg_file, uint16_t buff_len) > > return -EIO; > > } > > > > - if (pkg_file[n - 1] =3D=3D '\n') > > + if (pkg_file[n - 1] =3D=3D '\n') { > > n--; > > + if (n =3D=3D 0) > > + return -EINVAL; > > + } > > > > pkg_file[n] =3D '\0'; > > >=20 > May I suggest a slightly alternative fix, that I think it a little shorte= r and neater > (assuming it works - if not, let me know.) >=20 > Rather than adding an explicit check for n=3D=3D0 and returning error, I = think we > can instead change the return value of the function to be the length of t= he > data read. So at line 1931 "return 0" we can change that to "return n". > Then at the call site for the function we can change: >=20 > if (ice_read_customized_path(....) =3D=3D 0) { >=20 > to > if (ice_read_customized_path(....) > 0) { >=20 > What do you think? >=20 > /Bruce >=20 > PS: if you do take this approach, we can also slightly shorten the functi= on by > changing/removing the block: >=20 > if (n =3D=3D 0) { > close(fp); > return -EIO; > } > ... /* length adjust and zeroing */ > return n; >=20 > to be an inverted check with the length adjustment and zeroing inside it: > if (n > 0){ > if (pkg_file[n -1] =3D=3D '\n') > n--; > pkg_file[n] =3D '\0'; > } > close(fp); > return n; >=20 > That gives us a zero return value too in case of reading zero bytes. It a= lso > handles the currently unhandled case of read returning < 0.