[dpdk-stable] patch 'examples/ipsec-gw: fix gcc 10 maybe-uninitialized warning' has been queued to stable release 19.11.3

luca.boccassi at gmail.com luca.boccassi at gmail.com
Tue May 19 15:04:27 CEST 2020


Hi,

FYI, your patch has been queued to stable release 19.11.3

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/21/20. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Thanks.

Luca Boccassi

---
>From 274dec754807019cbc8c3c063e5a5b0b46b2f1d7 Mon Sep 17 00:00:00 2001
From: Kevin Traynor <ktraynor at redhat.com>
Date: Wed, 11 Mar 2020 11:33:00 +0000
Subject: [PATCH] examples/ipsec-gw: fix gcc 10 maybe-uninitialized warning
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

[ upstream commit f8afd2924753b7fbc9e28771277928ac1d6fb4a7 ]

gcc 10.0.1 reports:

../examples/ipsec-secgw/ipsec_process.c: In function ‘ipsec_process’:
../examples/ipsec-secgw/ipsec_process.c:132:34:
error: ‘grp.m’ may be used uninitialized in this function
 [-Werror=maybe-uninitialized]
  132 |    grp[n].cnt = pkts + i - grp[n].m;
      |                            ~~~~~~^~

This is a correct warning for the initial execution of the statement.
However, it is the design of the loop that grp[0].cnt will later be
written with the correct value using an initialized grp[0].m before it
is used.

In order to remove the warning, initialize grp[0].m for the initial and
unused calculation of grp[0].cnt.

Fixes: 3e5f4625dc17 ("examples/ipsec-secgw: make data-path to use IPsec library")

Suggested-by: Konstantin Ananyev <konstantin.ananyev at intel.com>
Signed-off-by: Kevin Traynor <ktraynor at redhat.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev at intel.com>
---
 examples/ipsec-secgw/ipsec_process.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/examples/ipsec-secgw/ipsec_process.c b/examples/ipsec-secgw/ipsec_process.c
index 2eb5c8b345..37f406d46c 100644
--- a/examples/ipsec-secgw/ipsec_process.c
+++ b/examples/ipsec-secgw/ipsec_process.c
@@ -125,6 +125,7 @@ sa_group(void *sa_ptr[], struct rte_mbuf *pkts[],
 	void * const nosa = &spi;
 
 	sa = nosa;
+	grp[0].m = pkts;
 	for (i = 0, n = 0; i != num; i++) {
 
 		if (sa != sa_ptr[i]) {
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-05-19 14:04:49.833263858 +0100
+++ 0132-examples-ipsec-gw-fix-gcc-10-maybe-uninitialized-war.patch	2020-05-19 14:04:44.444652506 +0100
@@ -1,4 +1,4 @@
-From f8afd2924753b7fbc9e28771277928ac1d6fb4a7 Mon Sep 17 00:00:00 2001
+From 274dec754807019cbc8c3c063e5a5b0b46b2f1d7 Mon Sep 17 00:00:00 2001
 From: Kevin Traynor <ktraynor at redhat.com>
 Date: Wed, 11 Mar 2020 11:33:00 +0000
 Subject: [PATCH] examples/ipsec-gw: fix gcc 10 maybe-uninitialized warning
@@ -6,6 +6,8 @@
 Content-Type: text/plain; charset=UTF-8
 Content-Transfer-Encoding: 8bit
 
+[ upstream commit f8afd2924753b7fbc9e28771277928ac1d6fb4a7 ]
+
 gcc 10.0.1 reports:
 
 ../examples/ipsec-secgw/ipsec_process.c: In function ‘ipsec_process’:
@@ -24,7 +26,6 @@
 unused calculation of grp[0].cnt.
 
 Fixes: 3e5f4625dc17 ("examples/ipsec-secgw: make data-path to use IPsec library")
-Cc: stable at dpdk.org
 
 Suggested-by: Konstantin Ananyev <konstantin.ananyev at intel.com>
 Signed-off-by: Kevin Traynor <ktraynor at redhat.com>
@@ -34,10 +35,10 @@
  1 file changed, 1 insertion(+)
 
 diff --git a/examples/ipsec-secgw/ipsec_process.c b/examples/ipsec-secgw/ipsec_process.c
-index bb2f2b82da..6d3a3c9a1b 100644
+index 2eb5c8b345..37f406d46c 100644
 --- a/examples/ipsec-secgw/ipsec_process.c
 +++ b/examples/ipsec-secgw/ipsec_process.c
-@@ -126,6 +126,7 @@ sa_group(void *sa_ptr[], struct rte_mbuf *pkts[],
+@@ -125,6 +125,7 @@ sa_group(void *sa_ptr[], struct rte_mbuf *pkts[],
  	void * const nosa = &spi;
  
  	sa = nosa;


More information about the stable mailing list