DPDK patches and discussions
 help / color / mirror / Atom feed
From: Akhil Goyal <gakhil@marvell.com>
To: Amit Prakash Shukla <amitprakashs@marvell.com>,
	Ruifeng Wang <ruifeng.wang@arm.com>,
	Radu Nicolau <radu.nicolau@intel.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>,
	Jerin Jacob Kollanukkaran <jerinj@marvell.com>,
	Amit Prakash Shukla <amitprakashs@marvell.com>,
	"stable@dpdk.org" <stable@dpdk.org>
Subject: RE: [PATCH 3/3] examples/ipsec-secgw: compilation fix for GCC-12
Date: Tue, 23 Aug 2022 13:12:14 +0000	[thread overview]
Message-ID: <CO6PR18MB4484AA67C8DBEB78CFEBF861D8709@CO6PR18MB4484.namprd18.prod.outlook.com> (raw)
In-Reply-To: <20220823105742.2276506-3-amitprakashs@marvell.com>

> 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


  reply	other threads:[~2022-08-23 13:12 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-23 10:57 [PATCH 1/3] net/i40e: " 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 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CO6PR18MB4484AA67C8DBEB78CFEBF861D8709@CO6PR18MB4484.namprd18.prod.outlook.com \
    --to=gakhil@marvell.com \
    --cc=amitprakashs@marvell.com \
    --cc=dev@dpdk.org \
    --cc=jerinj@marvell.com \
    --cc=radu.nicolau@intel.com \
    --cc=ruifeng.wang@arm.com \
    --cc=stable@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).