DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH 1/2] build: cleanup libpcap dependent components
@ 2021-11-08 10:09 David Marchand
  2021-11-08 10:09 ` [dpdk-dev] [PATCH 2/2] test: fix dependency on pcapng David Marchand
  2021-11-08 16:57 ` [dpdk-dev] [PATCH 1/2] build: cleanup libpcap dependent components Stephen Hemminger
  0 siblings, 2 replies; 4+ messages in thread
From: David Marchand @ 2021-11-08 10:09 UTC (permalink / raw)
  To: dev
  Cc: thomas, Reshma Pattan, Stephen Hemminger, Konstantin Ananyev,
	Bruce Richardson, Ferruh Yigit, Cristian Dumitrescu,
	Ray Kinsella

The RTE_PORT_PCAP variable is used to signal libpcap availability,
though its name seems to refer to pcap support in the port library.
Prefer a generic name and add explicit link dependencies where needed.

Fixes: 7a944656b33f ("test/pcapng: test pcapng library")
Fixes: 2eccf6afbea9 ("bpf: add function to convert classic BPF to DPDK BPF")
Fixes: cbb44143be74 ("app/dumpcap: add new packet capture application")

Signed-off-by: David Marchand <david.marchand@redhat.com>
---
 app/dumpcap/meson.build      | 3 ++-
 app/test/meson.build         | 5 +++--
 app/test/test_bpf.c          | 4 ++--
 config/meson.build           | 2 +-
 drivers/net/pcap/meson.build | 2 +-
 lib/bpf/bpf_stub.c           | 2 +-
 lib/bpf/meson.build          | 6 +++---
 lib/port/meson.build         | 3 ++-
 8 files changed, 15 insertions(+), 12 deletions(-)

diff --git a/app/dumpcap/meson.build b/app/dumpcap/meson.build
index ad4fc6ae60..69c016c780 100644
--- a/app/dumpcap/meson.build
+++ b/app/dumpcap/meson.build
@@ -1,7 +1,7 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2019 Microsoft Corporation
 
-if not dpdk_conf.has('RTE_PORT_PCAP')
+if not dpdk_conf.has('RTE_HAS_LIBPCAP')
     build = false
     reason = 'missing dependency, "libpcap"'
 endif
@@ -12,5 +12,6 @@ if is_windows
     subdir_done()
 endif
 
+ext_deps += pcap_dep
 sources = files('main.c')
 deps += ['ethdev', 'pdump', 'pcapng', 'bpf']
diff --git a/app/test/meson.build b/app/test/meson.build
index 96670c3504..a12eadbb5a 100644
--- a/app/test/meson.build
+++ b/app/test/meson.build
@@ -410,7 +410,8 @@ if dpdk_conf.has('RTE_NET_RING')
     fast_tests += [['pdump_autotest', true]]
 endif
 
-if dpdk_conf.has('RTE_PORT_PCAP')
+if dpdk_conf.has('RTE_HAS_LIBPCAP')
+    ext_deps += pcap_dep
     test_sources += 'test_pcapng.c'
 endif
 
@@ -463,7 +464,7 @@ endif
 dpdk_test = executable('dpdk-test',
         test_sources,
         link_whole: link_libs,
-        dependencies: test_dep_objs,
+        dependencies: test_dep_objs + ext_deps,
         c_args: cflags,
         install_rpath: join_paths(get_option('prefix'),
              driver_install_path),
diff --git a/app/test/test_bpf.c b/app/test/test_bpf.c
index ef861d05e7..e3e9a1b0b5 100644
--- a/app/test/test_bpf.c
+++ b/app/test/test_bpf.c
@@ -3250,7 +3250,7 @@ test_bpf(void)
 
 REGISTER_TEST_COMMAND(bpf_autotest, test_bpf);
 
-#ifdef RTE_PORT_PCAP
+#ifdef RTE_HAS_LIBPCAP
 #include <pcap/pcap.h>
 
 static void
@@ -3447,4 +3447,4 @@ test_bpf_convert(void)
 }
 
 REGISTER_TEST_COMMAND(bpf_convert_autotest, test_bpf_convert);
-#endif /* RTE_PORT_PCAP */
+#endif /* RTE_HAS_LIBPCAP */
diff --git a/config/meson.build b/config/meson.build
index f7e2b2f331..5926892a68 100644
--- a/config/meson.build
+++ b/config/meson.build
@@ -231,7 +231,7 @@ if not pcap_dep.found()
     pcap_dep = cc.find_library(pcap_lib, required: false)
 endif
 if pcap_dep.found() and cc.has_header('pcap.h', dependencies: pcap_dep)
-    dpdk_conf.set('RTE_PORT_PCAP', 1)
+    dpdk_conf.set('RTE_HAS_LIBPCAP', 1)
     dpdk_extra_ldflags += '-l@0@'.format(pcap_lib)
 endif
 
diff --git a/drivers/net/pcap/meson.build b/drivers/net/pcap/meson.build
index 54246095b2..ed7864eb9d 100644
--- a/drivers/net/pcap/meson.build
+++ b/drivers/net/pcap/meson.build
@@ -1,7 +1,7 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2017 Intel Corporation
 
-if not dpdk_conf.has('RTE_PORT_PCAP')
+if not dpdk_conf.has('RTE_HAS_LIBPCAP')
     build = false
     reason = 'missing dependency, "libpcap"'
 endif
diff --git a/lib/bpf/bpf_stub.c b/lib/bpf/bpf_stub.c
index caec00f42f..ebc5343896 100644
--- a/lib/bpf/bpf_stub.c
+++ b/lib/bpf/bpf_stub.c
@@ -27,7 +27,7 @@ rte_bpf_elf_load(const struct rte_bpf_prm *prm, const char *fname,
 }
 #endif
 
-#ifndef RTE_PORT_PCAP
+#ifndef RTE_HAS_LIBPCAP
 struct rte_bpf_prm *
 rte_bpf_convert(const struct bpf_program *prog)
 {
diff --git a/lib/bpf/meson.build b/lib/bpf/meson.build
index 0df55a2236..cd739bb827 100644
--- a/lib/bpf/meson.build
+++ b/lib/bpf/meson.build
@@ -33,12 +33,12 @@ if dep.found()
     sources += files('bpf_load_elf.c')
     ext_deps += dep
 else
-     warning('libelf is missing, rte_bpf_elf_load API will be disabled')
+    warning('libelf is missing, rte_bpf_elf_load API will be disabled')
 endif
 
-if dpdk_conf.has('RTE_PORT_PCAP')
+if dpdk_conf.has('RTE_HAS_LIBPCAP')
     sources += files('bpf_convert.c')
     ext_deps += pcap_dep
 else
-     warning('RTE_PORT_PCAP is missing, rte_bpf_convert API will be disabled')
+    warning('libpcap is missing, rte_bpf_convert API will be disabled')
 endif
diff --git a/lib/port/meson.build b/lib/port/meson.build
index 854bf39cd9..3ab37e2cb4 100644
--- a/lib/port/meson.build
+++ b/lib/port/meson.build
@@ -41,7 +41,8 @@ headers = files(
 )
 deps += ['ethdev', 'sched', 'ip_frag', 'cryptodev', 'eventdev']
 
-if dpdk_conf.has('RTE_PORT_PCAP')
+if dpdk_conf.has('RTE_HAS_LIBPCAP')
+    dpdk_conf.set('RTE_PORT_PCAP', 1)
     ext_deps += pcap_dep # dependency provided in config/meson.build
 endif
 
-- 
2.23.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [dpdk-dev] [PATCH 2/2] test: fix dependency on pcapng
  2021-11-08 10:09 [dpdk-dev] [PATCH 1/2] build: cleanup libpcap dependent components David Marchand
@ 2021-11-08 10:09 ` David Marchand
  2021-11-08 16:57 ` [dpdk-dev] [PATCH 1/2] build: cleanup libpcap dependent components Stephen Hemminger
  1 sibling, 0 replies; 4+ messages in thread
From: David Marchand @ 2021-11-08 10:09 UTC (permalink / raw)
  To: dev; +Cc: thomas, Stephen Hemminger

The unit test code should depend on the pcapng library.

Fixes: 7a944656b33f ("test/pcapng: test pcapng library")

Signed-off-by: David Marchand <david.marchand@redhat.com>
---
 app/test/meson.build | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/app/test/meson.build b/app/test/meson.build
index a12eadbb5a..830db76661 100644
--- a/app/test/meson.build
+++ b/app/test/meson.build
@@ -412,7 +412,10 @@ endif
 
 if dpdk_conf.has('RTE_HAS_LIBPCAP')
     ext_deps += pcap_dep
-    test_sources += 'test_pcapng.c'
+    if dpdk_conf.has('RTE_LIB_PCAPNG')
+        test_deps += 'pcapng'
+        test_sources += 'test_pcapng.c'
+    endif
 endif
 
 if dpdk_conf.has('RTE_LIB_POWER')
-- 
2.23.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [dpdk-dev] [PATCH 1/2] build: cleanup libpcap dependent components
  2021-11-08 10:09 [dpdk-dev] [PATCH 1/2] build: cleanup libpcap dependent components David Marchand
  2021-11-08 10:09 ` [dpdk-dev] [PATCH 2/2] test: fix dependency on pcapng David Marchand
@ 2021-11-08 16:57 ` Stephen Hemminger
  2021-11-10 10:57   ` David Marchand
  1 sibling, 1 reply; 4+ messages in thread
From: Stephen Hemminger @ 2021-11-08 16:57 UTC (permalink / raw)
  To: David Marchand
  Cc: dev, thomas, Reshma Pattan, Konstantin Ananyev, Bruce Richardson,
	Ferruh Yigit, Cristian Dumitrescu, Ray Kinsella

On Mon,  8 Nov 2021 11:09:18 +0100
David Marchand <david.marchand@redhat.com> wrote:

> The RTE_PORT_PCAP variable is used to signal libpcap availability,
> though its name seems to refer to pcap support in the port library.
> Prefer a generic name and add explicit link dependencies where needed.
> 
> Fixes: 7a944656b33f ("test/pcapng: test pcapng library")
> Fixes: 2eccf6afbea9 ("bpf: add function to convert classic BPF to DPDK BPF")
> Fixes: cbb44143be74 ("app/dumpcap: add new packet capture application")
> 
> Signed-off-by: David Marchand <david.marchand@redhat.com>

Thanks for fixing.

Acked-by: Stephen Hemminger <stephen@networkplumber.org>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [dpdk-dev] [PATCH 1/2] build: cleanup libpcap dependent components
  2021-11-08 16:57 ` [dpdk-dev] [PATCH 1/2] build: cleanup libpcap dependent components Stephen Hemminger
@ 2021-11-10 10:57   ` David Marchand
  0 siblings, 0 replies; 4+ messages in thread
From: David Marchand @ 2021-11-10 10:57 UTC (permalink / raw)
  To: Stephen Hemminger
  Cc: dev, Thomas Monjalon, Reshma Pattan, Konstantin Ananyev,
	Bruce Richardson, Ferruh Yigit, Cristian Dumitrescu,
	Ray Kinsella

On Mon, Nov 8, 2021 at 5:57 PM Stephen Hemminger
<stephen@networkplumber.org> wrote:
> > The RTE_PORT_PCAP variable is used to signal libpcap availability,
> > though its name seems to refer to pcap support in the port library.
> > Prefer a generic name and add explicit link dependencies where needed.
> >
> > Fixes: 7a944656b33f ("test/pcapng: test pcapng library")
> > Fixes: 2eccf6afbea9 ("bpf: add function to convert classic BPF to DPDK BPF")
> > Fixes: cbb44143be74 ("app/dumpcap: add new packet capture application")
> >
> > Signed-off-by: David Marchand <david.marchand@redhat.com>
> Acked-by: Stephen Hemminger <stephen@networkplumber.org>

Series applied, thanks.


-- 
David Marchand


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-11-10 10:58 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-08 10:09 [dpdk-dev] [PATCH 1/2] build: cleanup libpcap dependent components David Marchand
2021-11-08 10:09 ` [dpdk-dev] [PATCH 2/2] test: fix dependency on pcapng David Marchand
2021-11-08 16:57 ` [dpdk-dev] [PATCH 1/2] build: cleanup libpcap dependent components Stephen Hemminger
2021-11-10 10:57   ` David Marchand

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).