Re: [dpdk-dev] [PATCH v3 2/2] eal: handle compressed firmwares
From: David Marchand <hidden>
Date: 2021-07-05 06:54:26
On Mon, Jul 5, 2021 at 8:35 AM Wang, Haiyue [off-list ref] wrote:
quoted
+int +rte_firmware_read(const char *name, void **buf, size_t *bufsz) +{ + char path[PATH_MAX]; + int ret; + + ret = firmware_read(name, buf, bufsz); + if (ret < 0) { + snprintf(path, sizeof(path), "%s.xz", name); + path[PATH_MAX - 1] = '\0'; +#ifndef RTE_HAS_LIBARCHIVE + if (access(path, F_OK) == 0) { + RTE_LOG(WARNING, EAL, "libarchive not available, %s cannot be decompressed\n", + path); + } +#else + ret = firmware_read(path, buf, bufsz); +#endif + } + return ret; +}Since ice PMD needs to check if the firmware file with different name can be accessed by some kind of order, before doing the final firmware selection. Should we also add the firmware access API for handling this ?
I don't see the need. Is the behavior changed for net/ice with this patch? -- David Marchand