[dpdk-stable] patch 'port: fix pcap support with meson' has been queued to LTS release 18.11.6

Kevin Traynor ktraynor at redhat.com
Tue Dec 10 15:59:37 CET 2019


Hi,

FYI, your patch has been queued to LTS release 18.11.6

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 12/16/19. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://github.com/kevintraynor/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/kevintraynor/dpdk-stable-queue/commit/5e8a1c2a3bfe0f7ec1e1fe01b00ecf7112f29e3b

Thanks.

Kevin.

---
>From 5e8a1c2a3bfe0f7ec1e1fe01b00ecf7112f29e3b Mon Sep 17 00:00:00 2001
From: Bruce Richardson <bruce.richardson at intel.com>
Date: Tue, 24 Sep 2019 13:04:14 +0100
Subject: [PATCH] port: fix pcap support with meson

[ upstream commit 268fa581b1ffbd3077279c18f5a86992b747a9c0]

The meson build was missing the define to enable pcap port support if
libpcap (development) package was found on the build platform. Rather than
duplicating the checks for libpcap found in the pcap net PMD build file, we
can move the checks to the top-level config directory and reference the
RTE_PCAP_PORT setting elsewhere in the build.

Bugzilla ID: 351
Fixes: 5b9656b157d3 ("lib: build with meson")

Reported-by: Cristian Bidea <cristian.bidea at keysight.com>
Signed-off-by: Bruce Richardson <bruce.richardson at intel.com>
Tested-by: Cristian Bidea <cristian.bidea at keysight.com>
---
 config/meson.build           | 13 +++++++++++++
 drivers/net/pcap/meson.build |  6 ++----
 lib/librte_port/meson.build  |  4 ++++
 3 files changed, 19 insertions(+), 4 deletions(-)

diff --git a/config/meson.build b/config/meson.build
index d76776137..616af9746 100644
--- a/config/meson.build
+++ b/config/meson.build
@@ -90,4 +90,17 @@ if host_machine.system() == 'linux' and cc.find_library('bsd',
 endif
 
+# check for pcap
+pcap_dep = dependency('pcap', required: false)
+if pcap_dep.found()
+	# pcap got a pkg-config file only in 1.9.0 and before that meson uses
+	# an internal pcap-config finder, which is not compatible with
+	# cross-compilation, so try to fallback to find_library
+	pcap_dep = cc.find_library('pcap', required: false)
+endif
+if pcap_dep.found() and cc.has_header('pcap.h', dependencies: pcap_dep)
+	dpdk_conf.set('RTE_PORT_PCAP', 1)
+	dpdk_extra_ldflags += '-lpcap'
+endif
+
 # add -include rte_config to cflags
 add_project_arguments('-include', 'rte_config.h', language: 'c')
diff --git a/drivers/net/pcap/meson.build b/drivers/net/pcap/meson.build
index 0c4e0201a..2e84a5efc 100644
--- a/drivers/net/pcap/meson.build
+++ b/drivers/net/pcap/meson.build
@@ -2,9 +2,7 @@
 # Copyright(c) 2017 Intel Corporation
 
-pcap_dep = cc.find_library('pcap', required: false)
-if pcap_dep.found() and cc.has_header('pcap.h', dependencies: pcap_dep)
-	build = true
-else
+if not dpdk_conf.has('RTE_PORT_PCAP')
 	build = false
+	reason = 'missing dependency, "libpcap"'
 endif
 sources = files('rte_eth_pcap.c')
diff --git a/lib/librte_port/meson.build b/lib/librte_port/meson.build
index 0d11456f0..1b48127c1 100644
--- a/lib/librte_port/meson.build
+++ b/lib/librte_port/meson.build
@@ -24,4 +24,8 @@ headers = files(
 deps += ['ethdev', 'sched', 'ip_frag', 'cryptodev']
 
+if dpdk_conf.has('RTE_PORT_PCAP')
+	ext_deps += pcap_dep # dependency provided in config/meson.build
+endif
+
 if dpdk_conf.has('RTE_LIBRTE_KNI')
 	sources += files('rte_port_kni.c')
-- 
2.21.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2019-12-10 14:49:43.207549387 +0000
+++ 0063-port-fix-pcap-support-with-meson.patch	2019-12-10 14:49:39.111456667 +0000
@@ -0,0 +1,79 @@
+From 5e8a1c2a3bfe0f7ec1e1fe01b00ecf7112f29e3b Mon Sep 17 00:00:00 2001
+From: Bruce Richardson <bruce.richardson at intel.com>
+Date: Tue, 24 Sep 2019 13:04:14 +0100
+Subject: [PATCH] port: fix pcap support with meson
+
+[ upstream commit 268fa581b1ffbd3077279c18f5a86992b747a9c0]
+
+The meson build was missing the define to enable pcap port support if
+libpcap (development) package was found on the build platform. Rather than
+duplicating the checks for libpcap found in the pcap net PMD build file, we
+can move the checks to the top-level config directory and reference the
+RTE_PCAP_PORT setting elsewhere in the build.
+
+Bugzilla ID: 351
+Fixes: 5b9656b157d3 ("lib: build with meson")
+
+Reported-by: Cristian Bidea <cristian.bidea at keysight.com>
+Signed-off-by: Bruce Richardson <bruce.richardson at intel.com>
+Tested-by: Cristian Bidea <cristian.bidea at keysight.com>
+---
+ config/meson.build           | 13 +++++++++++++
+ drivers/net/pcap/meson.build |  6 ++----
+ lib/librte_port/meson.build  |  4 ++++
+ 3 files changed, 19 insertions(+), 4 deletions(-)
+
+diff --git a/config/meson.build b/config/meson.build
+index d76776137..616af9746 100644
+--- a/config/meson.build
++++ b/config/meson.build
+@@ -90,4 +90,17 @@ if host_machine.system() == 'linux' and cc.find_library('bsd',
+ endif
+ 
++# check for pcap
++pcap_dep = dependency('pcap', required: false)
++if pcap_dep.found()
++	# pcap got a pkg-config file only in 1.9.0 and before that meson uses
++	# an internal pcap-config finder, which is not compatible with
++	# cross-compilation, so try to fallback to find_library
++	pcap_dep = cc.find_library('pcap', required: false)
++endif
++if pcap_dep.found() and cc.has_header('pcap.h', dependencies: pcap_dep)
++	dpdk_conf.set('RTE_PORT_PCAP', 1)
++	dpdk_extra_ldflags += '-lpcap'
++endif
++
+ # add -include rte_config to cflags
+ add_project_arguments('-include', 'rte_config.h', language: 'c')
+diff --git a/drivers/net/pcap/meson.build b/drivers/net/pcap/meson.build
+index 0c4e0201a..2e84a5efc 100644
+--- a/drivers/net/pcap/meson.build
++++ b/drivers/net/pcap/meson.build
+@@ -2,9 +2,7 @@
+ # Copyright(c) 2017 Intel Corporation
+ 
+-pcap_dep = cc.find_library('pcap', required: false)
+-if pcap_dep.found() and cc.has_header('pcap.h', dependencies: pcap_dep)
+-	build = true
+-else
++if not dpdk_conf.has('RTE_PORT_PCAP')
+ 	build = false
++	reason = 'missing dependency, "libpcap"'
+ endif
+ sources = files('rte_eth_pcap.c')
+diff --git a/lib/librte_port/meson.build b/lib/librte_port/meson.build
+index 0d11456f0..1b48127c1 100644
+--- a/lib/librte_port/meson.build
++++ b/lib/librte_port/meson.build
+@@ -24,4 +24,8 @@ headers = files(
+ deps += ['ethdev', 'sched', 'ip_frag', 'cryptodev']
+ 
++if dpdk_conf.has('RTE_PORT_PCAP')
++	ext_deps += pcap_dep # dependency provided in config/meson.build
++endif
++
+ if dpdk_conf.has('RTE_LIBRTE_KNI')
+ 	sources += files('rte_port_kni.c')
+-- 
+2.21.0
+



More information about the stable mailing list