DPDK patches and discussions
 help / color / mirror / Atom feed
From: Radu Nicolau <radu.nicolau@intel.com>
To: Radu Nicolau <radu.nicolau@intel.com>, Akhil Goyal <gakhil@marvell.com>
Cc: dev@dpdk.org, declan.doherty@intel.com,
	hemant.agrawal@oss.nxp.com, anoobj@marvell.com,
	thomas@monjalon.net, stable@dpdk.org
Subject: [dpdk-dev] [PATCH v2] examples/ipsec-secgw: fix potential build error
Date: Wed,  3 Nov 2021 11:56:18 +0000	[thread overview]
Message-ID: <20211103115618.3559996-1-radu.nicolau@intel.com> (raw)
In-Reply-To: <20211103105155.3556048-1-radu.nicolau@intel.com>

When STATS_INTERVAL is set to a non-zero value the core_statistics array
will be defined in multiple compilation units and this can trigger a
linker error on particular environments. In order to fix this the
core_statistics definition was moved out of the header file.

Fixes: 1329602b6c8f ("examples/ipsec-secgw: add per-core packet statistics")
Cc: stable@dpdk.org

Signed-off-by: Radu Nicolau <radu.nicolau@intel.com>
---
 examples/ipsec-secgw/ipsec-secgw.c | 2 ++
 examples/ipsec-secgw/ipsec-secgw.h | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/examples/ipsec-secgw/ipsec-secgw.c b/examples/ipsec-secgw/ipsec-secgw.c
index 5fcf424efe..ea8e3bcb87 100644
--- a/examples/ipsec-secgw/ipsec-secgw.c
+++ b/examples/ipsec-secgw/ipsec-secgw.c
@@ -291,6 +291,8 @@ adjust_ipv6_pktlen(struct rte_mbuf *m, const struct rte_ipv6_hdr *iph,
 
 #if (STATS_INTERVAL > 0)
 
+struct ipsec_core_statistics core_statistics[RTE_MAX_LCORE];
+
 /* Print out statistics on packet distribution */
 static void
 print_stats_cb(__rte_unused void *param)
diff --git a/examples/ipsec-secgw/ipsec-secgw.h b/examples/ipsec-secgw/ipsec-secgw.h
index 96e22de45e..f9be303c28 100644
--- a/examples/ipsec-secgw/ipsec-secgw.h
+++ b/examples/ipsec-secgw/ipsec-secgw.h
@@ -93,7 +93,7 @@ struct ipsec_core_statistics {
 	uint64_t burst_rx;
 } __rte_cache_aligned;
 
-struct ipsec_core_statistics core_statistics[RTE_MAX_LCORE];
+extern struct ipsec_core_statistics core_statistics[RTE_MAX_LCORE];
 #endif /* STATS_INTERVAL */
 
 extern struct ethaddr_info ethaddr_tbl[RTE_MAX_ETHPORTS];
-- 
2.25.1


  reply	other threads:[~2021-11-03 12:11 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-03 10:51 [dpdk-dev] [PATCH] examples/ipsec-secgw: fix " Radu Nicolau
2021-11-03 11:56 ` Radu Nicolau [this message]
2021-11-03 13:08   ` [dpdk-dev] [PATCH v2] examples/ipsec-secgw: fix potential " Thomas Monjalon
2021-11-03 13:36     ` [dpdk-dev] [EXT] " Akhil Goyal
2021-11-03 13:42     ` [dpdk-dev] [dpdk-stable] " David Marchand
2021-11-03 13:45       ` [dpdk-dev] [EXT] " Akhil Goyal
2021-11-03 13:50         ` David Marchand
2021-11-03 13:55           ` Akhil Goyal
2021-11-03 11:58 ` [dpdk-dev] [PATCH] examples/ipsec-secgw: fix " 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=20211103115618.3559996-1-radu.nicolau@intel.com \
    --to=radu.nicolau@intel.com \
    --cc=anoobj@marvell.com \
    --cc=declan.doherty@intel.com \
    --cc=dev@dpdk.org \
    --cc=gakhil@marvell.com \
    --cc=hemant.agrawal@oss.nxp.com \
    --cc=stable@dpdk.org \
    --cc=thomas@monjalon.net \
    /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).