Commit graph

38 commits

Author SHA1 Message Date
Thomas Monjalon de321d5918 build: remove special handling for node library
The node library had a need of being linked as a whole
to make some constructors effective.
Now that all libraries are linked with --whole-archive,
there is no need to have this library separate.

Fixes: e2db26f766 ("build: always link whole DPDK static libraries")

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Tested-by: Jerin Jacob <jerinj@marvell.com>
2020-07-05 10:52:11 +02:00
Bruce Richardson e2db26f766 build: always link whole DPDK static libraries
To ensure all constructors are included in static build, we need to pass
the --whole-archive flag when linking, which is used with the
"link_whole" meson option. Since we use link_whole for all libs, we no
longer need to track the lib as part of the static dependency, just the
path to the headers for compiling.

After this patch is applied, all DPDK .a files are inside
--whole-archive/--no-whole-archive flags, but external dependencies and
shared libs being linked against remain outside.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Tested-by: Andrzej Ostruszka <aostruszka@marvell.com>
Acked-by: Luca Boccassi <bluca@debian.org>
Acked-by: Sunil Pai G <sunil.pai.g@intel.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
2020-07-01 19:30:52 +02:00
Nithin Dabilpuram 08bd1a1744 examples/l3fwd-graph: add graph-based l3fwd skeleton
Add graph based l3fwd application skeleton with cmdline
parsing support inline with normal l3fwd.

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
2020-05-05 23:42:26 +02:00
Jin Yu c19beb3f38 examples/vhost_blk: introduce vhost storage sample
A Vhost-blk example that support inflight feature. It uses the
new APIs that introduced in the first patch, so it can show how these
APIs work to support inflight feature.

Signed-off-by: Jin Yu <jin.yu@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2019-11-11 14:23:02 +01:00
Pavan Nikhilesh 4ff457986f examples/l2fwd-event: add default poll mode routines
Add the default l2fwd poll mode routines similar to examples/l2fwd.

Signed-off-by: Sunil Kumar Kori <skori@marvell.com>
Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Acked-by: Nipun Gupta <nipun.gupta@nxp.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2019-11-04 18:07:43 +01:00
Pawel Modrak c8e6ceeceb examples/ioat: add new sample app for ioat driver
A new sample app demonstrating use of driver for CBDMA.  The app receives
packets, performs software or hardware copy, changes packets' MAC addresses
(if enabled) and forwards them. The change covers ports initialization,
closing connection and argument parsing.

Signed-off-by: Pawel Modrak <pawelx.modrak@intel.com>
Signed-off-by: Marcin Baran <marcinx.baran@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2019-10-27 17:57:41 +01:00
Bruce Richardson 7f7d44064c examples/vm_power: add guest cli to meson
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: David Hunt <david.hunt@intel.com>
2019-10-27 17:27:46 +01:00
Bruce Richardson 32c97c80f2 examples/server_node_efd: add server binary to meson build
When adding to the build, add in two missing includes that prevented build
on freebsd, rather than just duplicating the makefile restriction.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Luca Boccassi <bluca@debian.org>
2019-10-27 17:25:22 +01:00
Bruce Richardson 6186dea09c examples/server_node_efd: add node binary to meson build
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Luca Boccassi <bluca@debian.org>
2019-10-27 17:24:31 +01:00
Bruce Richardson 1af713dc3f examples/performance-thread: add pthread shim to meson
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Luca Boccassi <bluca@debian.org>
2019-10-27 17:24:25 +01:00
Bruce Richardson 64eee69a29 examples/performance-thread: add l3fwd-thread to meson
Limited to x86_64 systems, as it fails to compile on any others and is
disabled in the examples makefile for non-x86_64 systems.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Luca Boccassi <bluca@debian.org>
2019-10-27 17:24:18 +01:00
Bruce Richardson e6d7862834 examples/bpf: remove from list of examples to build
The examples/bpf directory does not contain an example app, but rather
example code for use with testpmd's BPF support. Therefore, we should not
attempt to build it when the user requests "examples=all". This also
synchronises the meson behaviour with make which similarly doesn't compile
up the code.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Luca Boccassi <bluca@debian.org>
2019-10-27 17:23:05 +01:00
Ciara Power ab6ebd7020 examples/load_balancer: remove example
This example can be removed because DPDK now has a range
of libraries, especially rte_eventdev, that did not exist
previously for load balancing, making this less relevant.
Also, modern NIC cards have greater ability to do load balancing,
e.g. using RSS, over a wider range of fields than earlier cards did.

Signed-off-by: Ciara Power <ciara.power@intel.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2019-10-26 22:32:40 +02:00
Ciara Power d82610b940 examples/netmap-compat: remove example
Rather than providing a shim layer on top of netmap,
we should instead encourage users to create apps using
the DPDK APIs directly.

Signed-off-by: Ciara Power <ciara.power@intel.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2019-10-26 22:32:40 +02:00
Ciara Power 46971b273e examples/quota-watermark: remove example
Original DPDK rings code had explicit support for a
single watermark per-ring, but more recent releases of
DPDK had a more general mechanism where each enqueue
or dequeue call could return the remaining elements/free-slots
in the ring.
Therefore, this example is not as relevant as before and can be removed.

Signed-off-by: Ciara Power <ciara.power@intel.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2019-10-26 22:32:40 +02:00
Bruce Richardson bd6e98193a examples/l3fwd-vf: remove example
The main l3fwd app should work with both PF and VF devices, so remove the
VF-only l3fwd example.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2019-10-26 22:32:40 +02:00
Bruce Richardson 207361b350 examples/exception_path: remove example
The example app shows the use of TUN/TAP with DPDK, but DPDK has a built-in
TAP PMD, so this example is obsolete and so can be removed.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2019-10-26 22:32:40 +02:00
Jin Yu 19b8d75f64 examples: delete vhost SCSI example
This example is too old and SPDK will not maintain this example
anymore. Also SPDK has submitted a new vhost example vhost-blk.
We will keep on maintaining vhost-blk and It shows the packed
ring and live recovery support.

Signed-off-by: Jin Yu <jin.yu@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2019-10-25 19:23:22 +02:00
Xiaoyun Li c5eebf85ba examples/ntb: add example for NTB
Enable an example for rawdev ntb. Support interactive mode to send
file on one host and receive file from another host. The command line
would be 'send [filepath]' and 'receive [filepath]'.

But since the FIFO is not enabled right now, use rte_memcpy as the enqueue
and dequeue functions and only support transmitting file no more than 4M.

Signed-off-by: Xiaoyun Li <xiaoyun.li@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
Reviewed-by: Xiaolong Ye <xiaolong.ye@intel.com>
2019-07-05 12:50:19 +02:00
Marcin Smoczynski 28188cee2a build: enable BSD features visibility for FreeBSD
When a component uses either XOPEN_SOURCE or POSIX_C_SOURCE macro
explicitly in its build recipe, it restricts visibility of a non POSIX
features subset, such as IANA protocol numbers (IPPROTO_* macros).
Non standard features are enabled by default for DPDK both for Linux
thanks to _GNU_SOURCE and for FreeBSD thanks to __BSD_VISIBLE. However
using XOPEN_SOURCE or POSIX_(C_)SOURCE in a component causes
__BSD_VISIBLE to be defined to 0 for FreeBSD, causing different feature
sets visibility for Linux and FreeBSD. It restricts from using IPPROTO
macros in public headers, such as rte_ip.h, despite the fact they are
already widely used in sources.

Add __BSD_VISIBLE macro specified unconditionally for FreeBSD targets
which enforces feature sets visibility unification between Linux and
FreeBSD.

Add single -D_GNU_SOURCE to config/meson.build as a project argument
instead of adding separate directive for each project subtree.

This patch solves the problem of build breaks for [1] on FreeBSD [2]
following the discussion [3].

[1] https://mails.dpdk.org/archives/dev/2019-May/131885.html
[2] http://mails.dpdk.org/archives/test-report/2019-May/082263.html
[3] https://mails.dpdk.org/archives/dev/2019-May/132110.html

Signed-off-by: Marcin Smoczynski <marcinx.smoczynski@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2019-06-26 16:50:33 +02:00
Ali Alnubani f10aadfd2f examples/multi_process: build with meson
This enables building the example multiprocess applications in
the subdirectory multi_process.

Signed-off-by: Ali Alnubani <alialnu@mellanox.com>
Acked-by: Luca Boccassi <bluca@debian.org>
2019-06-04 12:35:06 +02:00
Ali Alnubani 711d11c696 examples: use child directory as name
This would allow correctly naming an application residing
in a subdirectory. For example, if the example is set to 'path/to/app',
then the name would be 'app'.
This doesn't affect the naming of an example that isn't in a subdirectory.

Signed-off-by: Ali Alnubani <alialnu@mellanox.com>
Acked-by: Luca Boccassi <bluca@debian.org>
2019-06-04 12:34:36 +02:00
Bruce Richardson 699729bea9 examples: remove auto-generation of examples list
The examples/meson.build file scanned the filesystem to find all examples
to build (for examples=all option) and install. However, using run_command
and scanning the filesystem prevented ninja from properly detecting the
addition or removal of any examples - one had to recreate the build
directory from scratch to guarantee correct detection of all examples. This
patch replaces this generated list with a static list of examples, thereby
allowing proper tracking by ninja/meson, but at the cost of having to
update this file when a new example is added or removed.

This also fixes an issue with Windows builds, since "sh" is not available
there.

Fixes: 2daf565f91 ("examples: install as part of ninja install")
Cc: stable@dpdk.org

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Luca Boccassi <bluca@debian.org>
2019-05-20 23:57:12 +02:00
Bruce Richardson 85d7158edf examples: fix install with empty meson parameter
While the examples were being installed into the appropriate install path
when processing the examples/meson.build file, that file was only processed
if the "examples" meson parameter was non-empty. Since we now do more than
just build the examples, we need to unconditionally process the file.

Fixes: 2daf565f91 ("examples: install as part of ninja install")
Cc: stable@dpdk.org

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Luca Boccassi <bluca@debian.org>
2019-05-20 23:55:50 +02:00
Bruce Richardson 2daf565f91 examples: install as part of ninja install
When we install dpdk onto a system, we want to put the examples into
the /usr/share/dpdk (or /usr/local/share) directory for reference.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Luca Boccassi <bluca@debian.org>
2019-05-02 23:05:01 +02:00
Bruce Richardson adf93ca564 build: increase readability via shortcut variables
Define variables for "is_linux", "is_freebsd" and "is_windows"
to make the code shorter for comparisons and more readable.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
Acked-by: Luca Boccassi <bluca@debian.org>
2019-04-17 18:09:52 +02:00
Anand Rawat fa647c5722 build: add workarounds for Windows helloworld
Added meson workarounds to build helloworld on Windows.
Windows currently only supports kvargs and eal libraries.
This change restricts the build flow to supported libraries
only.

Signed-off-by: Anand Rawat <anand.rawat@intel.com>
Signed-off-by: Pallavi Kadam <pallavi.kadam@intel.com>
Reviewed-by: Jeff Shaw <jeffrey.b.shaw@intel.com>
Reviewed-by: Ranjit Menon <ranjit.menon@intel.com>
Acked-by: Harini Ramakrishnan <harini.ramakrishnan@microsoft.com>
2019-04-03 01:21:31 +02:00
Anatoly Burakov 5d7b673d5f mk: build with _GNU_SOURCE defined by default
We use _GNU_SOURCE all over the place, but often times we miss
defining it, resulting in broken builds on musl. Rather than
fixing every library's and driver's and application's makefile,
fix it by simply defining _GNU_SOURCE by default for all
builds.

Remove all usages of _GNU_SOURCE in source files and makefiles,
and also fixup a couple of instances of using __USE_GNU instead
of _GNU_SOURCE.

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
2018-10-22 11:28:27 +02:00
Bruce Richardson 3e3eeb4d5f build: remove duplicate checks for cflags
There is no need to check for each library, driver and example whether
certain cflags are supported. Instead of checking inside the loop, do
so outside and reuse the value.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
2018-07-26 10:09:20 +02:00
Gavin Hu d292a42fc8 build: fix for host clang and cross gcc
The following error hits if host cc compiler is clang(default one in most
linux distributions) and the cross compiler is gcc.

The root cause is: the hybride compilers add the warning options to the
meson project as project arguments, which apply for both host compiling and
cross compiling. But some options such as '-Wno-format-truncation' are not
supported nor recognized by clang, so they have to be removed from the
project arguments for the host compiler to run smoothily and added back as
cflags for the cross compiler to compile for cross source files.

The fix is remove unrecognized warning options from the meson project
arguments shared by gcc and clang, as add them specifically for gcc or
clang as cflags.

[265/893] Compiling C object
'buildtools/pmdinfogen/pmdinfogen@exe/pmdinfogen.c.o'.  warning: unknown
warning option '-Wno-format-truncation' [-Wunknown-warning-option]

Fixes: a55277a788 ("devtools: add test script for meson builds")
Cc: stable@dpdk.org

Signed-off-by: Gavin Hu <gavin.hu@arm.com>
Reviewed-by: Phil Yang <phil.yang@arm.com>
Reviewed-by: Song Zhu <song.zhu@arm.com>
Reviewed-by: Steve Capper <steve.capper@arm.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2018-07-11 21:14:21 +02:00
Bruce Richardson 273d2325b6 examples: improve error report for missing meson deps
When a required library is missing on a platform, rather than having
meson report an error about the missing variable, catch the problem
earlier and provide a more readable message.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Tested-by: Harry van Haaren <harry.van.haaren@intel.com>
2018-04-17 16:09:43 +02:00
Bruce Richardson 038e5ecc76 examples: allow building all as part of meson build
To test building all relevant example applications as part of a build, we
add support for the "all" keyword to be passed to the "examples" build
option. Since not all examples can actually be built on all systems,
we also add support for the "build" option inside the sub-dirs. However,
in case where "all" is not used, and a particular example is requested
to be built, we will error out if building the requested app is not
possible.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Tested-by: Harry van Haaren <harry.van.haaren@intel.com>
2018-04-17 16:09:43 +02:00
Bruce Richardson 9065b1fac6 build: fix dependency on execinfo for BSD meson builds
The binaries and apps in DPDK all need to be linked against the
execinfo library on FreeBSD so add this as a dependency in cases
where it is found. It's available by default on BSD, but not
at all on Linux

Fixes: 16ade738fd ("app/testpmd: build with meson")
Fixes: 89f0711f9d ("examples: build some samples with meson")
Fixes: b5dc795a8a ("test: build app with meson as dpdk-test")
Fixes: 2ff67267b0 ("app/eventdev: build with meson")

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
2018-02-02 11:31:36 +01:00
Pavan Nikhilesh 200b88cbe0 build: detect micro-arch on ARM
Added support for detecting march and mcpu by reading midr_el1 register.
The implementer, primary part number values read can be used to figure
out the underlying arm cpu.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
2018-01-30 21:59:00 +01:00
Bruce Richardson b114af1603 build: remove architecture flag as default C flag
Any flags added to the project args are automatically added to all builds,
both native and cross-compiled. This is not what we want for the -march
flag as a valid -march for the cross-compile is not valid for pmdinfogen
which is a native-build tool.

Instead we store the march flag as a variable, and add it to the default
cflags for all libs, drivers, examples, etc. This will allow pmdinfogen to
compile successfully in a cross-compilation environment.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Luca Boccassi <bluca@debian.org>
2018-01-30 21:58:59 +01:00
Bruce Richardson 6c9457c279 build: replace license text with SPDX tag
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Luca Boccassi <bluca@debian.org>
2018-01-30 21:58:59 +01:00
Bruce Richardson 3e5c3d58e1 build: build as both static and shared libs
This patch changes the build process to group all .o files for a driver or
library into a static archive first, and then link the .o files together
into a shared library. This eliminates the need for separate static or
shared object builds when packaging, for instance.

The "default_library" configuration option now only affects the apps and
examples, which are either linked against the static or shared library
versions depending on the value of the option.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Luca Boccassi <bluca@debian.org>
2018-01-30 21:58:59 +01:00
Bruce Richardson 89f0711f9d examples: build some samples with meson
Add support for having selected example apps built as part of a meson,
ninja build. By default none are built, and those to be built should be
named directly in the -Dexamples='' meson configuration argument.

This is useful for developers working on a feature who want to use a
suitable example, or examples, to test that feature, as they can compile
everything up in one go, and run the example without having to do a ninja
install first.

This commit adds examples which don't consist of multiple apps in
subdirectories to the meson build, so they can be built by default by
passing -Dexamples parameter to meson.

Not included are the following examples:
* ethtool
* multi-process
* netmap_compat
* performance-thread
* quota_watermark
* server_node_efd
* vm_power_manager

To test the apps added here, use the following command, merged to one line,
to add them to your meson build (command to be run inside the build
directory):

meson configure -Dexamples=bbdev_app,bond,cmdline,distributor,\
	eventdev_pipeline_sw_pmd, exception_path,helloworld,\
	ip_fragmentation,ip_pipeline,ip_reassembly, ipsec-secgw,\
	ipv4_multicast,kni,l2fwd-cat,l2fwd-crypto,l2fwd-jobstats,\
	l2fwd-keepalive,l2fwd,l3fwd-acl,l3fwd-power,l3fwd-vf,l3fwd,\
	link_status_interrupt,load_balancer,packet_ordering,ptpclient,\
	qos_meter,qos_sched,rxtx_callbacks,skeleton,tep_termination,\
	timer,vhost,vhost_scsi,vmdq,vmdq_dcb

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Luca Boccassi <bluca@debian.org>
2018-01-30 21:58:59 +01:00