From: Radu Nicolau Date: Wed, 3 Nov 2021 11:56:18 +0000 (+0000) Subject: examples/ipsec-secgw: move global array from header X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=6f1d5c0b8e535822f44175fd548eadb1c08f8fa7;p=dpdk.git examples/ipsec-secgw: move global array from header 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 Acked-by: Akhil Goyal --- 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];