patch 'eal/unix: support ZSTD compression for firmware' has been queued to stable release 23.11.2

Xueming Li xuemingl at nvidia.com
Fri Jul 12 12:43:49 CEST 2024


Hi,

FYI, your patch has been queued to stable release 23.11.2

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 07/14/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=d39af49b58a2c17edefa486ee906daf41986ab2b

Thanks.

Xueming Li <xuemingl at nvidia.com>

---
>From d39af49b58a2c17edefa486ee906daf41986ab2b Mon Sep 17 00:00:00 2001
From: David Marchand <david.marchand at redhat.com>
Date: Tue, 7 May 2024 13:01:53 +0200
Subject: [PATCH] eal/unix: support ZSTD compression for firmware
Cc: Xueming Li <xuemingl at nvidia.com>

[ upstream commit 6f80df8cb0f889203d7cd27766abcc6ebc720e33 ]

Ubuntu 24.04 started to compress firmware files with ZSTD compression.

Bugzilla ID: 1437

Signed-off-by: David Marchand <david.marchand at redhat.com>
Acked-by: Bruce Richardson <bruce.richardson at intel.com>
---
 lib/eal/unix/eal_firmware.c | 23 +++++++++++++++++------
 1 file changed, 17 insertions(+), 6 deletions(-)

diff --git a/lib/eal/unix/eal_firmware.c b/lib/eal/unix/eal_firmware.c
index 1a7cf8e7b7..33e989188e 100644
--- a/lib/eal/unix/eal_firmware.c
+++ b/lib/eal/unix/eal_firmware.c
@@ -15,6 +15,8 @@
 
 #include "eal_firmware.h"
 
+static const char * const compression_suffixes[] = { "xz", "zst" };
+
 #ifdef RTE_HAS_LIBARCHIVE
 
 struct firmware_read_ctx {
@@ -36,7 +38,11 @@ firmware_open(struct firmware_read_ctx *ctx, const char *name, size_t blocksize)
 
 	err = archive_read_support_filter_xz(ctx->a);
 	if (err != ARCHIVE_OK && err != ARCHIVE_WARN)
-		goto error;
+		RTE_LOG(DEBUG, EAL, "could not initialise libarchive for xz compression");
+
+	err = archive_read_support_filter_zstd(ctx->a);
+	if (err != ARCHIVE_OK && err != ARCHIVE_WARN)
+		RTE_LOG(DEBUG, EAL, "could not initialise libarchive for zstd compression");
 
 	if (archive_read_open_filename(ctx->a, name, blocksize) != ARCHIVE_OK)
 		goto error;
@@ -147,16 +153,21 @@ rte_firmware_read(const char *name, void **buf, size_t *bufsz)
 
 	ret = firmware_read(name, buf, bufsz);
 	if (ret < 0) {
-		snprintf(path, sizeof(path), "%s.xz", name);
-		path[PATH_MAX - 1] = '\0';
+		unsigned int i;
+
+		for (i = 0; i < RTE_DIM(compression_suffixes); i++) {
+			snprintf(path, sizeof(path), "%s.%s", name, compression_suffixes[i]);
+			path[PATH_MAX - 1] = '\0';
+			if (access(path, F_OK) != 0)
+				continue;
 #ifndef RTE_HAS_LIBARCHIVE
-		if (access(path, F_OK) == 0) {
 			RTE_LOG(WARNING, EAL, "libarchive not linked, %s cannot be decompressed\n",
 				path);
-		}
 #else
-		ret = firmware_read(path, buf, bufsz);
+			ret = firmware_read(path, buf, bufsz);
 #endif
+			break;
+		}
 	}
 	return ret;
 }
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-07-12 18:40:14.543349175 +0800
+++ 0003-eal-unix-support-ZSTD-compression-for-firmware.patch	2024-07-12 18:40:13.906594251 +0800
@@ -1 +1 @@
-From 6f80df8cb0f889203d7cd27766abcc6ebc720e33 Mon Sep 17 00:00:00 2001
+From d39af49b58a2c17edefa486ee906daf41986ab2b Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit 6f80df8cb0f889203d7cd27766abcc6ebc720e33 ]
@@ -9 +11,0 @@
-Cc: stable at dpdk.org
@@ -18 +20 @@
-index 1d47e879c8..0d69b1e3f0 100644
+index 1a7cf8e7b7..33e989188e 100644
@@ -21 +23,2 @@
-@@ -16,6 +16,8 @@
+@@ -15,6 +15,8 @@
+ 
@@ -23 +25,0 @@
- #include "eal_private.h"
@@ -30 +32 @@
-@@ -37,7 +39,11 @@ firmware_open(struct firmware_read_ctx *ctx, const char *name, size_t blocksize)
+@@ -36,7 +38,11 @@ firmware_open(struct firmware_read_ctx *ctx, const char *name, size_t blocksize)
@@ -35 +37 @@
-+		EAL_LOG(DEBUG, "could not initialise libarchive for xz compression");
++		RTE_LOG(DEBUG, EAL, "could not initialise libarchive for xz compression");
@@ -39 +41 @@
-+		EAL_LOG(DEBUG, "could not initialise libarchive for zstd compression");
++		RTE_LOG(DEBUG, EAL, "could not initialise libarchive for zstd compression");
@@ -43 +45 @@
-@@ -148,16 +154,21 @@ rte_firmware_read(const char *name, void **buf, size_t *bufsz)
+@@ -147,16 +153,21 @@ rte_firmware_read(const char *name, void **buf, size_t *bufsz)
@@ -58 +60 @@
- 			EAL_LOG(WARNING, "libarchive not linked, %s cannot be decompressed",
+ 			RTE_LOG(WARNING, EAL, "libarchive not linked, %s cannot be decompressed\n",


More information about the stable mailing list