[v2] examples/ipsec-secgw: fix potential build error
Checks
Commit Message
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(-)
Comments
03/11/2021 12:56, Radu Nicolau:
> 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.
So it is not fixing compilation,
as we would never apply a patch which would completely break compilation.
I would say (in the title) that it moves global variable from 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>
> 03/11/2021 12:56, Radu Nicolau:
> > 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.
>
> So it is not fixing compilation,
> as we would never apply a patch which would completely break compilation.
> I would say (in the title) that it moves global variable from header file.
Updated title " examples/ipsec-secgw: move global array from header"
Applied to dpdk-next-crypto
Acked-by: Akhil Goyal <gakhil@marvell.com>
>
> > Fixes: 1329602b6c8f ("examples/ipsec-secgw: add per-core packet
> statistics")
> > Cc: stable@dpdk.org
> >
> > Signed-off-by: Radu Nicolau <radu.nicolau@intel.com>
>
>
On Wed, Nov 3, 2021 at 2:09 PM Thomas Monjalon <thomas@monjalon.net> wrote:
>
> 03/11/2021 12:56, Radu Nicolau:
> > 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.
>
> So it is not fixing compilation,
> as we would never apply a patch which would completely break compilation.
> I would say (in the title) that it moves global variable from 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>
I guess it has to do with series:
https://patchwork.dpdk.org/project/dpdk/list/?series=20174
http://mails.dpdk.org/archives/test-report/2021-November/237332.html
So it should be part of this series.
> On Wed, Nov 3, 2021 at 2:09 PM Thomas Monjalon <thomas@monjalon.net>
> wrote:
> >
> > 03/11/2021 12:56, Radu Nicolau:
> > > 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.
> >
> > So it is not fixing compilation,
> > as we would never apply a patch which would completely break
> compilation.
> > I would say (in the title) that it moves global variable from 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>
>
> I guess it has to do with series:
> https://patchwork.dpdk.org/project/dpdk/list/?series=20174
Yes this series initiated the issue, applying both the patch and the series now
On next-crypto
On Wed, Nov 3, 2021 at 2:45 PM Akhil Goyal <gakhil@marvell.com> wrote:
>
> > On Wed, Nov 3, 2021 at 2:09 PM Thomas Monjalon <thomas@monjalon.net>
> > wrote:
> > >
> > > 03/11/2021 12:56, Radu Nicolau:
> > > > 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.
> > >
> > > So it is not fixing compilation,
> > > as we would never apply a patch which would completely break
> > compilation.
> > > I would say (in the title) that it moves global variable from 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>
> >
> > I guess it has to do with series:
> > https://patchwork.dpdk.org/project/dpdk/list/?series=20174
>
> Yes this series initiated the issue, applying both the patch and the series now
> On next-crypto
It means a patch of this series broke compilation, and this fix here
should be squashed in it.
> > Yes this series initiated the issue, applying both the patch and the series
> now
> > On next-crypto
>
> It means a patch of this series broke compilation, and this fix here
> should be squashed in it.
Actually no, this is definitely an issue introduced earlier and should be part of stable.
This got highlighted here as STATS_INTERVAL ifdef was removed in this series.
The compilation is broken when STATS_INTEVAL is defined in the app.
@@ -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)
@@ -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];