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 7B0BA44018; Mon, 13 May 2024 11:47:16 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0C851402D1; Mon, 13 May 2024 11:47:16 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id B52D24028A for ; Mon, 13 May 2024 11:47:14 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1715593634; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=UoWu3fQHTqCBJ8HA5xiCuck1/dEsF0e+HRmAx/CZftQ=; b=RKJ2a3hTQnwF7SOusPOd8S8VPFVo2YenuwXRgcPAyJiKNGrTyELeXNJ9klJquOWYQEG4zs NbrE318KlKbZd5Av0uNN0LZL7wNZiD2tYCLqfMPyYFAocGhAg9T2knN0u+0mRJHgA2F7tM bwigENnqvg+Q1Iibeur1Gr/un9S3Jho= Received: from mail-lf1-f69.google.com (mail-lf1-f69.google.com [209.85.167.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-252-sIm9BiMwOIuVJkzzphk6MA-1; Mon, 13 May 2024 05:47:10 -0400 X-MC-Unique: sIm9BiMwOIuVJkzzphk6MA-1 Received: by mail-lf1-f69.google.com with SMTP id 2adb3069b0e04-51b0eed7614so2854514e87.1 for ; Mon, 13 May 2024 02:47:09 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715593628; x=1716198428; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=UoWu3fQHTqCBJ8HA5xiCuck1/dEsF0e+HRmAx/CZftQ=; b=cn+2oGblfhn8Z83bGkjGZfvMLTb1E4mJyKWlyzBkpYLgmqibZqqjsh7kEYTB3Y1t8t KbvK3NhyTAvcP0qBp3sBKW2a17g5o6d8vqg8ssuwLoxLqVHVV/DC2hGH8K8nlDPIxN8s KOe7uV2Jh3JIxnkAPpYiCyWmVVPhdYfjEBgoOlxwExyEALs1bNmSYKIZzK79ABtdiuo2 BJSTg2PYzsQtqxCHHIOI9vM4O/oCKWauOQZllzzilC4ULVLuSIlAvW7zAjB9+ADrIf2O 1PdtIoI5ZxZizD/mo8wTDY9GbZwfyHTvpyvnNhDv/cheMu62f1juOUYIttzz7nZQtUFm jYdg== X-Gm-Message-State: AOJu0Yx4o4oJOZRlatzh+HAb8/QYBcuiUKUPTs3+1qAkK5wdYod7CBO8 Iu7kZUEqiC0U/qsha9ATM9AgiW3SWAnEH+IjzmNsPwaImTO33eWiyZ+L0LSVUIb8BVmyc6yJ/Ry uzB8KObzPOrUJhhEmKKD/WjABvlBA/gK5GixukoYjzKPU9u+YJE4p+sIusm+ESOHjnVSGIwV6PE eFCP4W2ckc6VhF8sA= X-Received: by 2002:a05:6512:ea0:b0:520:676a:7322 with SMTP id 2adb3069b0e04-52210278595mr9583660e87.46.1715593628720; Mon, 13 May 2024 02:47:08 -0700 (PDT) X-Google-Smtp-Source: AGHT+IESOh9QIe/88gbjlGdNQ8lEzAUpKGzKqri8WdLl6kKqvxBYqeEfCDJB8lZM4Kx7Hq5r9K+weOqemOXoVwfZ1o0= X-Received: by 2002:a05:6512:ea0:b0:520:676a:7322 with SMTP id 2adb3069b0e04-52210278595mr9583639e87.46.1715593628364; Mon, 13 May 2024 02:47:08 -0700 (PDT) MIME-Version: 1.0 References: <20240508095214.2541115-1-david.marchand@redhat.com> In-Reply-To: From: David Marchand Date: Mon, 13 May 2024 11:46:56 +0200 Message-ID: Subject: Re: [PATCH] eal/unix: support ZSTD compression for firmwares To: Bruce Richardson Cc: dev@dpdk.org, Yu Jiang X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 Wed, May 8, 2024 at 12:50=E2=80=AFPM Bruce Richardson wrote: > > On Wed, May 08, 2024 at 11:52:14AM +0200, David Marchand wrote: > > Ubuntu 24.04 started to compress firmwares with ZSTD compression. > > > > Bugzilla ID: 1437 > > > > Signed-off-by: David Marchand > > --- > > lib/eal/unix/eal_firmware.c | 42 +++++++++++++++++++++++++++++-------- > > 1 file changed, 33 insertions(+), 9 deletions(-) > > > > diff --git a/lib/eal/unix/eal_firmware.c b/lib/eal/unix/eal_firmware.c > > index 1d47e879c8..065e251f9d 100644 > > --- a/lib/eal/unix/eal_firmware.c > > +++ b/lib/eal/unix/eal_firmware.c > > @@ -16,6 +16,21 @@ > > #include "eal_firmware.h" > > #include "eal_private.h" > > > > +#ifndef RTE_HAS_LIBARCHIVE > > +/* Fake definitions for the compression_algorithms array below. */ > > +struct archive; > > +extern int archive_read_support_filter_xz(struct archive *a); > > +extern int archive_read_support_filter_zstd(struct archive *a); > > +#endif > > + > > Do these not lead to unresolved symbols on link? Obviously yes... sorry, I was not thinking right and did really limited testing before sending (only compiled librte_eal.a). I'll fix this. > > > +static struct { > > + const char *suffix; > > + int (*support_callback)(struct archive *a); > > +} compression_algorithms[] =3D { > > + { "xz", archive_read_support_filter_xz, }, > > + { "zst", archive_read_support_filter_zstd, }, > > +}; > > + > > Rather than defining stubs for these functions from libarchive, can you > just have an empty list if no libarchive? > > struct archive; /* may need to be #ifdef'ed perhaps? */ > static struct { > const char *suffix; > int (*support_callback)(struct archive *a); > } compression_algorithms[] =3D { > #ifdef RTE_HAS_LIBARCHIVE > { "xz", archive_read_support_filter_xz, }, > { "zst", archive_read_support_filter_zstd, }, > #endif > }; That's an option, but then we lose a warning message to the user telling that some compressed files are on the system, and linking with libarchive could help. I think I'll keep an array of supported extensions and put explicit calls to archive_read_support_filter_xz/archive_read_support_filter_zstd under #ifdef. --=20 David Marchand