From patchwork Wed Nov 3 11:56:18 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Radu Nicolau X-Patchwork-Id: 103651 X-Patchwork-Delegate: gakhil@marvell.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 0216DA0C53; Wed, 3 Nov 2021 13:11:18 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 968224115A; Wed, 3 Nov 2021 13:11:18 +0100 (CET) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mails.dpdk.org (Postfix) with ESMTP id 4418941149; Wed, 3 Nov 2021 13:11:17 +0100 (CET) X-IronPort-AV: E=McAfee;i="6200,9189,10156"; a="255109447" X-IronPort-AV: E=Sophos;i="5.87,205,1631602800"; d="scan'208";a="255109447" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Nov 2021 05:11:15 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.87,205,1631602800"; d="scan'208";a="450044736" Received: from silpixa00400884.ir.intel.com ([10.243.22.82]) by orsmga003.jf.intel.com with ESMTP; 03 Nov 2021 05:11:13 -0700 From: Radu Nicolau To: Radu Nicolau , Akhil Goyal Cc: dev@dpdk.org, declan.doherty@intel.com, hemant.agrawal@oss.nxp.com, anoobj@marvell.com, thomas@monjalon.net, stable@dpdk.org Date: Wed, 3 Nov 2021 11:56:18 +0000 Message-Id: <20211103115618.3559996-1-radu.nicolau@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211103105155.3556048-1-radu.nicolau@intel.com> References: <20211103105155.3556048-1-radu.nicolau@intel.com> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v2] examples/ipsec-secgw: fix potential build error X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 --- 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];