DPDK patches and discussions
 help / color / mirror / Atom feed
From: David Marchand <david.marchand@redhat.com>
To: Bruce Richardson <bruce.richardson@intel.com>
Cc: dev@dpdk.org, Yu Jiang <yux.jiang@intel.com>
Subject: Re: [PATCH] eal/unix: support ZSTD compression for firmwares
Date: Mon, 13 May 2024 11:46:56 +0200	[thread overview]
Message-ID: <CAJFAV8zVBf_tB75=X3QPza9ztWDVYm0Fjb0HokRXRxJoATDjqw@mail.gmail.com> (raw)
In-Reply-To: <ZjtY2lPSrpo3q2oZ@bricha3-mobl1.ger.corp.intel.com>

On Wed, May 8, 2024 at 12:50 PM Bruce Richardson
<bruce.richardson@intel.com> 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 <david.marchand@redhat.com>
> > ---
> >  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[] = {
> > +     { "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[] = {
>   #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.


-- 
David Marchand


  parent reply	other threads:[~2024-05-13  9:47 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-08  9:52 David Marchand
2024-05-08 10:50 ` Bruce Richardson
2024-05-08 15:01   ` Bruce Richardson
2024-05-13  9:46   ` David Marchand [this message]
2024-05-13 11:12 ` [PATCH v2] eal/unix: support ZSTD compression for firmware David Marchand
2024-05-13 11:37   ` Bruce Richardson
2024-05-13 11:47     ` David Marchand
2024-05-17 17:01     ` David Marchand

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAJFAV8zVBf_tB75=X3QPza9ztWDVYm0Fjb0HokRXRxJoATDjqw@mail.gmail.com' \
    --to=david.marchand@redhat.com \
    --cc=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    --cc=yux.jiang@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).