> -----Original Message----- > From: David Marchand <david.march...@redhat.com> > Sent: 21 September 2023 18:57 > To: Srikanth Yalavarthi <syalavar...@marvell.com> > Cc: Jerin Jacob <jerinjac...@gmail.com>; Prince Takkar > <ptak...@marvell.com>; dev@dpdk.org; Shivah Shankar Shankar Narayan > Rao <sshankarn...@marvell.com>; Anup Prabhu <apra...@marvell.com> > Subject: Re: [EXT] Re: [PATCH v1 02/34] ml/cnxk: drop use of RTE API for > firmware read > > On Thu, Sep 21, 2023 at 3:06 PM Srikanth Yalavarthi > <syalavar...@marvell.com> wrote: > > > > > archive. This causes the ML firmware binary to be parsed > > > > > incorrectly. > > > > > > > > + @David Marchand rte_firmware_read() author for his opinions > > > > > > /lib/firmware/mlip-fw.bin does not seem to be something packaged in > > > Fedora, and I found no trace in linux-firmware repo, so I can't > > > reproduce your issue. > > > > > > Please add some debug and give more details about the issue you are > facing. > > > > The "/lib/firmware/mlip-fw.bin" is Marvell's ML firmware binary. This file > > is > in un-compressed form. > > > > When DPDK is built without libarchive support, No issues are observed with > using rte_firmware_read to load the firmware file as open and read system > calls are used. > > > > When libarchive support is enabled, rte_firmware_read tries to parse the > firmware binary as an xz archive. Since the file is not an archive, this step > is > failing. > > Please debug this part and point at the exact place where it fails.
When compiled with libarchive support, the code fails in firmware_open (lib/eal/unix/eal_firmware.c:24) function if (archive_read_support_format_raw(ctx->a) != ARCHIVE_OK || archive_read_support_filter_xz(ctx->a) != ARCHIVE_OK || archive_read_open_filename(ctx->a, name, blocksize) != ARCHIVE_OK || archive_read_next_header(ctx->a, &e) != ARCHIVE_OK) { archive_read_free(ctx->a); ctx->a = NULL; return -1; } I understand that all of the 4 checks in the if condition assume that the file is a compressed archive. i.e, they look for relevant metadata of a compressed archive. All 4 checks were failing when the file being read is a single uncompressed file (as in our case). And, when compiled without libarchive enabled, alternate firmware_open (lib/eal/unix/eal_firmware.c:63) is called, which works for the file that we are trying to read. Please correct me if my understanding is not correct. > > > > > Hence, added new ML driver function to read the firmware binary. > > This is just avoiding the issue without understanding it... > > > -- > David Marchand