patches for DPDK stable branches
 help / color / mirror / Atom feed
* [PATCH 1/3] net/i40e: compilation fix for GCC-12
@ 2022-08-23 10:57 Amit Prakash Shukla
  2022-08-23 10:57 ` [PATCH 2/3] net/qede/base: " Amit Prakash Shukla
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Amit Prakash Shukla @ 2022-08-23 10:57 UTC (permalink / raw)
  To: Yuying Zhang, Beilei Xing; +Cc: dev, jerinj, Amit Prakash Shukla, stable

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 <amitprakashs@marvell.com>
---
 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


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH 2/3] net/qede/base: compilation fix for GCC-12
  2022-08-23 10:57 [PATCH 1/3] net/i40e: compilation fix for GCC-12 Amit Prakash Shukla
@ 2022-08-23 10:57 ` Amit Prakash Shukla
  2022-08-23 10:57 ` [PATCH 3/3] examples/ipsec-secgw: " Amit Prakash Shukla
  2022-08-24 14:03 ` [PATCH 1/2] net/i40e: " Amit Prakash Shukla
  2 siblings, 0 replies; 11+ messages in thread
From: Amit Prakash Shukla @ 2022-08-23 10:57 UTC (permalink / raw)
  To: Rasesh Mody, Devendra Singh Rawat
  Cc: dev, jerinj, Amit Prakash Shukla, stable

GCC 12 raises the following warning:

../drivers/net/qede/base/ecore_init_fw_funcs.c: In function
'ecore_dmae_to_grc.constprop.isra':
../drivers/net/qede/base/ecore_init_fw_funcs.c:1418:25:
	error: array subscript 1 is outside array bounds of 'u32[1]'
	{aka 'unsigned int[1]'} [-Werror=array-bounds]
 1418 |                         ecore_wr(dev, ptt, ((addr) + (4 * i)),  \
      |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 1419 |                                  ((u32 *)&(arr))[i]);           \
      |                                  ~~~~~~~~~~~~~~~~~~~
../drivers/net/qede/base/ecore_init_fw_funcs.c:1465:17: note:
	in expansion of macro 'ARR_REG_WR'
 1465 |            ARR_REG_WR(p_hwfn, p_ptt, addr, pData, len_in_dwords);
      |            ^~~~~~~~~~
../drivers/net/qede/base/ecore_init_fw_funcs.c:1439:35:
	note: at offset 4 into object 'pData' of size 4
 1439 |                              u32 *pData,
      |                              ~~~~~^~~~~
cc1: all warnings being treated as errors

Fixes: 3b307c55f2ac (net/qede/base: update FW to 8.40.25.0)
Cc: stable@dpdk.org

Signed-off-by: Amit Prakash Shukla <amitprakashs@marvell.com>
---
 drivers/net/qede/base/ecore_init_fw_funcs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/qede/base/ecore_init_fw_funcs.c b/drivers/net/qede/base/ecore_init_fw_funcs.c
index 6a52f32cc9..4e4d1dc374 100644
--- a/drivers/net/qede/base/ecore_init_fw_funcs.c
+++ b/drivers/net/qede/base/ecore_init_fw_funcs.c
@@ -1416,7 +1416,7 @@ void ecore_init_brb_ram(struct ecore_hwfn *p_hwfn,
 		u32 i;						\
 		for (i = 0; i < (arr_size); i++)		\
 			ecore_wr(dev, ptt, ((addr) + (4 * i)),	\
-				 ((u32 *)&(arr))[i]);		\
+				 ((u32 *)(arr))[i]);		\
 	} while (0)
 
 #ifndef DWORDS_TO_BYTES
-- 
2.25.1


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH 3/3] examples/ipsec-secgw: compilation fix for GCC-12
  2022-08-23 10:57 [PATCH 1/3] net/i40e: compilation fix for GCC-12 Amit Prakash Shukla
  2022-08-23 10:57 ` [PATCH 2/3] net/qede/base: " Amit Prakash Shukla
@ 2022-08-23 10:57 ` Amit Prakash Shukla
  2022-08-23 13:12   ` Akhil Goyal
  2022-08-24 14:03 ` [PATCH 1/2] net/i40e: " Amit Prakash Shukla
  2 siblings, 1 reply; 11+ messages in thread
From: Amit Prakash Shukla @ 2022-08-23 10:57 UTC (permalink / raw)
  To: Ruifeng Wang, Radu Nicolau, Akhil Goyal
  Cc: dev, jerinj, Amit Prakash Shukla, stable

GCC 12 raises the following warning:

meson --werror --buildtype=debugoptimized --cross-file
	config/arm/arm64_armv8_linux_gcc -Ddefault_library=shared
	-Dexamples=all build
ninja -C build

In file included from ../examples/ipsec-secgw/ipsec_lpm_neon.h:9,
                 from ../examples/ipsec-secgw/ipsec_worker.c:16:
In function 'send_multi_pkts',
    inlined from 'route6_pkts_neon' at
../examples/ipsec-secgw/ipsec_lpm_neon.h:170:2,
    inlined from 'ipsec_poll_mode_wrkr_inl_pr' at
../examples/ipsec-secgw/ipsec_worker.c:1257:4:
../examples/ipsec-secgw/ipsec_neon.h:261:21: error: 'dst_port' may be used
uninitialized [-Werror=maybe-uninitialized]
  261 |                 dlp = dst_port[i - 1];
      |                 ~~~~^~~~~~~~~~~~~~~~~
In file included from ../examples/ipsec-secgw/ipsec_worker.c:16:
../examples/ipsec-secgw/ipsec_worker.c: In function
'ipsec_poll_mode_wrkr_inl_pr':
../examples/ipsec-secgw/ipsec_lpm_neon.h:118:17:
	note: 'dst_port' declared here
  118 |         int32_t dst_port[MAX_PKT_BURST];
      |                 ^~~~~~~~

Fixes: ce23f7ceec6b (examples/ipsec-secgw: add support of NEON with poll mode)
Cc: stable@dpdk.org

Signed-off-by: Amit Prakash Shukla <amitprakashs@marvell.com>
---
 examples/ipsec-secgw/ipsec_lpm_neon.h | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/examples/ipsec-secgw/ipsec_lpm_neon.h b/examples/ipsec-secgw/ipsec_lpm_neon.h
index 959a5a8666..25f0abcaf3 100644
--- a/examples/ipsec-secgw/ipsec_lpm_neon.h
+++ b/examples/ipsec-secgw/ipsec_lpm_neon.h
@@ -115,7 +115,7 @@ static inline void
 route6_pkts_neon(struct rt_ctx *rt_ctx, struct rte_mbuf **pkts, int nb_rx)
 {
 	uint8_t dst_ip6[MAX_PKT_BURST][16];
-	int32_t dst_port[MAX_PKT_BURST];
+	uint16_t dst_port[MAX_PKT_BURST];
 	struct rte_ether_hdr *eth_hdr;
 	struct rte_ipv6_hdr *ipv6_hdr;
 	int32_t hop[MAX_PKT_BURST];
@@ -157,17 +157,15 @@ route6_pkts_neon(struct rt_ctx *rt_ctx, struct rte_mbuf **pkts, int nb_rx)
 		pkt = pkts[i];
 		if (pkt->ol_flags & RTE_MBUF_F_TX_SEC_OFFLOAD) {
 			/* Read hop from the SA */
-			dst_port[i] = get_hop_for_offload_pkt(pkt, 1);
+			dst_port[i] = (uint16_t)get_hop_for_offload_pkt(pkt, 1);
 		} else {
 			/* Need to use hop returned by lookup */
-			dst_port[i] = hop[lpm_pkts++];
+			dst_port[i] = (uint16_t)hop[lpm_pkts++];
 		}
-		if (dst_port[i] == -1)
-			dst_port[i] = BAD_PORT;
 	}
 
 	/* Send packets */
-	send_multi_pkts(pkts, (uint16_t *)dst_port, nb_rx, 0, 0, false);
+	send_multi_pkts(pkts, dst_port, nb_rx, 0, 0, false);
 }
 
 /*
-- 
2.25.1


^ permalink raw reply	[flat|nested] 11+ messages in thread

* RE: [PATCH 3/3] examples/ipsec-secgw: compilation fix for GCC-12
  2022-08-23 10:57 ` [PATCH 3/3] examples/ipsec-secgw: " Amit Prakash Shukla
@ 2022-08-23 13:12   ` Akhil Goyal
  0 siblings, 0 replies; 11+ messages in thread
From: Akhil Goyal @ 2022-08-23 13:12 UTC (permalink / raw)
  To: Amit Prakash Shukla, Ruifeng Wang, Radu Nicolau
  Cc: dev, Jerin Jacob Kollanukkaran, Amit Prakash Shukla, stable

[-- Attachment #1: Type: text/plain, Size: 2932 bytes --]

> GCC 12 raises the following warning:
> 
> meson --werror --buildtype=debugoptimized --cross-file
> 	config/arm/arm64_armv8_linux_gcc -Ddefault_library=shared
> 	-Dexamples=all build
> ninja -C build
> 
> In file included from ../examples/ipsec-secgw/ipsec_lpm_neon.h:9,
>                  from ../examples/ipsec-secgw/ipsec_worker.c:16:
> In function 'send_multi_pkts',
>     inlined from 'route6_pkts_neon' at
> ../examples/ipsec-secgw/ipsec_lpm_neon.h:170:2,
>     inlined from 'ipsec_poll_mode_wrkr_inl_pr' at
> ../examples/ipsec-secgw/ipsec_worker.c:1257:4:
> ../examples/ipsec-secgw/ipsec_neon.h:261:21: error: 'dst_port' may be used
> uninitialized [-Werror=maybe-uninitialized]
>   261 |                 dlp = dst_port[i - 1];
>       |                 ~~~~^~~~~~~~~~~~~~~~~
> In file included from ../examples/ipsec-secgw/ipsec_worker.c:16:
> ../examples/ipsec-secgw/ipsec_worker.c: In function
> 'ipsec_poll_mode_wrkr_inl_pr':
> ../examples/ipsec-secgw/ipsec_lpm_neon.h:118:17:
> 	note: 'dst_port' declared here
>   118 |         int32_t dst_port[MAX_PKT_BURST];
>       |                 ^~~~~~~~
> 
> Fixes: ce23f7ceec6b (examples/ipsec-secgw: add support of NEON with poll
> mode)
> Cc: stable@dpdk.org
> 
> Signed-off-by: Amit Prakash Shukla <amitprakashs@marvell.com>
> ---
>  examples/ipsec-secgw/ipsec_lpm_neon.h | 10 ++++------
>  1 file changed, 4 insertions(+), 6 deletions(-)
> 
> diff --git a/examples/ipsec-secgw/ipsec_lpm_neon.h b/examples/ipsec-
> secgw/ipsec_lpm_neon.h
> index 959a5a8666..25f0abcaf3 100644
> --- a/examples/ipsec-secgw/ipsec_lpm_neon.h
> +++ b/examples/ipsec-secgw/ipsec_lpm_neon.h
> @@ -115,7 +115,7 @@ static inline void
>  route6_pkts_neon(struct rt_ctx *rt_ctx, struct rte_mbuf **pkts, int nb_rx)
>  {
>  	uint8_t dst_ip6[MAX_PKT_BURST][16];
> -	int32_t dst_port[MAX_PKT_BURST];
> +	uint16_t dst_port[MAX_PKT_BURST];
>  	struct rte_ether_hdr *eth_hdr;
>  	struct rte_ipv6_hdr *ipv6_hdr;
>  	int32_t hop[MAX_PKT_BURST];
> @@ -157,17 +157,15 @@ route6_pkts_neon(struct rt_ctx *rt_ctx, struct
> rte_mbuf **pkts, int nb_rx)
>  		pkt = pkts[i];
>  		if (pkt->ol_flags & RTE_MBUF_F_TX_SEC_OFFLOAD) {
>  			/* Read hop from the SA */
> -			dst_port[i] = get_hop_for_offload_pkt(pkt, 1);
> +			dst_port[i] = (uint16_t)get_hop_for_offload_pkt(pkt,
> 1);
>  		} else {
>  			/* Need to use hop returned by lookup */
> -			dst_port[i] = hop[lpm_pkts++];
> +			dst_port[i] = (uint16_t)hop[lpm_pkts++];
>  		}
> -		if (dst_port[i] == -1)
> -			dst_port[i] = BAD_PORT;

get_hop_for_offload_pkt is returning -1, can you also return BAD_PORT from that
if there is error. And you would not need to typecast it explicitly to uin16_t.

>  	}
> 
>  	/* Send packets */
> -	send_multi_pkts(pkts, (uint16_t *)dst_port, nb_rx, 0, 0, false);
> +	send_multi_pkts(pkts, dst_port, nb_rx, 0, 0, false);
>  }
> 
>  /*
> --
> 2.25.1


[-- Attachment #2: winmail.dat --]
[-- Type: application/ms-tnef, Size: 14937 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH 1/2] net/i40e: compilation fix for GCC-12
  2022-08-23 10:57 [PATCH 1/3] net/i40e: compilation fix for GCC-12 Amit Prakash Shukla
  2022-08-23 10:57 ` [PATCH 2/3] net/qede/base: " Amit Prakash Shukla
  2022-08-23 10:57 ` [PATCH 3/3] examples/ipsec-secgw: " Amit Prakash Shukla
@ 2022-08-24 14:03 ` Amit Prakash Shukla
  2022-08-24 14:03   ` [PATCH 2/2] net/qede/base: " Amit Prakash Shukla
                     ` (3 more replies)
  2 siblings, 4 replies; 11+ messages in thread
From: Amit Prakash Shukla @ 2022-08-24 14:03 UTC (permalink / raw)
  To: Yuying Zhang, Beilei Xing; +Cc: dev, jerinj, stable, Amit Prakash Shukla

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 <amitprakashs@marvell.com>
---
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);
 
-- 
2.25.1


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH 2/2] net/qede/base: compilation fix for GCC-12
  2022-08-24 14:03 ` [PATCH 1/2] net/i40e: " Amit Prakash Shukla
@ 2022-08-24 14:03   ` Amit Prakash Shukla
  2022-10-06  9:52     ` Thomas Monjalon
  2022-08-25  7:21   ` [PATCH 1/2] net/i40e: " Morten Brørup
                     ` (2 subsequent siblings)
  3 siblings, 1 reply; 11+ messages in thread
From: Amit Prakash Shukla @ 2022-08-24 14:03 UTC (permalink / raw)
  To: Rasesh Mody, Devendra Singh Rawat
  Cc: dev, jerinj, stable, Amit Prakash Shukla

GCC 12 raises the following warning:

../drivers/net/qede/base/ecore_init_fw_funcs.c: In function
'ecore_dmae_to_grc.constprop.isra':
../drivers/net/qede/base/ecore_init_fw_funcs.c:1418:25:
	error: array subscript 1 is outside array bounds of 'u32[1]'
	{aka 'unsigned int[1]'} [-Werror=array-bounds]
 1418 |                         ecore_wr(dev, ptt, ((addr) + (4 * i)),  \
      |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 1419 |                                  ((u32 *)&(arr))[i]);           \
      |                                  ~~~~~~~~~~~~~~~~~~~
../drivers/net/qede/base/ecore_init_fw_funcs.c:1465:17: note:
	in expansion of macro 'ARR_REG_WR'
 1465 |            ARR_REG_WR(p_hwfn, p_ptt, addr, pData, len_in_dwords);
      |            ^~~~~~~~~~
../drivers/net/qede/base/ecore_init_fw_funcs.c:1439:35:
	note: at offset 4 into object 'pData' of size 4
 1439 |                              u32 *pData,
      |                              ~~~~~^~~~~
cc1: all warnings being treated as errors

Fixes: 3b307c55f2ac (net/qede/base: update FW to 8.40.25.0)
Cc: stable@dpdk.org

Signed-off-by: Amit Prakash Shukla <amitprakashs@marvell.com>
---
 drivers/net/qede/base/ecore_init_fw_funcs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/qede/base/ecore_init_fw_funcs.c b/drivers/net/qede/base/ecore_init_fw_funcs.c
index 6a52f32cc9..4e4d1dc374 100644
--- a/drivers/net/qede/base/ecore_init_fw_funcs.c
+++ b/drivers/net/qede/base/ecore_init_fw_funcs.c
@@ -1416,7 +1416,7 @@ void ecore_init_brb_ram(struct ecore_hwfn *p_hwfn,
 		u32 i;						\
 		for (i = 0; i < (arr_size); i++)		\
 			ecore_wr(dev, ptt, ((addr) + (4 * i)),	\
-				 ((u32 *)&(arr))[i]);		\
+				 ((u32 *)(arr))[i]);		\
 	} while (0)
 
 #ifndef DWORDS_TO_BYTES
-- 
2.25.1


^ permalink raw reply	[flat|nested] 11+ messages in thread

* RE: [PATCH 1/2] net/i40e: compilation fix for GCC-12
  2022-08-24 14:03 ` [PATCH 1/2] net/i40e: " Amit Prakash Shukla
  2022-08-24 14:03   ` [PATCH 2/2] net/qede/base: " Amit Prakash Shukla
@ 2022-08-25  7:21   ` Morten Brørup
  2022-08-26  9:45   ` Amit Prakash Shukla
  2022-10-06  9:51   ` Thomas Monjalon
  3 siblings, 0 replies; 11+ messages in thread
From: Morten Brørup @ 2022-08-25  7:21 UTC (permalink / raw)
  To: Amit Prakash Shukla, Yuying Zhang, Beilei Xing; +Cc: dev, jerinj, stable

> From: Amit Prakash Shukla [mailto:amitprakashs@marvell.com]
> Sent: Wednesday, 24 August 2022 16.04
> 
> 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 <amitprakashs@marvell.com>
> ---
> 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))

Does this compile with the correct static branch prediction? If not, please add unlikely() to error checks like this.

> +			goto not_sup;
> +
>  		item_hdr = pattern_item_header[last_item_type];
>  		assert(item_hdr);
> 
> --
> 2.25.1
> 


^ permalink raw reply	[flat|nested] 11+ messages in thread

* RE: [PATCH 1/2] net/i40e: compilation fix for GCC-12
  2022-08-24 14:03 ` [PATCH 1/2] net/i40e: " Amit Prakash Shukla
  2022-08-24 14:03   ` [PATCH 2/2] net/qede/base: " Amit Prakash Shukla
  2022-08-25  7:21   ` [PATCH 1/2] net/i40e: " Morten Brørup
@ 2022-08-26  9:45   ` Amit Prakash Shukla
  2022-08-26 10:32     ` Morten Brørup
  2022-10-06  9:51   ` Thomas Monjalon
  3 siblings, 1 reply; 11+ messages in thread
From: Amit Prakash Shukla @ 2022-08-26  9:45 UTC (permalink / raw)
  To: Amit Prakash Shukla, Yuying Zhang, Beilei Xing, mb
  Cc: dev, Jerin Jacob Kollanukkaran, stable

Thanks Morten for the review comment. 

As the change is not in datapath, branch prediction optimization was not done.

> -----Original Message-----
> From: Amit Prakash Shukla <amitprakashs@marvell.com>
> Sent: Wednesday, August 24, 2022 7:34 PM
> To: Yuying Zhang <Yuying.Zhang@intel.com>; Beilei Xing
> <beilei.xing@intel.com>
> Cc: dev@dpdk.org; Jerin Jacob Kollanukkaran <jerinj@marvell.com>;
> stable@dpdk.org; Amit Prakash Shukla <amitprakashs@marvell.com>
> Subject: [PATCH 1/2] net/i40e: compilation fix for GCC-12
> 
> 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 <amitprakashs@marvell.com>
> ---
> 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);
> 
> --
> 2.25.1


^ permalink raw reply	[flat|nested] 11+ messages in thread

* RE: [PATCH 1/2] net/i40e: compilation fix for GCC-12
  2022-08-26  9:45   ` Amit Prakash Shukla
@ 2022-08-26 10:32     ` Morten Brørup
  0 siblings, 0 replies; 11+ messages in thread
From: Morten Brørup @ 2022-08-26 10:32 UTC (permalink / raw)
  To: Amit Prakash Shukla, Yuying Zhang, Beilei Xing
  Cc: dev, Jerin Jacob Kollanukkaran, stable

> From: Amit Prakash Shukla [mailto:amitprakashs@marvell.com]
> Sent: Friday, 26 August 2022 11.45
> 
> Thanks Morten for the review comment.
> 
> As the change is not in datapath, branch prediction optimization was
> not done.

OK. Then I agree that it is not required.

> 
> > -----Original Message-----
> > From: Amit Prakash Shukla <amitprakashs@marvell.com>
> > Sent: Wednesday, August 24, 2022 7:34 PM
> >
> > 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 <amitprakashs@marvell.com>
> > ---
> > 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);
> >
> > --
> > 2.25.1
> 


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 1/2] net/i40e: compilation fix for GCC-12
  2022-08-24 14:03 ` [PATCH 1/2] net/i40e: " Amit Prakash Shukla
                     ` (2 preceding siblings ...)
  2022-08-26  9:45   ` Amit Prakash Shukla
@ 2022-10-06  9:51   ` Thomas Monjalon
  3 siblings, 0 replies; 11+ messages in thread
From: Thomas Monjalon @ 2022-10-06  9:51 UTC (permalink / raw)
  To: Amit Prakash Shukla
  Cc: Yuying Zhang, Beilei Xing, stable, dev, jerinj, stable

24/08/2022 16:03, Amit Prakash Shukla:
> 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 <amitprakashs@marvell.com>

Sorry I did not notice this patch and I recently submitted one
which I will abandon.
It seems there was no reply from i40e maintainers after 6 weeks,
but I will apply anyway.

I will use my commit message:

    net/i40e: fix build with MinGW GCC 12
    
    When compiling with MinGW GCC 12,
    the rte_flow_item array is seen as read out of bound:
    
    net/i40e/i40e_hash.c:389:47: error:
    	array subscript 50 is above array bounds of ‘const uint64_t[50]’
    	{aka ‘const long long unsigned int[50]’} [-Werror=array-bounds]
    	389 | item_hdr = pattern_item_header[last_item_type];
    	    |            ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~
    
    It seems the assert check done above this line has no impact.
    A real check is added to make the compiler happy.
    
    Fixes: ef4c16fd9148 ("net/i40e: refactor RSS flow")
    Cc: stable@dpdk.org




^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 2/2] net/qede/base: compilation fix for GCC-12
  2022-08-24 14:03   ` [PATCH 2/2] net/qede/base: " Amit Prakash Shukla
@ 2022-10-06  9:52     ` Thomas Monjalon
  0 siblings, 0 replies; 11+ messages in thread
From: Thomas Monjalon @ 2022-10-06  9:52 UTC (permalink / raw)
  To: Amit Prakash Shukla
  Cc: Rasesh Mody, Devendra Singh Rawat, stable, dev, jerinj

24/08/2022 16:03, Amit Prakash Shukla:
> GCC 12 raises the following warning:
> 
> ../drivers/net/qede/base/ecore_init_fw_funcs.c: In function
> 'ecore_dmae_to_grc.constprop.isra':
> ../drivers/net/qede/base/ecore_init_fw_funcs.c:1418:25:
> 	error: array subscript 1 is outside array bounds of 'u32[1]'
> 	{aka 'unsigned int[1]'} [-Werror=array-bounds]
>  1418 |                         ecore_wr(dev, ptt, ((addr) + (4 * i)),  \
>       |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>  1419 |                                  ((u32 *)&(arr))[i]);           \
>       |                                  ~~~~~~~~~~~~~~~~~~~
> ../drivers/net/qede/base/ecore_init_fw_funcs.c:1465:17: note:
> 	in expansion of macro 'ARR_REG_WR'
>  1465 |            ARR_REG_WR(p_hwfn, p_ptt, addr, pData, len_in_dwords);
>       |            ^~~~~~~~~~
> ../drivers/net/qede/base/ecore_init_fw_funcs.c:1439:35:
> 	note: at offset 4 into object 'pData' of size 4
>  1439 |                              u32 *pData,
>       |                              ~~~~~^~~~~
> cc1: all warnings being treated as errors
> 
> Fixes: 3b307c55f2ac (net/qede/base: update FW to 8.40.25.0)
> Cc: stable@dpdk.org
> 
> Signed-off-by: Amit Prakash Shukla <amitprakashs@marvell.com>

Sorry I did not notice this patch and I recently submitted one
which I will abandon.
It seems there was no reply from qede maintainers after 6 weeks,
but I will apply anyway.

I will use my commit message:

    net/qede/base: fix 32-bit build with GCC 12
    
    A pointer is passed to a macro and it seems mistakenly referenced.
    This issue is seen only when compiling with GCC 12 for 32-bit:
    
    drivers/net/qede/base/ecore_init_fw_funcs.c:1418:25:
            error: array subscript 1 is outside array bounds of ‘u32[1]’
            {aka ‘unsigned int[1]’} [-Werror=array-bounds]
     1418 |                 ecore_wr(dev, ptt, ((addr) + (4 * i)),  \
          |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     1419 |                          ((u32 *)&(arr))[i]);           \
          |                          ~~~~~~~~~~~~~~~~~~~
    drivers/net/qede/base/ecore_init_fw_funcs.c:1465:17:
            note: in expansion of macro ‘ARR_REG_WR’
     1465 |         ARR_REG_WR(p_hwfn, p_ptt, addr, pData, len_in_dwords);
          |         ^~~~~~~~~~
    drivers/net/qede/base/ecore_init_fw_funcs.c:1439:35:
            note: at offset 4 into object ‘pData’ of size 4
     1439 |                              u32 *pData,
          |                              ~~~~~^~~~~
    
    Fixes: 3b307c55f2ac ("net/qede/base: update FW to 8.40.25.0")
    Cc: stable@dpdk.org




^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2022-10-06  9:53 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-23 10:57 [PATCH 1/3] net/i40e: compilation fix for GCC-12 Amit Prakash Shukla
2022-08-23 10:57 ` [PATCH 2/3] net/qede/base: " Amit Prakash Shukla
2022-08-23 10:57 ` [PATCH 3/3] examples/ipsec-secgw: " Amit Prakash Shukla
2022-08-23 13:12   ` Akhil Goyal
2022-08-24 14:03 ` [PATCH 1/2] net/i40e: " Amit Prakash Shukla
2022-08-24 14:03   ` [PATCH 2/2] net/qede/base: " Amit Prakash Shukla
2022-10-06  9:52     ` Thomas Monjalon
2022-08-25  7:21   ` [PATCH 1/2] net/i40e: " Morten Brørup
2022-08-26  9:45   ` Amit Prakash Shukla
2022-08-26 10:32     ` Morten Brørup
2022-10-06  9:51   ` Thomas Monjalon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).