Skip to contentSkip to conversation

app/test-pmd: fix meson build failed when used latency stats lib

PATCH Superseded SteveX Yang 3 participants 5 messages Sep 10, 2020 – Sep 30, 2020 1 message not in the archive Arm/Amlogic Meson SoC support

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 app/test-pmd: fix meson build failed when used latency stats lib

meson build cannot find the header rte_latencystats.h when build DPDK first time or never installed DPDK lib after build via meson/ninja.

Because the corresponding header directory isn't included after enabled RTE_LIBRTE_LATENCY_STATS flag.

Add the header file location and link library to meson.build of test-pmd

---
 app/test-pmd/meson.build | 4 ++++
 1 file changed, 4 insertions(+)
app/test-pmd/meson.build +4 -0
index db0ff02eb..6ee7af750 100644
@@ -9,6 +9,10 @@ if dpdk_conf.has('RTE_LIBRTE_BOND_PMD')
 	cflags += '-I' + meson.source_root() + '/drivers/net/bonding'
 endif
 
+if dpdk_conf.has('RTE_LIBRTE_LATENCYSTATS')
+	cflags += '-I' + meson.source_root() + '/lib/librte_latencystats'
+endif
+
 sources = files('5tswap.c',
 	'cmdline.c',
 	'cmdline_flow.c',
Signature · 1 line
2.17.1
#1 lore raw
Quoted 10 lines · SteveX Yang

meson build cannot find the header rte_latencystats.h when build DPDK first time or never installed DPDK lib after build via meson/ninja.

Because the corresponding header directory isn't included after enabled RTE_LIBRTE_LATENCY_STATS flag.

Add the header file location and link library to meson.build of test-pmd

---

As before, I think we have a mismatch in old vs new macro names which is why this wasn't caught before. Therefore I suggest we just change testpmd to use the new macro to keep things standardized. [Other alternatives if we want to keep compatibility are to rename the latencystats directory to have an underscore in it, or to override the name (which I'd rather not go for)]

Quoted 8 lines
 app/test-pmd/meson.build | 4 ++++
 1 file changed, 4 insertions(+)
app/test-pmd/meson.build +0 -0
index db0ff02eb..6ee7af750 100644

app/test-pmd/meson.build if dpdk_conf.has('RTE_LIBRTE_BOND_PMD') · line 15

Quoted 7 lines
app/test-pmd/meson.build +4 -0
@@ -9,6 +9,10 @@ if dpdk_conf.has('RTE_LIBRTE_BOND_PMD')
 	cflags += '-I' + meson.source_root() + '/drivers/net/bonding'
 endif
 
+if dpdk_conf.has('RTE_LIBRTE_LATENCYSTATS')
+	cflags += '-I' + meson.source_root() + '/lib/librte_latencystats'
+endif
+

Rather than working with long cflags, just add latencystats as a dependency of testpmd.

Quoted 6 lines
app/test-pmd/meson.build +0 -0
 sources = files('5tswap.c',
 	'cmdline.c',
 	'cmdline_flow.c',
Signature · 1 line
2.17.1

A message that is not in the archive (sent off-list or not yet received): DM6PR11MB4362CE65DBD5BA111A43A0FAF9230@DM6PR11MB4362.namprd11.prod.outlook.com

#3 lore raw
Quoted 52 lines · SteveX

Hi Bruce,

Quoted 19 lines

-----Original Message-----
From: Bruce Richardson <[email protected]>
Sent: Thursday, September 10, 2020 5:24 PM
To: Yang, SteveX <[email protected]>
Cc: [email protected]; Lu, Wenzhuo <[email protected]>; Xing, Beilei <[email protected]>; Yang, Qiming <[email protected]>
Subject: Re: [dpdk-dev] [PATCH v1] app/test-pmd: fix meson build failed when used latency stats lib

Quoted 9 lines · SteveX Yang

meson build cannot find the header rte_latencystats.h when build DPDK first time or never installed DPDK lib after build via meson/ninja.

Because the corresponding header directory isn't included after enabled RTE_LIBRTE_LATENCY_STATS flag.

Add the header file location and link library to meson.build of test-pmd

Quoted 8 lines
Quoted 2 lines

---

As before, I think we have a mismatch in old vs new macro names which is why this wasn't caught before. Therefore I suggest we just change testpmd to use the new macro to keep things standardized. [Other alternatives if we want to keep compatibility are to rename the latencystats directory to have an underscore in it, or to override the name (which I'd rather not go for)]

Got it, I can change the old macro to new one RTE_LIBRTE_LATENCYSTATS.

Quoted 12 lines
Quoted 12 lines
 app/test-pmd/meson.build | 4 ++++
 1 file changed, 4 insertions(+)
app/test-pmd/meson.build index renamed from app/test-pmd/meson.build +0 -0

db0ff02eb..6ee7af750 100644

app/test-pmd/meson.build +0 -0
@@ -9,6 +9,10 @@ if dpdk_conf.has('RTE_LIBRTE_BOND_PMD')
 cflags += '-I' + meson.source_root() + '/drivers/net/bonding'
 endif
 
Quoted 7 lines

app/test-pmd/meson.build if dpdk_conf.has('RTE_LIBRTE_BOND_PMD') · line 15

Quoted 4 lines
app/test-pmd/meson.build +4 -0
+if dpdk_conf.has('RTE_LIBRTE_LATENCYSTATS')
+cflags += '-I' + meson.source_root() + '/lib/librte_latencystats'
+endif
+

Rather than working with long cflags, just add latencystats as a dependency of testpmd.

Quoted 3 lines

If I add the latencystats as a dependency, that means the flag will be **always enabled** no matter if the RTE_LIBRTE_LATENCY_STATS flag is set from compiler cmdline. Is it expected behavior for test-pmd app?

Not sure what you mean here, but so long as latency stats is available it should be a dependency of testpmd, so that the functionality is available.

/Bruce

#4 lore raw

PATCH v2 1/1 app/test-pmd: fix meson build failed when used latency stats lib

In reply to SteveX Yang

meson build cannot find the header rte_latencystats.h when build DPDK first time or never installed DPDK lib after build via meson/ninja.

Because the corresponding header directory isn't included after enabled RTE_LIBRTE_LATENCY_STATS flag.

Add the lib 'latencystats' to deps of meson.build of test-pmd, the corresponding header files will be included automatically.

Fixes 62d3216d6194 ("app/testpmd: add latency statistics calculation")

---
v2:
removed long cflags and added 'latencystats' as a dependency of testpmd
---

 app/test-pmd/meson.build | 3 +++
 1 file changed, 3 insertions(+)
app/test-pmd/meson.build +3 -0
index ea56e547b..92b425c27 100644
@@ -25,6 +25,9 @@ sources = files('5tswap.c',
 	'util.c')
 
 deps += ['ethdev', 'gro', 'gso', 'cmdline', 'metrics', 'meter', 'bus_pci']
+if dpdk_conf.has('RTE_LIBRTE_LATENCYSTATS')
+	deps += 'latencystats'
+endif
 if dpdk_conf.has('RTE_LIBRTE_PDUMP')
 	deps += 'pdump'
 endif
Signature · 1 line
2.17.1
#5 lore raw
Quoted 9 lines · SteveX Yang

meson build cannot find the header rte_latencystats.h when build DPDK first time or never installed DPDK lib after build via meson/ninja.

Because the corresponding header directory isn't included after enabled RTE_LIBRTE_LATENCY_STATS flag.

Add the lib 'latencystats' to deps of meson.build of test-pmd, the corresponding header files will be included automatically.

Quoted 6 lines
Fixes 62d3216d6194 ("app/testpmd: add latency statistics calculation")

---
v2:
removed long cflags and added 'latencystats' as a dependency of testpmd

The code has 'RTE_LIBRTE_LATENCY_STATS' which needs to be updated.

But I see Bruce is working on a more generic solution:
https://patches.dpdk.org/project/dpdk/list/?series=12283

I will mark this one as superseded and will wait the Bruce's set for fix.