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 87BE042643; Tue, 26 Sep 2023 15:50:11 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 77A11402DF; Tue, 26 Sep 2023 15:50:11 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id C52E0402AA; Tue, 26 Sep 2023 15:50:09 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 38Q9xiDA012823; Tue, 26 Sep 2023 06:50:09 -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=Hp/lWOfc3IWVEqfeUSCl6zVNnPEcC9nQcHVOK3nXGLE=; b=Su6WYrxrPvrxTNKGpDYUvWakt7hjbEWKzObR27/f00tWkYC0tkGEkeM6ZaW8blRqL9bx cxUJIXqnQkFyY8IBTGQuJEnKrmHmKTDgbetGHG1WqF3TIFOxmKbX0nFg/NIvNwxNuDkQ yW4CbGKy5xbrcE8fBpsUTmP0FUh0X8SvpIuWxiflpvuJBGP8yylyjxprG551muKzDd7Y sY/gG6yJ78GypmBV64UO8HUHatljOIBznO0CbEl1C61GBdbMbXx9MVliY+ajrpiip2Uu hFmbWgwsWI4bU/Vp998T2uwlV6skC9mCmUkNpwLABRJjtmiRrfV78B4qnNBY6up5JZDO uQ== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3tbw5ggrmr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Tue, 26 Sep 2023 06:50:08 -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:50:07 -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:50:07 -0700 Received: from ml-host-33.caveonetworks.com (unknown [10.110.143.233]) by maili.marvell.com (Postfix) with ESMTP id 18AA73F70AB; Tue, 26 Sep 2023 06:50:07 -0700 (PDT) From: Srikanth Yalavarthi To: Aaron Conole , Igor Russkikh , David Marchand CC: , , , , , , Subject: [PATCH v3 1/1] eal: update xz read support and ignore warning Date: Tue, 26 Sep 2023 06:49:59 -0700 Message-ID: <20230926135000.31819-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: ZaMCmU1kPMQekYLyE1gUnf4oFo-q-Scj X-Proofpoint-ORIG-GUID: ZaMCmU1kPMQekYLyE1gUnf4oFo-q-Scj 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 --- v3: * removed gerrit change-id v2: * updated code as per review comments 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