DPDK patches and discussions
 help / color / mirror / Atom feed
From: Amit Prakash Shukla <amitprakashs@marvell.com>
To: Ruifeng Wang <ruifeng.wang@arm.com>,
	Radu Nicolau <radu.nicolau@intel.com>,
	Akhil Goyal <gakhil@marvell.com>
Cc: <dev@dpdk.org>, <jerinj@marvell.com>,
	Amit Prakash Shukla <amitprakashs@marvell.com>, <stable@dpdk.org>
Subject: [PATCH 3/3] examples/ipsec-secgw: compilation fix for GCC-12
Date: Tue, 23 Aug 2022 16:27:42 +0530	[thread overview]
Message-ID: <20220823105742.2276506-3-amitprakashs@marvell.com> (raw)
In-Reply-To: <20220823105742.2276506-1-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;
 	}
 
 	/* 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


  parent reply	other threads:[~2022-08-23 10:58 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 ` Amit Prakash Shukla [this message]
2022-08-23 13:12   ` [PATCH 3/3] examples/ipsec-secgw: " 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

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=20220823105742.2276506-3-amitprakashs@marvell.com \
    --to=amitprakashs@marvell.com \
    --cc=dev@dpdk.org \
    --cc=gakhil@marvell.com \
    --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).