From patchwork Wed Aug 24 14:03:38 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Prakash Shukla X-Patchwork-Id: 115377 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id C36EAA0543; Wed, 24 Aug 2022 16:03:50 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5E09340DDE; Wed, 24 Aug 2022 16:03:50 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id 5DA004067B; Wed, 24 Aug 2022 16:03:48 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 27O926cJ022330; Wed, 24 Aug 2022 07:03:47 -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=ko4zL1rEhQMsKl1sNq601PMl0YGZ6kfYFJfhH1D6ZDo=; b=XP4Il2gM0/D7HOayxNmX6U6JU8NXHTgSvicU5f4by7fA19OT9U2bOwnATg8kzlTf5bKi /Mm6QwzsXEEpDLYT5r3cH3pdWyKkJ1v2nPiKqadTtPOWXz/nWf/mnDr+2epWwTxO5/7R fdmqvrWJTU2RN6uP9nbodxka7pK2ckOL7/XxKeVE4n6YvvPSJkwYqj1vqTV8sNt1wqNB WWA3kdqxwi7K9P2UVmW8Srgp36lNLEjOJ77pthrFsWSHDiSXH4Flz8by94+iSda2aNcD ph14qz/2JHLrRufQ0/8beebfpheQDWzX3I/HRA1hioaU1QGrydwV5YXjeCYbdwXh+N1L TA== Received: from dc5-exch01.marvell.com ([199.233.59.181]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3j4x5h5kyg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Wed, 24 Aug 2022 07:03:47 -0700 Received: from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 24 Aug 2022 07:03:45 -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.18 via Frontend Transport; Wed, 24 Aug 2022 07:03:45 -0700 Received: from localhost.localdomain (unknown [10.28.36.157]) by maili.marvell.com (Postfix) with ESMTP id 6917A3F703F; Wed, 24 Aug 2022 07:03:43 -0700 (PDT) From: Amit Prakash Shukla To: Yuying Zhang , Beilei Xing CC: , , , "Amit Prakash Shukla" Subject: [PATCH 1/2] net/i40e: compilation fix for GCC-12 Date: Wed, 24 Aug 2022 19:33:38 +0530 Message-ID: <20220824140339.2581716-1-amitprakashs@marvell.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220823105742.2276506-1-amitprakashs@marvell.com> References: <20220823105742.2276506-1-amitprakashs@marvell.com> MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: _H0-QOt6zThi_vvR5B1fSEjLrkE_K_Ui X-Proofpoint-GUID: _H0-QOt6zThi_vvR5B1fSEjLrkE_K_Ui X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.517,FMLib:17.11.122.1 definitions=2022-08-24_07,2022-08-22_02,2022-06-22_01 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 GCC 12 raises the following warning: meson --werror --buildtype=debugoptimized --cross-file config/x86/cross-mingw -Dexamples=helloworld build ninja -C build In function 'i40e_hash_get_pattern_type', inlined from 'i40e_hash_get_pattern_pctypes' at ../drivers/net/i40e/i40e_hash.c:520:8, inlined from 'i40e_hash_parse_pattern_act' at ../drivers/net/i40e/i40e_hash.c:1147:9, inlined from 'i40e_hash_parse' at ../drivers/net/i40e/i40e_hash.c:1181:9: ../drivers/net/i40e/i40e_hash.c:389:47: error: array subscript 53 is above array bounds of 'const uint64_t[53]' {aka 'const long long unsigned int[53]'} [-Werror=array-bounds] 389 | item_hdr = pattern_item_header[last_item_type]; | ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~ ../drivers/net/i40e/i40e_hash.c: In function 'i40e_hash_parse': ../drivers/net/i40e/i40e_hash.c:182:23: note: while referencing 'pattern_item_header' 182 | static const uint64_t pattern_item_header[] = { | ^~~~~~~~~~~~~~~~~~~ cc1: all warnings being treated as errors Fixes: ef4c16fd9148 (net/i40e: refactor RSS flow) Cc: stable@dpdk.org Signed-off-by: Amit Prakash Shukla --- v2: - Removed "examples/ipsec-secgw" patch from this series and posted it as seperate patch. drivers/net/i40e/i40e_hash.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/net/i40e/i40e_hash.c b/drivers/net/i40e/i40e_hash.c index 8962e9d97a..a1ff85fceb 100644 --- a/drivers/net/i40e/i40e_hash.c +++ b/drivers/net/i40e/i40e_hash.c @@ -384,8 +384,10 @@ i40e_hash_get_pattern_type(const struct rte_flow_item pattern[], } prev_item_type = last_item_type; - assert(last_item_type < (enum rte_flow_item_type) - RTE_DIM(pattern_item_header)); + if (last_item_type >= (enum rte_flow_item_type) + RTE_DIM(pattern_item_header)) + goto not_sup; + item_hdr = pattern_item_header[last_item_type]; assert(item_hdr);