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 89482A0C41; Mon, 5 Jul 2021 03:43:21 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 35A0440686; Mon, 5 Jul 2021 03:43:21 +0200 (CEST) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by mails.dpdk.org (Postfix) with ESMTP id C5C9E40141 for ; Mon, 5 Jul 2021 03:43:19 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10035"; a="188591999" X-IronPort-AV: E=Sophos;i="5.83,325,1616482800"; d="scan'208";a="188591999" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Jul 2021 18:43:17 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.83,325,1616482800"; d="scan'208";a="562362347" Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by fmsmga001.fm.intel.com with ESMTP; 04 Jul 2021 18:43:17 -0700 Received: from orsmsx609.amr.corp.intel.com (10.22.229.22) 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.2242.4; Sun, 4 Jul 2021 18:43:17 -0700 Received: from orsedg603.ED.cps.intel.com (10.7.248.4) by orsmsx609.amr.corp.intel.com (10.22.229.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.4 via Frontend Transport; Sun, 4 Jul 2021 18:43:17 -0700 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (104.47.55.102) by edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2242.4; Sun, 4 Jul 2021 18:43:12 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CLlhYJiptwxWiDkkvrMHiwztc3bm31fcKRJJc6AseJY7QKulLAlSEBLQBogAUGDf2UEWmev/Xm+2cgxb9UU8j7euw8eoPmULexhAOL0zMuCcikEKHwpvEWlZLLMzHW2EHuBpI6r1Wk00trlaeWg4NNwAG61q4fTbdgW/+0d0+x0bzxq0saXtJ4A/uZeLlDEZjwC7mW3c1/qCegq8ixfxwJqXOLvtROb5cumriGF9bZoQ8uvIwFlFxOIWAqsLVVtnPyZMqNHU8jDuH7w4XYH7Fd45d1OKy23Pj8vzAD7rM3w7/Gpadv389uOayv8T/BHXv0yalNtXXbGSOZgQJkzi5g== 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-SenderADCheck; bh=LPaVyn0yzLPztcBl+xxorNn65loD4Zd07le0gxK1RSs=; b=B8OvgS16o1w3zBru5QoW61ZjTYSUz8usOtlZYUak8T0jqbXAy1SRhCLGjbfVwFTIemItpDBpTMaecpzbeZiVex5Y8TZHq0fhPZ07tDQPHxDZJhO+KbDmU/1Hi51lrQJWLRpwLx4bOUW/Uvy0+tdv2w68If4zHEXh4M+vt2h+DCcwnP+ct8LrYgaz/2JckhSlqIdZScohvBxKd1XP/RDyFxWTuDMhm18NdRnYuFAcwpxcWdRWV+KUASeAaPwfvm9V28yXgjEXIPD8p0ThpDKEj1KoomwP/X5ZjN4iGGIDMIAsiaCKy/79ycB9Sl7PzDPYIpXNTXW+QNMHy7TPBFtXTA== 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=LPaVyn0yzLPztcBl+xxorNn65loD4Zd07le0gxK1RSs=; b=J+t6A8EOBh8XG+LFxb0PnVSexT89NzW7bC8up9ffOqvVmJGI7Bjn4pugJ9kj+udo4W0z4tMV7LJ2lpvix9qAgUZszWkzBywC7r6OBOayGYCmnKFX549U9ldpPSVLuTYu64sgiVEFsOsXTRTuE+fJqw5QRjrf8Hx5nRimnv0FBRg= Received: from BN8PR11MB3795.namprd11.prod.outlook.com (2603:10b6:408:82::31) by BN6PR1101MB2113.namprd11.prod.outlook.com (2603:10b6:405:51::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4287.32; Mon, 5 Jul 2021 01:43:03 +0000 Received: from BN8PR11MB3795.namprd11.prod.outlook.com ([fe80::8807:6661:e425:102]) by BN8PR11MB3795.namprd11.prod.outlook.com ([fe80::8807:6661:e425:102%7]) with mapi id 15.20.4287.033; Mon, 5 Jul 2021 01:43:03 +0000 From: "Wang, Haiyue" To: David Marchand , "dev@dpdk.org" CC: "Yang, Qiming" , "Zhang, Qi Z" Thread-Topic: [dpdk-dev] [PATCH v3 1/2] net/ice: factorize firmware loading Thread-Index: AQHXbL3LHM6wvHCgqECmshcrHyKK1Kszo0VA Date: Mon, 5 Jul 2021 01:43:03 +0000 Message-ID: References: <20210602095836.24901-1-david.marchand@redhat.com> <20210629080632.30964-1-david.marchand@redhat.com> <20210629080632.30964-2-david.marchand@redhat.com> In-Reply-To: <20210629080632.30964-2-david.marchand@redhat.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-reaction: no-action dlp-version: 11.6.0.76 authentication-results: redhat.com; dkim=none (message not signed) header.d=none;redhat.com; dmarc=none action=none header.from=intel.com; x-originating-ip: [192.55.46.54] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: ec99c161-db4d-44b9-0f44-08d93f563ad5 x-ms-traffictypediagnostic: BN6PR1101MB2113: x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:9508; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: Lz9Z7CFejbH4p8ZGB4nq2F1+PyLj6r9REL/tn/mD7ZzNgoLJ8mZQLkllKbvrw4fL/XLXoRJB3DLFeIqWhDRO/6sHvoqbuQP2HV+WY7qTpFWXUxd8DlCZEcFC8FWC+B7pjANeu5Olk2waSzyXVRT8YCGdDYHrSnuxF3muEOi4WDVkBLoNHqnzUH/aVJjJ1YbHv8pqQ4KOLgwttziMIcofEv3Quw4mlDGPRF39GaJQkwc1LtxEn9W2RUYfKjGfm2vIiIhP+TxgSzzSaqVLGDZ/s8tS/2lIcGULOGm+CGsAXs4otASnYs4t77PbgTALgRK1mnDwsxctmP4uaql0Hon3rDh6jRcFJJN10uMw+fOiZqV3ypMAhGRkYCfbIE6pgsv3ZLAAl80oIzI6VpWl3hcXWvE2odiMcucznN+ha7hx9D7KJ1PHGM46Yr2TkVYo74URZn9KJvDmtnGtnUa/2LJYU+chsIhGloGiQG1RgcwGJAGt8Vfg+g2RCXskqTVNnLrHcsaZlTOIcPRjXJ2w8Y4SiY/MMmClXGkG4iacmsXBz7jK2XpXu/yeO5qG/e9HIQRP9EWohlgwqa/EYPW0C79/cJsPHEZtrBS/UEVIQdUge9dr2edC6NqIf+cR2Y6Wlbwh0hKArkuYQlSKFbBQA1In5w== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BN8PR11MB3795.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(39860400002)(396003)(136003)(346002)(366004)(376002)(478600001)(8676002)(83380400001)(186003)(86362001)(9686003)(66476007)(5660300002)(55016002)(2906002)(4326008)(8936002)(122000001)(66946007)(26005)(66556008)(71200400001)(33656002)(76116006)(53546011)(54906003)(110136005)(6506007)(38100700002)(66446008)(107886003)(64756008)(316002)(7696005)(52536014); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?CnNjBjsjVQRTX+1SaS0J1bzgeGYkFbEc79hBHd+yor2lBRyxdzznpfzVjc0m?= =?us-ascii?Q?uM+mbn0rex6oX1KQXCALOZHmnFqpv4k1hXeSkXPS02Vrhjes7WLw0xDf3cK4?= =?us-ascii?Q?3Gclz34LPkTaabLdiY6MN8BbuhYsejGKSBrAympmMztd6EPW+495oV8CD/FF?= =?us-ascii?Q?3mWTDpcpgLg9m2OQHn1Ah3PYp+rVWXfZVOzCKOhskn1cEHXgn6jQfMruKUpQ?= =?us-ascii?Q?LA3XKkLyvsD63ngiIkx+09Il6HPfDqY6PnnqHXSp5RcRqAFZpQU7h64EEXOV?= =?us-ascii?Q?Qh790EhklK+HWAfNPmOtpaRtQO4m8GhpnSJLi0u03AQhwasISNae5eYcyHAZ?= =?us-ascii?Q?BVqvy12bSrA9HtNW3RN87h9+9ObT3Ai/I5yD5dJ3kt6nalXZxjHbD4o7NSYi?= =?us-ascii?Q?YVQSwA8HKVjjQfAYrCRRrtux5VO3sjuKq+1Hn3aYaexKBCA85SgbzQ7Ja60Z?= =?us-ascii?Q?KmX4snADov3Rl+jeyE16H66JdeZYz1FDrvSk7TJaEFoQqhTBZsJxsk6Zo68H?= =?us-ascii?Q?s+UWsB6EFGVVq8ulhyPCBG0U9gBxKrF6ePXdV95Lf5fSdkdLsUdOkQc1Mawy?= =?us-ascii?Q?4fGyL8P40dLUaJiNbnf/xd56fiyJMnlDqb4M3hh8pxyG/l72cPMWR/s1sxST?= =?us-ascii?Q?6fOch2AOLDITEcwpvUN6lpuEB+eUHXVEO+jyIlDQJVe99j9azXeJJDpTxPfX?= =?us-ascii?Q?aflVcjM12ktKRxJQtMhKudwsi7Oz43bGBFMUAkkHZeQs4WmC5aORzCk7VHU9?= =?us-ascii?Q?XvNIChOW4xkxmiO1fOctM/uXaVLTnCOqbUSM86whJ+qcd9RRdKwAy72E78nV?= =?us-ascii?Q?SaxIP92j8NI2O7AzTmIQKOTrCujygnIePSSKlWb01CikrBt8nBIg7oa3dsGY?= =?us-ascii?Q?awX4X85Gt+hIocefGNEeF4/ZIn2lN9cvbYuaH2C0/KevS90e06AauGgjKnhz?= =?us-ascii?Q?ZyNq0osR8bcdoNXhgucuR/NuA64AZNieSS6Op49sZQyItSbp7fwQT5mrlCF2?= =?us-ascii?Q?spKGMICLuNXvVFnJ0TT6DJyAjpGno96Z9Cn5A9rlRlD3Enwm9KBbVKYiBHeD?= =?us-ascii?Q?Dw88IZgJR+XGt5yNR1uZEdy0h4tyb5/SLPdhAYAkVr34zR+K5BpM1MH0cg48?= =?us-ascii?Q?BxvdK7ANCvdttOEekXGca0tLqQvPouUbZkFUqCeVjV44qvycfjYFmTIP0DER?= =?us-ascii?Q?lzJYF2S2X72vP1syFFUZQO67Ont/V5PEzhpNpZTmmJuFIaVtozSJgxwyGqW6?= =?us-ascii?Q?2kcTkWxKbPLNtTrTr4xR2s22uXy8P8RFaHrYrF0Afcwaz7fLz9JFsQaK68Qv?= =?us-ascii?Q?I0g=3D?= 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: BN8PR11MB3795.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: ec99c161-db4d-44b9-0f44-08d93f563ad5 X-MS-Exchange-CrossTenant-originalarrivaltime: 05 Jul 2021 01:43:03.4355 (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: MJWZ36DXYQaIAUabqnMY6oPFQ4qNwiU68keR5kzKWaKalGgOwDIv6jvCQofr7oSWGOzCTwyg+fHOaid3vuiPWw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR1101MB2113 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH v3 1/2] net/ice: factorize firmware loading 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 Sender: "dev" Hi David, > -----Original Message----- > From: dev On Behalf Of David Marchand > Sent: Tuesday, June 29, 2021 16:07 > To: dev@dpdk.org > Cc: Yang, Qiming ; Zhang, Qi Z > Subject: [dpdk-dev] [PATCH v3 1/2] net/ice: factorize firmware loading >=20 > Both "normal" and "dcf" inits have their copy of some firmware loading > code. >=20 > The DSN query is moved in specific parts for the "normal" and "dcf" init. >=20 > A common helper ice_load_pkg is then introduced and takes an adapter > pointer as its main input. >=20 > This helper takes care of finding the right firmware file and loading > it. > The adapter active_pkg_type field is set by this helper. >=20 > The ice_access macro is removed from the osdep.h header: osdep.h should > only hosts wrappers for base driver code. >=20 > Signed-off-by: David Marchand > --- > drivers/net/ice/base/ice_osdep.h | 6 -- > drivers/net/ice/ice_dcf_parent.c | 97 ++----------------- > drivers/net/ice/ice_ethdev.c | 161 +++++++++++++++---------------- > drivers/net/ice/ice_ethdev.h | 3 +- > 4 files changed, 88 insertions(+), 179 deletions(-) >=20 > + if (!use_dsn) > + goto no_dsn; > + > + memset(opt_ddp_filename, 0, ICE_MAX_PKG_FILENAME_SIZE); > + snprintf(opt_ddp_filename, ICE_MAX_PKG_FILENAME_SIZE, > + "ice-%016" PRIx64 ".pkg", dsn); > + strncpy(pkg_file, ICE_PKG_FILE_SEARCH_PATH_UPDATES, > + ICE_MAX_PKG_FILENAME_SIZE); > + if (!ice_access(strcat(pkg_file, opt_ddp_filename), 0)) > + goto load_fw; > + > + strncpy(pkg_file, ICE_PKG_FILE_SEARCH_PATH_DEFAULT, > + ICE_MAX_PKG_FILENAME_SIZE); > + if (!ice_access(strcat(pkg_file, opt_ddp_filename), 0)) > + goto load_fw; > + > +no_dsn: > + strncpy(pkg_file, ICE_PKG_FILE_UPDATES, ICE_MAX_PKG_FILENAME_SIZE); > + if (!ice_access(pkg_file, 0)) > + goto load_fw; > + strncpy(pkg_file, ICE_PKG_FILE_DEFAULT, ICE_MAX_PKG_FILENAME_SIZE); > + if (ice_access(pkg_file, 0)) { > PMD_INIT_LOG(ERR, "failed to search file path\n"); > - return err; > + return -1; > } >=20 > +load_fw: > file =3D fopen(pkg_file, "rb"); > if (!file) { > PMD_INIT_LOG(ERR, "failed to open file: %s\n", pkg_file); > return -1; > } >=20 I'm wondering what's full name for ice firmware in F34, has any *.xz postfix ? If so, the search method will also needs to be updated, since we will check each file can be accessed:=20 #define ICE_PKG_FILE_DEFAULT "/lib/firmware/intel/ice/ddp/ice.pkg" #define ICE_PKG_FILE_UPDATES "/lib/firmware/updates/intel/ice/ddp/ice.pkg" > 2.23.0