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 6EF5445980; Thu, 19 Sep 2024 09:49:50 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 349A74068A; Thu, 19 Sep 2024 09:49:50 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.12]) by mails.dpdk.org (Postfix) with ESMTP id AA75B402D4 for ; Thu, 19 Sep 2024 09:49:47 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1726732188; x=1758268188; h=date:from:to:cc:subject:message-id:references: content-transfer-encoding:in-reply-to:mime-version; bh=Ny3IR+CwwQFJPLKnPXSpQ0vfNjzYqaiWj/u3PPx0E7s=; b=Rb/7EXfoGJ1t0KzGih7WpBhMw/13516wv32KyXMnrwevztsiJNAofZAS a65RMiIvXa7mvhSlST4KBudZuBAaL3XYe0SQPdkIItzZubshFIQvcpXpJ 6/rGyopc8knQ61Kvz+Jvuzno3A2eJYc1a4xy9gc4KqrLD/FOtqQ6u4tNl 7BM+R0t0gvGtz1Vun3zIaQV8oD+P3cHw6oRE9f1p8Iv2vaCO77ptGN191 g3VuxwDmO9p5fzWHkK2UOb0f51CkdojZ/MYYG90II7BUtnnYLa/IRowPa 8FxFGnax12jHd6nBufzW2gMUbDF0wPK7l+P6g10F+PFRCN5QWM8LMRfEJ g==; X-CSE-ConnectionGUID: mBfL7ADkS6aldCiaAQ1tyA== X-CSE-MsgGUID: vxqI4PN7Q/ahpJq2mJwTFg== X-IronPort-AV: E=McAfee;i="6700,10204,11199"; a="29575416" X-IronPort-AV: E=Sophos;i="6.10,241,1719903600"; d="scan'208";a="29575416" Received: from fmviesa009.fm.intel.com ([10.60.135.149]) by fmvoesa106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Sep 2024 00:49:47 -0700 X-CSE-ConnectionGUID: /DSnNyIjRVGT5c27u0hL3A== X-CSE-MsgGUID: k0njiImvRgmslYwQCxkghQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.10,241,1719903600"; d="scan'208";a="69866475" Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by fmviesa009.fm.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 19 Sep 2024 00:49:47 -0700 Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) by ORSMSX603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Thu, 19 Sep 2024 00:49:46 -0700 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx610.amr.corp.intel.com (10.22.229.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39 via Frontend Transport; Thu, 19 Sep 2024 00:49:46 -0700 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (104.47.58.100) by edgegateway.intel.com (134.134.137.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Thu, 19 Sep 2024 00:49:42 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=ZRW/GwBt5vfIiCEdKLPoqQ7HSECLAwnwINKLEfGUED7FLezf9iFF4peHB6J1d3Xbgv8s0Sxr7IgmdOcG0W6ANv8LfUK4BNzKEP2O4+SwR3rnD49g16tuPGTn3ASV/pUnAr6lNS9viwSN9K6CD+mredl/mMiNlEMvnRo9IuOHhR+mfC2PxbRcu5AVyOWGiJEHODXl4NUFLXQSmnEx7PqGtb3VUZWeMfahuSTTPSkKf4NzSrmrYkyKX7syVyFmiagG3UH9lXJQGKe1LvRCyerpn2dSbf8Taz812/mqnVkE0nGt7FVxfu9qrwg/aobapxYFNbY2dk4zK9kD0eCzGdKocw== 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=nREB01PwyBL1efc9dhKr8zm3/pasU9L+LtB2KBOanpU=; b=N0w6onrkM6SFMYDkjrhDfd5PUL9Xf4Bk5FIWvfccbxXOrdPCBcsSsZApN7fmry0p4qwDv3qu8t4u+doflU8Rke5zhr9p2r7nPEat8czly0un+gzslc9gKuURrNbE64QdskxVBbIL6y/Yps4nbGlS6aQD3ll/uu0ikHHfIgIzimtCKUEuzWnh8X89z17P+KoMtncl2WIiXcBYpbRvIOdnSEYtPZguxbObplEkfdr/mo1VvQ7OTsER5C1x1WlZl6m/cDxZXvgGHUoFhPrWP5IS04d8cl8aOEhUtTHuWcCSanRV9wRFq8j3nzLOkSxApM0Ct7ZnhkPv7xui9woyTpBgmw== 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 Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from DS0PR11MB7309.namprd11.prod.outlook.com (2603:10b6:8:13e::17) by SJ0PR11MB5867.namprd11.prod.outlook.com (2603:10b6:a03:42a::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7962.23; Thu, 19 Sep 2024 07:49:40 +0000 Received: from DS0PR11MB7309.namprd11.prod.outlook.com ([fe80::f120:cc1f:d78d:ae9b]) by DS0PR11MB7309.namprd11.prod.outlook.com ([fe80::f120:cc1f:d78d:ae9b%2]) with mapi id 15.20.7982.012; Thu, 19 Sep 2024 07:49:40 +0000 Date: Thu, 19 Sep 2024 08:49:35 +0100 From: Bruce Richardson To: Zhichao Zeng CC: Subject: Re: [PATCH v5] net/ice: support customized search path for DDP package Message-ID: References: <20240913061537.2077253-1-zhichaox.zeng@intel.com> <20240919032934.800979-1-zhichaox.zeng@intel.com> Content-Type: text/plain; charset="iso-8859-1" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20240919032934.800979-1-zhichaox.zeng@intel.com> X-ClientProxiedBy: DUZPR01CA0023.eurprd01.prod.exchangelabs.com (2603:10a6:10:46b::17) To DS0PR11MB7309.namprd11.prod.outlook.com (2603:10b6:8:13e::17) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS0PR11MB7309:EE_|SJ0PR11MB5867:EE_ X-MS-Office365-Filtering-Correlation-Id: 38a97c66-bdb6-4fc8-48bd-08dcd87f9daa X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|366016|376014; X-Microsoft-Antispam-Message-Info: =?iso-8859-1?Q?A3P+/LpvOkD6zMXOtaDeK3Fivp0QlS3VuQlwSskQHfYg+uTtNFhORiUN9E?= =?iso-8859-1?Q?9UUyFyP0ZtFU8+1Eew89q6ScLgWTHPR5ZPdyhlspXOhWRpeKaVaCpuOKDp?= =?iso-8859-1?Q?5qBonix7yo7u3qsGoTP8V6iSPZi4JIVmy5xJAMxDpcPgV0kNVYZU6jt77j?= =?iso-8859-1?Q?Ca0mz6FYCUFcGfQZv23r+ngr1eb9S32JLs955A6nM0xo63j0juAJ7L9sOE?= =?iso-8859-1?Q?exmkQ3DSK7Ezx7mLalO+TDcJa2zEZAKUMyeFXTzqbt5gJ+V/rbicQp/nfG?= =?iso-8859-1?Q?+oBubnGjF3DMTbPg716IdiZOSTujUPaR2LD1iu2+ft2arJeahmQNbpP/N8?= =?iso-8859-1?Q?pAzajnAofWBOUZ+KA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?iso-8859-1?Q?05gPuKq5+ThYji3tgLAxBj544yjp2KBKigw0QcvQLrcDuUu7igfaBtFPFF?= =?iso-8859-1?Q?AUrueyFGTzfcfjwVitPuL2F+a/EOvoG4Qu4ExCUTxilJ2gS9NI8kQ+xPHI?= =?iso-8859-1?Q?OCpW1Qo21I6jvmi0HCx1MFaZxlJ2uysubTENplbDEorP6+R0xtKhw=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DS0PR11MB7309.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(1800799024)(366016)(376014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?iso-8859-1?Q?mgM2xFTizvuKHu2T6fvaMaKrzAHPhZdTCtfJNr/vsmM7KIvL+kdVSeATMK?= =?iso-8859-1?Q?LKvuAmlu9NcTP5TiHxsQn2ujscqI2Y8Vcq6mxdoAjROqkx4n8497JFMPei?= =?iso-8859-1?Q?tow48mVYhjrAMKAlg5SI/DvLahz5NqDdDilsjEkTxVd723S1jdLGJWvyiB?= =?iso-8859-1?Q?8Khv1SeWgpk4i6yjAQFbr+J5inISnfG5c/7OxiD4lhU9ntknVapVEIccPQ?= =?iso-8859-1?Q?icUnqhbJ1jZU9zWlHDrsE43AjalQeIBn5Ba0spAc1dR1jFHq6lo3pFoODG?= =?iso-8859-1?Q?Z3sOyRxCi2+a/XEWAm5504zXZUIy6WRkPHc/9ol2JVJg9evZ8HA9CP5Bh1?= =?iso-8859-1?Q?QfTpVcopdoz/tlWGZXs0oJut6vLAFTgcGoGZ7S3O79wmj09vV66Wxxmb3/?= =?iso-8859-1?Q?/O2afTf6h/2hY8RnAFoEl1y/9Cu74lKHC9rThCNSLFDSe2ne9UrwB3a34e?= =?iso-8859-1?Q?wNH9PaEPdmv3ekwPs3UEKyZJrjImfpgIg7TSIgbw2KlWu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kjYJ3Lml65UTDAaluEOw7PPPyieTjNrhSSLTpSuV?= =?iso-8859-1?Q?s6xctHvFf7VcRqenZMXrDLoyKPt6MfZt+LYJ3MXZyDbbKKThK9MR8PwTuU?= =?iso-8859-1?Q?wtiPcsoeXRWNEBMvN1CMJ24HDS/K81Soa/qHRTcxnlaoFVHqNy6VY9Y/q2?= =?iso-8859-1?Q?B3B6TnHmTM9dhc17ZuWPrcN4cWbNxCm9FI+O2mELJzOT/+ZphNILdNY+VH?= =?iso-8859-1?Q?9MaJ4YOySoJgdtVYb5TblPCSTTVTR1q4vR7NNy1vDAs1TmAon8IQ0nvg?= =?iso-8859-1?Q?=3D=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: 38a97c66-bdb6-4fc8-48bd-08dcd87f9daa X-MS-Exchange-CrossTenant-AuthSource: DS0PR11MB7309.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Sep 2024 07:49:39.9630 (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: 6Q70DC94DW2zJeLq6KN2ix+9MAILMDStYSc9FOBchcyUs557CBVLvXO4gLDSqvRkGJr8gICQh4YF0p3cVRAW5r1q7CAKzL7owxHrqho0uNc= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR11MB5867 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 On Thu, Sep 19, 2024 at 11:29:34AM +0800, Zhichao Zeng wrote: > This patch adds support for customizing firmware search path for > DDP package like the kernel behavior, it will read the search path > from "/sys/module/firmware_class/parameters/path", and try to load > DDP package. > > Also, updates documentation for loading the DDP package in ice.rst. > > Signed-off-by: Zhichao Zeng > > --- > v5: update documentation, fix code logic > v4: fix CI error > v3: update doc, fix code error > v2: separate the patch and rewrite the log > --- > doc/guides/nics/ice.rst | 61 +++++++++++++++++++----------------- > drivers/net/ice/ice_ethdev.c | 44 ++++++++++++++++++++++++-- > drivers/net/ice/ice_ethdev.h | 1 + > 3 files changed, 75 insertions(+), 31 deletions(-) > > diff --git a/doc/guides/nics/ice.rst b/doc/guides/nics/ice.rst > index ae975d19ad..1494f70415 100644 > --- a/doc/guides/nics/ice.rst > +++ b/doc/guides/nics/ice.rst > @@ -80,6 +80,38 @@ are listed in the Tested Platforms section of the Release Notes for each release > | 24.03 | 1.13.7 | 1.3.35 | 1.3.45 | 1.3.13 | 4.4 | > +-----------+---------------+-----------------+-----------+--------------+-----------+ > > +Dynamic Device Personalization (DDP) package loading > +---------------------------------------------------- > + > +The Intel E810 requires a programmable pipeline package be downloaded > +by the driver to support normal operations. The E810 has limited > +functionality built in to allow PXE boot and other use cases, but for DPDK use > +the driver must download a package file during the driver initialization > +stage. > + > +The default DDP package file name is ``ice.pkg``. For a specific NIC, the > +DDP package supposed to be loaded can have a filename: ``ice-xxxxxx.pkg``, > +where 'xxxxxx' is the 64-bit PCIe Device Serial Number of the NIC. For > +example, if the NIC's device serial number is 00-CC-BB-FF-FF-AA-05-68, > +the device-specific DDP package filename is ``ice-00ccbbffffaa0568.pkg`` > +(in hex and all low case), please review README from > +`Intel® Ethernet 800 Series Dynamic Device Personalization (DDP) for Telecommunication (Comms) Package > +`_ > +for more information. A symbolic link to the DDP package file is also ok. > +The same package file is used by both the kernel driver and the ICE PMD. > + > +ICE PMD supports using a customized DDP search path. The driver will read > +the search path from '/sys/module/firmware_class/parameters/path' > +as 'CUSTOMIZED_PATH'. > +During initialization, the driver searches in the following paths in order: > +'CUSTOMIZED_PATH', '/lib/firmware/updates/intel/ice/ddp' and '/lib/firmware/intel/ice/ddp'. > +The device-specific DDP package has a higher loading priority than default DDP package. > +The type of loaded package is stored in ``ice_adapter->active_pkg_type``. > + > + .. Note:: > + > + Windows support: DDP packages are not supported on Windows. > + > Configuration > ------------- > > @@ -487,32 +519,3 @@ Usage:: > > In "brief" mode, all scheduling nodes in the tree are displayed. > In "detail" mode, each node's configuration parameters are also displayed. > - > -Limitations or Known issues > ---------------------------- > - > -The Intel E810 requires a programmable pipeline package be downloaded > -by the driver to support normal operations. The E810 has a limited > -functionality built in to allow PXE boot and other use cases, but the > -driver must download a package file during the driver initialization > -stage. > - > -The default DDP package file name is ice.pkg. For a specific NIC, the > -DDP package supposed to be loaded can have a filename: ice-xxxxxx.pkg, > -where 'xxxxxx' is the 64-bit PCIe Device Serial Number of the NIC. For > -example, if the NIC's device serial number is 00-CC-BB-FF-FF-AA-05-68, > -the device-specific DDP package filename is ice-00ccbbffffaa0568.pkg > -(in hex and all low case). During initialization, the driver searches > -in the following paths in order: /lib/firmware/updates/intel/ice/ddp > -and /lib/firmware/intel/ice/ddp. The corresponding device-specific DDP > -package will be downloaded first if the file exists. If not, then the > -driver tries to load the default package. The type of loaded package > -is stored in ``ice_adapter->active_pkg_type``. > - > -A symbolic link to the DDP package file is also ok. The same package > -file is used by both the kernel driver and the DPDK PMD. > - > - .. Note:: > - > - Windows support: The DDP package is not supported on Windows so, > - loading of the package is disabled on Windows. > diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c > index 304f959b7e..f0389cc4ee 100644 > --- a/drivers/net/ice/ice_ethdev.c > +++ b/drivers/net/ice/ice_ethdev.c > @@ -1873,21 +1873,61 @@ ice_load_pkg_type(struct ice_hw *hw) > return package_type; > } > > +static int ice_read_customized_path(char *pkg_file, uint16_t buff_len) > +{ > + FILE *fp = fopen(ICE_PKG_FILE_CUSTOMIZED_PATH, "r"); > + int ret = 0; > + > + if (fp == NULL) { > + PMD_INIT_LOG(INFO, "Failed to read CUSTOMIZED_PATH"); > + return -EIO; > + } > + > + if (fgets(pkg_file, buff_len, fp) == NULL) { > + ret = -EIO; > + goto exit; > + } > + > + if (strlen(pkg_file) <= 1) > + goto exit; > + > + pkg_file[strlen(pkg_file) - 1] = '\0'; This line is unnecessary and, if it were necessary, also incorrect: * fgets already guarantees to null-terminate * if it didn't null terminate, then strlen wouldn't even work so this statement would be completely broken. Also, as this line is unnecessary, the lines above it, and the label below are unnecessary too. > +exit: > + fclose(fp); > + return ret; > +} > + > int ice_load_pkg(struct ice_adapter *adapter, bool use_dsn, uint64_t dsn) > { > struct ice_hw *hw = &adapter->hw; > char pkg_file[ICE_MAX_PKG_FILENAME_SIZE]; > + char customized_path[ICE_MAX_PKG_FILENAME_SIZE]; > char opt_ddp_filename[ICE_MAX_PKG_FILENAME_SIZE]; > void *buf; > size_t bufsz; > int err; > > - if (!use_dsn) > - goto no_dsn; > + ice_read_customized_path(customized_path, ICE_MAX_PKG_FILENAME_SIZE); > > memset(opt_ddp_filename, 0, ICE_MAX_PKG_FILENAME_SIZE); > snprintf(opt_ddp_filename, ICE_MAX_PKG_FILENAME_SIZE, > "ice-%016" PRIx64 ".pkg", dsn); > + > + if (strlen(customized_path) > 1) { Is this really the best way to check for validity of the search path? I would tend to ignore length and use the return value from the function "ice_read_customized_path". Again, maybe check the logic used in the kernel for validating the path read. > + if (use_dsn) { > + snprintf(pkg_file, RTE_DIM(pkg_file), > + "%s/%s", customized_path, opt_ddp_filename); > + if (rte_firmware_read(pkg_file, &buf, &bufsz) == 0) > + goto load_fw; > + } > + snprintf(pkg_file, RTE_DIM(pkg_file), "%s/%s", customized_path, "ice.pkg"); > + if (rte_firmware_read(pkg_file, &buf, &bufsz) == 0) > + goto load_fw; > + } > + > + if (!use_dsn) > + goto no_dsn; > + This is changing the search path logic compared to v4. Does it match what the kernel does in finding a package? > strncpy(pkg_file, ICE_PKG_FILE_SEARCH_PATH_UPDATES, > ICE_MAX_PKG_FILENAME_SIZE); > strcat(pkg_file, opt_ddp_filename); > diff --git a/drivers/net/ice/ice_ethdev.h b/drivers/net/ice/ice_ethdev.h > index 3ea9f37dc8..8b644ed700 100644 > --- a/drivers/net/ice/ice_ethdev.h > +++ b/drivers/net/ice/ice_ethdev.h > @@ -51,6 +51,7 @@ > #define ICE_PKG_FILE_UPDATES "/lib/firmware/updates/intel/ice/ddp/ice.pkg" > #define ICE_PKG_FILE_SEARCH_PATH_DEFAULT "/lib/firmware/intel/ice/ddp/" > #define ICE_PKG_FILE_SEARCH_PATH_UPDATES "/lib/firmware/updates/intel/ice/ddp/" > +#define ICE_PKG_FILE_CUSTOMIZED_PATH "/sys/module/firmware_class/parameters/path" > #define ICE_MAX_PKG_FILENAME_SIZE 256 > > #define MAX_ACL_NORMAL_ENTRIES 256 > -- > 2.34.1 >