examples/ipsec-secgw: fix build error
PATCH 1/1 examples/ipsec-secgw: fix build error
Move core_statistics definition out of header file.
--- examples/ipsec-secgw/ipsec-secgw.c | 2 ++ examples/ipsec-secgw/ipsec-secgw.h | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-)
examples/ipsec-secgw/ipsec-secgw.c +2 -0
@@ -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)
examples/ipsec-secgw/ipsec-secgw.h +1 -1
@@ -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 ];
Signature · 1 line
2.25.1
I don't see any compilation issue.
How do you trigger the problem?
The scope may be precised in the title.
03/11/2021 11:51, Radu Nicolau:
Quoted 1 line
Move
core_statisticsdefinition out of header file.
Why?
Please add explanation and error log here.
Quoted 4 lines
Fixes 1329602b6c8f ("examples/ipsec-secgw: add per-core packet statistics")Signed-off-by Radu Nicolau <[email protected]>
PATCH v2 1/1 examples/ipsec-secgw: fix potential build error
In reply to Radu NicolauWhen 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.
--- examples/ipsec-secgw/ipsec-secgw.c | 2 ++ examples/ipsec-secgw/ipsec-secgw.h | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-)
examples/ipsec-secgw/ipsec-secgw.c +2 -0
@@ -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)
examples/ipsec-secgw/ipsec-secgw.h +1 -1
@@ -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 ];
Signature · 1 line
2.25.1
Re: [dpdk-dev] [PATCH v2] examples/ipsec-secgw: fix potential build error
03/11/2021 12:56, Radu Nicolau:
Quoted 4 lines
When
STATS_INTERVALis set to a non-zero value thecore_statisticsarray will be defined in multiple compilation units and this can trigger a linker error on particular environments. In order to fix this thecore_statisticsdefinition 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.
Quoted 4 lines
Fixes 1329602b6c8f ("examples/ipsec-secgw: add per-core packet statistics")Signed-off-by Radu Nicolau <[email protected]>
Akhil Goyal
Acked-byRe: [dpdk-dev] [EXT] Re: [PATCH v2] examples/ipsec-secgw: fix potential build error
Quoted 9 lines
03/11/2021 12:56, Radu Nicolau:
Quoted 4 lines
When
STATS_INTERVALis set to a non-zero value thecore_statisticsarray will be defined in multiple compilation units and this can trigger a linker error on particular environments. In order to fix this thecore_statisticsdefinition 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
Quoted 8 lines
Quoted 2 lines
Fixes 1329602b6c8f ("examples/ipsec-secgw: add per-core packetstatistics")
Quoted 3 lines
Signed-off-by Radu Nicolau <[email protected]>
Re: [dpdk-dev] [dpdk-stable] [PATCH v2] examples/ipsec-secgw: fix potential build error
In reply to Thomas MonjalonQuoted 15 lines · Thomas Monjalon
03/11/2021 12:56, Radu Nicolau:
Quoted 4 lines
When
STATS_INTERVALis set to a non-zero value thecore_statisticsarray will be defined in multiple compilation units and this can trigger a linker error on particular environments. In order to fix this thecore_statisticsdefinition 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.Quoted 4 lines
Fixes 1329602b6c8f ("examples/ipsec-secgw: add per-core packet statistics")Signed-off-by Radu Nicolau <[email protected]>
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.
Signature · 1 line
David Marchand
Re: [dpdk-dev] [EXT] Re: [dpdk-stable] [PATCH v2] examples/ipsec-secgw: fix potential build error
Quoted 14 lines
Quoted 9 lines · Thomas Monjalon
03/11/2021 12:56, Radu Nicolau:
Quoted 4 lines
When
STATS_INTERVALis set to a non-zero value thecore_statisticsarray will be defined in multiple compilation units and this can trigger a linker error on particular environments. In order to fix this thecore_statisticsdefinition was moved out of the header file.So it is not fixing compilation,
as we would never apply a patch which would completely breakcompilation.
Quoted 2 lines
I would say (in the title) that it moves global variable from header file.
Quoted 8 lines
Quoted 1 line
Quoted 1 line
Fixes 1329602b6c8f ("examples/ipsec-secgw: add per-core packetstatistics")
Quoted 3 lines
Quoted 3 lines
Signed-off-by Radu Nicolau <[email protected]>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
Re: [dpdk-dev] [EXT] Re: [dpdk-stable] [PATCH v2] examples/ipsec-secgw: fix potential build error
Quoted 19 lines · Akhil Goyal
Quoted 19 lines
Quoted 9 lines · Thomas Monjalon
03/11/2021 12:56, Radu Nicolau:
Quoted 4 lines
When
STATS_INTERVALis set to a non-zero value thecore_statisticsarray will be defined in multiple compilation units and this can trigger a linker error on particular environments. In order to fix this thecore_statisticsdefinition was moved out of the header file.So it is not fixing compilation,
as we would never apply a patch which would completely breakcompilation.
Quoted 3 lines
I would say (in the title) that it moves global variable from header file.
Quoted 1 line
Fixes 1329602b6c8f ("examples/ipsec-secgw: add per-core packetstatistics")
Quoted 2 lines
Quoted 2 lines
Quoted 7 lines
Quoted 4 lines
Quoted 1 line
Quoted 1 line
Signed-off-by Radu Nicolau <[email protected]>I guess it has to do with series:
https://patchwork.dpdk.org/project/dpdk/list/?series=20174Yes 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.
Signature · 1 line
David Marchand
Re: [dpdk-dev] [EXT] Re: [dpdk-stable] [PATCH v2] examples/ipsec-secgw: fix potential build error
Quoted 6 lines
Quoted 1 line
Yes this series initiated the issue, applying both the patch and the series
now
Quoted 1 line
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.