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 F1F874555A for ; Wed, 3 Jul 2024 09:12:11 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E666540E45; Wed, 3 Jul 2024 09:12:11 +0200 (CEST) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2061.outbound.protection.outlook.com [40.107.237.61]) by mails.dpdk.org (Postfix) with ESMTP id 32B3D4003C; Wed, 3 Jul 2024 09:12:09 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mQCpgcNNrSy2ywF3TQB2g7RI+d0nUvtOJJgaJcr7tQ9yo5tcTjt7PcZeBQRf+iPE/VcRa2pgn1vb+btGjYea55b40nr5EAEma0hwSD5wL1p7Qdy4+C8/kSLpZ04esPKq1Bb4KIOBdouNsS7JLJH8+kIKIU5MTeJ4klQ/AJFuxvUh6vd5Zxo5pa/euamAw3cWmdlNuXUY+ukl/WhQTe99qZ864HH97FnJSnEzf7gmSfyx90Vk3ZrjcyeQZJNaFdvEqAe4Vyrh2EDcwzO5gg41MdnfDCpva9r2mD6rnjKJf1Hg0BTk+WGM7KKqOGx+Ehxj3ceYBo2gdibr2dPhPZ34oA== 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=NHR33yS2rDtFjg6Ux9rCMPJ6TJ4BZ5mdBKAv6F3dyG0=; b=kJ0fRT8OV96313Pak0S0e4QL3jet6XwfWDApmIqM+nCwgJzkNZq34n4Er1CohjVa42dTwlSWumsjIYICPAxw4ZeAMk+nJr3jVU+g7yDhVoE8e90Q5oGg8OawpbOvR+GcCQnh3IVvtjvnpYhzcd7wTJSUjx4cdftpr6gn2tFTf725YqrGAb3aUUs0Vw11zEFeR9f3lmujYYVuMNiUW6lbfqM3EvidBX8cBEfChYpEc3EvqZt+MlJNECQGV2rRmibkDVDWSozMRmoBC8G1gg1PoYl8pcXBh+ZTbRR/BIeI+Ltv6qXrEG/ygsfb51CgwE1KC6yNgp2EvKB9+h3XqTjIbA== 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=NHR33yS2rDtFjg6Ux9rCMPJ6TJ4BZ5mdBKAv6F3dyG0=; b=bCD7u/hw0qR2bfbhPXKyfMryUArC14hxFHy3X6CAZ4njeOzvrhkPtUhEiMoUurdGhIvNLug3xma+yQmVqfTzoATEx5FJ9akXveMUMdSZZYHLkqK0OYKMdp0RYHesJ5c6JaPt8suyy48fKDnBlkQ7QDPMbiXXwIB5/T08LYFyPkFAPMGESLTDTlFk9HTKT5eYKmiIkuyXypkN5oaeF7frssJVCQU2Bi3ZZCHuFgw9vVD/zsMz4K7rnpSqQ9J5xI9ItmW1juTb0GR1odZwZb8LAI50rEsPiGXFYJmf3BsHS9qZLf8RTCxSGfNBAgkc+U88nJDrmhnBvHsjXBf+595lDQ== Received: from DM4PR12MB5373.namprd12.prod.outlook.com (2603:10b6:5:39d::14) by LV8PR12MB9232.namprd12.prod.outlook.com (2603:10b6:408:182::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7741.23; Wed, 3 Jul 2024 07:12:05 +0000 Received: from DM4PR12MB5373.namprd12.prod.outlook.com ([fe80::79ae:2610:e503:b15b]) by DM4PR12MB5373.namprd12.prod.outlook.com ([fe80::79ae:2610:e503:b15b%5]) with mapi id 15.20.7741.017; Wed, 3 Jul 2024 07:12:05 +0000 From: Xueming Li To: David Marchand , "dev@dpdk.org" CC: Yu Jiang , Bruce Richardson , "stable@dpdk.org" Subject: Re: [PATCH v2] eal/unix: support ZSTD compression for firmware Thread-Topic: [PATCH v2] eal/unix: support ZSTD compression for firmware Thread-Index: AQHapSZqArjGKGJfyEuhQd7w5MZAa7Hk5aTh Date: Wed, 3 Jul 2024 07:12:05 +0000 Message-ID: References: <20240508095214.2541115-1-david.marchand@redhat.com> <20240513111204.3120460-1-david.marchand@redhat.com> In-Reply-To: <20240513111204.3120460-1-david.marchand@redhat.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: 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: DM4PR12MB5373:EE_|LV8PR12MB9232:EE_ x-ms-office365-filtering-correlation-id: c236a71a-5aa0-4b25-320f-08dc9b2f71aa x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; ARA:13230040|376014|1800799024|366016|38070700018; x-microsoft-antispam-message-info: =?iso-8859-1?Q?tnnH5hemKtaERTsDHZ9HiAy+1Fia1dlVujEYLwMm3qjo4xcYje3K04vQUB?= =?iso-8859-1?Q?kO3HM+PTqZW0baaxyil7Na3yj/VIfAtmBpawJgkrnNJ2dUN+sEkrgMIozJ?= =?iso-8859-1?Q?KOHqI0zsMmEaFTQNE3MjV2VD/6ZD4sWx2e+ZlviV2uQnsFP7SzeUFeqriA?= =?iso-8859-1?Q?/sqQ3nnfTSei3PIfiqrfwspKkA69O6oIbCzKrAh2Y34Jk+JjLVPshaHF2g?= =?iso-8859-1?Q?0mk7K1WhXzpGlzaByJS71dT9jz7Tq/aU4pYmJAKKl3NuOs6XfXXIz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isJCHjNQFk5/dbQxiZoEsVRiXF1ZeW?= =?iso-8859-1?Q?fOf8yVTlPAwX9ZLGQrBWNcxMMaodrGXLGchUkmosIq5rPo4aukbKBf+kiJ?= =?iso-8859-1?Q?HpDMyYJ19M5fUHa4pRTfNvAiUPV8D3bgtEdlBYTLdJWgwnxeFfX9ANvYKp?= =?iso-8859-1?Q?8PblmK0sH1AcKQ0/THFyN757qPnYjFOS7wx7uacGdcQSm3GtUoohkzjIKM?= =?iso-8859-1?Q?plPj0GDTRNyZyIiihiUy9++g9VRRPx07TRx9gaVnmA7kybVlD7Vd90cals?= =?iso-8859-1?Q?LQn7wE/plG8x++L+dp6/+Ezyr6BO+rLAGAoF3Q=3D=3D?= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM4PR12MB5373.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(376014)(1800799024)(366016)(38070700018); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?Q?2/rc7whH4kh7H6CFFPlAS8BNJJwxMoyxdB+VdGrQHexLyRlrOLThz0cVpB?= =?iso-8859-1?Q?OcOxYcsbvSz91u97zSlTrGCj44JbdLP1IvSMKecHePluILcJ4kFRTXHuC7?= =?iso-8859-1?Q?pD3W7uCGMiBA5zSta8hxxVPLogGc5OwHRHtzFFkAQ403SPI+qgPpS7lMpo?= =?iso-8859-1?Q?wtQ+QGyL78yw644zi47oKmfI4056NBKH52Ivm7qyJrffWPJxDe6sOzj6Vt?= =?iso-8859-1?Q?0QuX6vv+Tfr7piMqL9rcUJFW2Rk5Mpncg8N3DWDeWW/hDZmx4n9BDba70t?= =?iso-8859-1?Q?lVwcXy/R2XNQvnVhtIl5Czq2r8FeqXluspqIRUzRuIE8WT5o89rhyeIapb?= =?iso-8859-1?Q?7+tZqF24gNZUVCUpY+ubbKFY9X+74yAHG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Q?fGEe7su8BtUCAlJXBHxSlU9mhvvQ0Ns8a+k5N5BFlaRzn7n+8w1gtv66Gv?= =?iso-8859-1?Q?qaJ6l4hJ2t7f7+agRthEQrdJzh7evoSGNNl++AGOCR1kWbHgA3Uyjxb3Ky?= =?iso-8859-1?Q?V5FjOoESgrcKljbCE3XN6Aa977VBAt2AcaEOEUpp6p3+o2Z4jofiG63TrU?= =?iso-8859-1?Q?aMcKwkCCKh+bdr6YbvtIs4hGSPV3MPmWF/ctmgoZ7VFT96iNjnKirg8K6U?= =?iso-8859-1?Q?b2hxMO2duROuYKfIMFmdyXlZnkAtquYjBVbuQs9yFijGTumjwGYVCPl0sn?= =?iso-8859-1?Q?JnqvcDXwMBKKDDd+nSgWtj0QXdgdDAD8DlCDc2W3E0oj1O/+u/AwW7o5lA?= =?iso-8859-1?Q?BKTten0ZUAup/alOnpwL6pzw5ogs9yxukK?= Content-Type: multipart/alternative; boundary="_000_DM4PR12MB5373AFFF61373DD92F766ED9A1DD2DM4PR12MB5373namp_" MIME-Version: 1.0 X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM4PR12MB5373.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: c236a71a-5aa0-4b25-320f-08dc9b2f71aa X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Jul 2024 07:12:05.2044 (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: M0YHwEZQs483it7BMFTLiXpiHnQeJba3xEuv6ci0w6a1Q1PeICBieZrHs2Pugo9jXQb0lkitR4RyGX4emNULxw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV8PR12MB9232 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 --_000_DM4PR12MB5373AFFF61373DD92F766ED9A1DD2DM4PR12MB5373namp_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi David, I get unix compilation failure when backporting this patch to 23.11 LTS, th= e EAL_LOG macro is not backported to 23.11 LTS, any suggestion? Regards, Xueming ________________________________ From: David Marchand Sent: Monday, May 13, 2024 7:12 PM To: dev@dpdk.org Cc: Yu Jiang ; Bruce Richardson ; stable@dpdk.org Subject: [PATCH v2] eal/unix: support ZSTD compression for firmware Ubuntu 24.04 started to compress firmware files with ZSTD compression. Bugzilla ID: 1437 Cc: stable@dpdk.org Signed-off-by: David Marchand --- Chances since v1: - fixed link issue when libarchive is not available, - Cc'd stable@dpdk.org, --- lib/eal/unix/eal_firmware.c | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/lib/eal/unix/eal_firmware.c b/lib/eal/unix/eal_firmware.c index 1d47e879c8..31de027598 100644 --- a/lib/eal/unix/eal_firmware.c +++ b/lib/eal/unix/eal_firmware.c @@ -16,6 +16,8 @@ #include "eal_firmware.h" #include "eal_private.h" +static const char * const compression_algorithms[] =3D { "xz", "zst" }; + #ifdef RTE_HAS_LIBARCHIVE struct firmware_read_ctx { @@ -37,7 +39,11 @@ firmware_open(struct firmware_read_ctx *ctx, const char = *name, size_t blocksize) err =3D archive_read_support_filter_xz(ctx->a); if (err !=3D ARCHIVE_OK && err !=3D ARCHIVE_WARN) - goto error; + EAL_LOG(DEBUG, "could not initialise libarchive for xz comp= ression"); + + err =3D archive_read_support_filter_zstd(ctx->a); + if (err !=3D ARCHIVE_OK && err !=3D ARCHIVE_WARN) + EAL_LOG(DEBUG, "could not initialise libarchive for zstd co= mpression"); if (archive_read_open_filename(ctx->a, name, blocksize) !=3D ARCHI= VE_OK) goto error; @@ -148,16 +154,22 @@ rte_firmware_read(const char *name, void **buf, size_= t *bufsz) ret =3D firmware_read(name, buf, bufsz); if (ret < 0) { - snprintf(path, sizeof(path), "%s.xz", name); - path[PATH_MAX - 1] =3D '\0'; + unsigned int i; + + for (i =3D 0; i < RTE_DIM(compression_algorithms); i++) { + snprintf(path, sizeof(path), "%s.%s", name, + compression_algorithms[i]); + path[PATH_MAX - 1] =3D '\0'; + if (access(path, F_OK) !=3D 0) + continue; #ifndef RTE_HAS_LIBARCHIVE - if (access(path, F_OK) =3D=3D 0) { EAL_LOG(WARNING, "libarchive not linked, %s cannot= be decompressed", path); - } #else - ret =3D firmware_read(path, buf, bufsz); + ret =3D firmware_read(path, buf, bufsz); #endif + break; + } } return ret; } -- 2.44.0 --_000_DM4PR12MB5373AFFF61373DD92F766ED9A1DD2DM4PR12MB5373namp_ Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Hi David,

I get unix compilation failure when backporting this patch to 23.11 LTS, th= e EAL_LOG macro is not backported to 23.11 LTS, any suggestion?

Regards,
Xueming


Ubuntu 24.04 start= ed to compress firmware files with ZSTD compression.

Bugzilla ID: 1437
Cc: stable@dpdk.org

Signed-off-by: David Marchand <david.marchand@redhat.com>
---
Chances since v1:
- fixed link issue when libarchive is not available,
- Cc'd stable@dpdk.org,

---
 lib/eal/unix/eal_firmware.c | 24 ++++++++++++++++++------
 1 file changed, 18 insertions(+), 6 deletions(-)

diff --git a/lib/eal/unix/eal_firmware.c b/lib/eal/unix/eal_firmware.c
index 1d47e879c8..31de027598 100644
--- a/lib/eal/unix/eal_firmware.c
+++ b/lib/eal/unix/eal_firmware.c
@@ -16,6 +16,8 @@
 #include "eal_firmware.h"
 #include "eal_private.h"
 
+static const char * const compression_algorithms[] =3D { "xz", &= quot;zst" };
+
 #ifdef RTE_HAS_LIBARCHIVE
 
 struct firmware_read_ctx {
@@ -37,7 +39,11 @@ firmware_open(struct firmware_read_ctx *ctx, const char = *name, size_t blocksize)
 
         err =3D archive_read_suppo= rt_filter_xz(ctx->a);
         if (err !=3D ARCHIVE_OK &a= mp;& err !=3D ARCHIVE_WARN)
-            &n= bsp;  goto error;
+            &n= bsp;  EAL_LOG(DEBUG, "could not initialise libarchive for xz comp= ression");
+
+       err =3D archive_read_support_filter_z= std(ctx->a);
+       if (err !=3D ARCHIVE_OK && er= r !=3D ARCHIVE_WARN)
+            &n= bsp;  EAL_LOG(DEBUG, "could not initialise libarchive for zstd co= mpression");
 
         if (archive_read_open_file= name(ctx->a, name, blocksize) !=3D ARCHIVE_OK)
            &nb= sp;    goto error;
@@ -148,16 +154,22 @@ rte_firmware_read(const char *name, void **buf, size_= t *bufsz)
 
         ret =3D firmware_read(name= , buf, bufsz);
         if (ret < 0) {
-            &n= bsp;  snprintf(path, sizeof(path), "%s.xz", name);
-            &n= bsp;  path[PATH_MAX - 1] =3D '\0';
+            &n= bsp;  unsigned int i;
+
+            &n= bsp;  for (i =3D 0; i < RTE_DIM(compression_algorithms); i++) {
+            &n= bsp;          snprintf(path, s= izeof(path), "%s.%s", name,
+            &n= bsp;            = ;      compression_algorithms[i]);
+            &n= bsp;          path[PATH_MAX - = 1] =3D '\0';
+            &n= bsp;          if (access(path,= F_OK) !=3D 0)
+            &n= bsp;            = ;      continue;
 #ifndef RTE_HAS_LIBARCHIVE
-            &n= bsp;  if (access(path, F_OK) =3D=3D 0) {
            &nb= sp;            EAL_L= OG(WARNING, "libarchive not linked, %s cannot be decompressed",             &nb= sp;            =         path);
-            &n= bsp;  }
 #else
-            &n= bsp;  ret =3D firmware_read(path, buf, bufsz);
+            &n= bsp;          ret =3D firmware= _read(path, buf, bufsz);
 #endif
+            &n= bsp;          break;
+            &n= bsp;  }
         }
         return ret;
 }
--
2.44.0

--_000_DM4PR12MB5373AFFF61373DD92F766ED9A1DD2DM4PR12MB5373namp_--