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 07615A04FD for ; Tue, 23 Aug 2022 12:57:58 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id EFA48410F2; Tue, 23 Aug 2022 12:57:57 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id A7839400D6; Tue, 23 Aug 2022 12:57:55 +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 27NAIJcj025034; Tue, 23 Aug 2022 03:57:54 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding : content-type; s=pfpt0220; bh=iRhuMeED5SHTTcbJ27qmgUfW5j/td51VslfcG0ZS+kI=; b=Wo7rgh4uNsMbxjNQNuIirvAeghQcX96lb0NwQnk070ilmFll9vtFagUEES7NRAknYqoC T/Aeqc2zxzJwRE2bVYtNwSm8bMYWipyOhnaSlwjFo1RVpNHqRNUu5SDGzs8AlxIj/1mR 5LcjNqjvs8Jt4y50bkyxbqaXmb5FEoeXyVzIAgTesnUo+cxpR9nnZwr5xucyoAaHMCkW 9hLOZeBhI3wG8/iZo5McT7AlaGlInsLkq2mBvPwdHmkqQuPilJBZj8x6NTrMrqBebKyn M4tA7hL6OKjhkCUn68EOe0ixsg68vO3/fYEo3CnTGr08264jm7CCKGPKvRkSIN4njbTW tg== Received: from dc5-exch01.marvell.com ([199.233.59.181]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3j4ubj8hm5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Tue, 23 Aug 2022 03:57:54 -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; Tue, 23 Aug 2022 03:57:53 -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; Tue, 23 Aug 2022 03:57:53 -0700 Received: from localhost.localdomain (unknown [10.28.36.157]) by maili.marvell.com (Postfix) with ESMTP id 1184A5B6929; Tue, 23 Aug 2022 03:57:50 -0700 (PDT) From: Amit Prakash Shukla To: Yuying Zhang , Beilei Xing CC: , , Amit Prakash Shukla , Subject: [PATCH 1/3] net/i40e: compilation fix for GCC-12 Date: Tue, 23 Aug 2022 16:27:40 +0530 Message-ID: <20220823105742.2276506-1-amitprakashs@marvell.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-GUID: VFj7oaSLdTK2HgNdiJuhKim3Xd3OcOAb X-Proofpoint-ORIG-GUID: VFj7oaSLdTK2HgNdiJuhKim3Xd3OcOAb 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-23_04,2022-08-22_02,2022-06-22_01 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-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 --- 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); -- 2.25.1