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 11F4142643; Tue, 26 Sep 2023 15:30:34 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 31E41402EF; Tue, 26 Sep 2023 15:30:33 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id 11BAD40271; Tue, 26 Sep 2023 15:30:30 +0200 (CEST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 38QA2egj000381; Tue, 26 Sep 2023 06:30:30 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=pfpt0220; bh=tIVDN1v2H0/R9P4E15aNxKjdRl8+7hkWYqArO3P4m0U=; b=CMFMCpF51j86g8E3rLUmEKw7WfohvOzob/oPnSLlcNCWAKKtaU3TSd2w1wp890JJz1mb VJ8zqNEBgI1KPk4920Zc3d7qZa1Uab0Jwcyzo0icuDUmuekAg0Hv+ndaPyQLijxH/6V3 BtY6LIkl1YhDjAX104PAqZQGvpBjnYWHn/p9k10wSHaCTdxjKnWEZQz0wnEKXwO88f9r w2qEEHA0GxTf5JG49qwJ9/M/Mh0VA3kTtxrJSWocxEdFEIGGxuMIEGxFkoqNiFgRc5Yj Rj20TF3QhHKHYQhKzdGa4v32LsKuAlhGPEc4gDMP2vwY5+I1ZSitK+yT9DwUQmFk0Kta wQ== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3t9yhm14d4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Tue, 26 Sep 2023 06:30:30 -0700 Received: from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.48; Tue, 26 Sep 2023 06:30:11 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server id 15.0.1497.48 via Frontend Transport; Tue, 26 Sep 2023 06:30:11 -0700 Received: from ml-host-33.caveonetworks.com (unknown [10.110.143.233]) by maili.marvell.com (Postfix) with ESMTP id 08D115B692B; Tue, 26 Sep 2023 06:30:11 -0700 (PDT) From: Srikanth Yalavarthi To: David Marchand , Aaron Conole , Igor Russkikh CC: , , , , , , Subject: [PATCH v2 1/1] eal: update xz read support and ignore warning Date: Tue, 26 Sep 2023 06:30:06 -0700 Message-ID: <20230926133006.31534-1-syalavarthi@marvell.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230922165356.31567-1-syalavarthi@marvell.com> References: <20230922165356.31567-1-syalavarthi@marvell.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-GUID: RQ_D9oyjP5P5UCSWPsLGl5HbFw4sBMr4 X-Proofpoint-ORIG-GUID: RQ_D9oyjP5P5UCSWPsLGl5HbFw4sBMr4 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.267,Aquarius:18.0.980,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-09-26_10,2023-09-26_01,2023-05-22_02 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 archive_read_support_filter_xz returns a warning when compression is not fully supported and is supported through external program. This warning can be ignored when reading the files through firmware open as only decompression is required. Fixes: 40edb9c0d36b ("eal: handle compressed firmware") Cc: stable@dpdk.org Signed-off-by: Srikanth Yalavarthi Change-Id: I38cce556ec637af03dbde74d7d18318af48082d6 --- lib/eal/unix/eal_firmware.c | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/lib/eal/unix/eal_firmware.c b/lib/eal/unix/eal_firmware.c index d1616b0bd9..16690b4245 100644 --- a/lib/eal/unix/eal_firmware.c +++ b/lib/eal/unix/eal_firmware.c @@ -25,19 +25,31 @@ static int firmware_open(struct firmware_read_ctx *ctx, const char *name, size_t blocksize) { struct archive_entry *e; + int err; ctx->a = archive_read_new(); if (ctx->a == NULL) return -1; - 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; - } + + if (archive_read_support_format_raw(ctx->a) != ARCHIVE_OK) + goto error; + + err = archive_read_support_filter_xz(ctx->a); + if (err != ARCHIVE_OK && err != ARCHIVE_WARN) + goto error; + + if (archive_read_open_filename(ctx->a, name, blocksize) != ARCHIVE_OK) + goto error; + + if (archive_read_next_header(ctx->a, &e)) + goto error; + return 0; + +error: + archive_read_free(ctx->a); + ctx->a = NULL; + return -1; } static ssize_t -- 2.41.0