Skip to contentSkip to conversation

Building DPDK with meson and ninja

RFC In review Bruce Richardson 3 participants 50 messages Aug 14, 2017 – Aug 18, 2017 1 message not in the archive

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

v2 cover Building DPDK with meson and ninja

Following on from previous RFC [http://dpdk.org/dev/patchwork/patch/25104/]
here is a second draft implementation for building DPDK with meson and ninja. While still not building all of DPDK, and needing patch cleanup so that patches don't overwrite previous work, it is more complete in many ways than the previous version and includes:

* dynamic build configuration e.g. building pcap driver only if pcap is found, only build af_packet if the target is linux, and only building QAT and openssl crypto drivers if libcrypto is found
* support for pmdinfo inside the PMDs(for shared builds) and binaries (for static builds)
* generalized/standardized way of building libs and drivers, though the drivers code still needs generalization at the driver, rather than driver-class level.
* support for having a pkgconfig file for DPDK on install, and helloworld and l2fwd can be built using the pkgconfig info (via make, not ninja)
* support for library versions
* an implementation for FreeBSD as well as Linux
* all libraries are included in the build, as well as a number of NIC, crypto, and mempool drivers
* the igb_uio kernel module is build via the kernel Kbuild system as part of a meson/ninja DPDK build

there is still plenty to do on this, but please review and test it out. I've kept the patches split so that the evolution of the work is a bit clearer than having it all send in a monolithic patch. All feedback welcome. I recommend one uses the latest meson release for this, though the minimum version supported should be v0.4.

I've tested static and dynamic builds with clang and gcc on Fedora 26, and done test builds on FreeBSD 11 with clang too. Build with other compilers and on other OS's may have issues, so YMMV.

To do a basic build, using gcc and with shared libs, in a folder called "gcc-build":

	user@host:dpdk$ meson gcc-build
	....
	user@host:dpdk$ cd gcc-build
	user@host:gcc-build$ ninja
	user@host:gcc-build$ sudo ninja install

To do a build with clang, using static libs:

	user@host:dpdk$ CC=clang meson --default_library=static clang-build
	....
	user@host:dpdk$ cd clang-build
	user@host:clang-build$ ninja
	user@host:clang-build$ sudo ninja install

Other options can be adjusted by running "mesonconf" in the build directory, i.e. gcc-build or clang-build in the examples above.

Bruce Richardson (40):
build: initial hooks for using meson with DPDK
build: create pkg-config file for DPDK
build: build linuxapp EAL with meson and ninja
build: add EAL support under BSD
build: add core libraries to meson build system
build: add i40e driver to meson build
build: add pmdinfogen to build
build: generate list of sources for pmdinfogen
build: build i40e driver, including pmdinfo
build: install usertools scripts
build: simplify generation of pmd.c files
build: generalize net driver build to higher level
build: remove hard-coded enablement of vector driver
build: add ixgbe driver to build
build: set up standard deps for drivers
build: add af_packet driver to build
build: add pcap PMD support
build: add symbol version map file support to libs
build: build libraries in a loop for brevity
build: version library .so files
eal: add version information to meson build
build: add mempool drivers to build
build: add gro library to meson build
build: tweak naming of pmd dependencies
build: track driver include directories properly
metrics: add metrics lib to meson build
build: track dependencies recursively
testpmd: compile testpmd with meson and ninja crypto/null: rename the version file to standard crypto/qat: remove dependency on ether library
build: add cryptodev and some crypto drivers to build
igb_uio: add igb_uio to meson build
ip_frag: rename version file to standard name
build: add most remaining libraries to meson build
build: add packet framework libs to meson build
acl: add acl library to meson build
build: add ark and avp PMDs to build
build: fix static library builds with base code
build: fix driver dependencies for static builds
examples: allow basic sample app build using pkg-config

 app/meson.build                                    |  32 ++++++
 app/test-pmd/meson.build                           |  74 +++++++++++++
 buildtools/gen-pmdinfo-cfile.sh                    |  41 ++++++++
 buildtools/meson.build                             |  34 ++++++
 buildtools/pmdinfogen/meson.build                  |  43 ++++++++
 config/meson.build                                 |  69 +++++++++++++
 config/rte_config.h                                | 114 +++++++++++++++++++++
 config/x86/meson.build                             |  70 +++++++++++++
 drivers/crypto/meson.build                         | 108 +++++++++++++++++++
 drivers/crypto/null/Makefile                       |   2 +-
 drivers/crypto/null/meson.build                    |  32 ++++++
 ...crypto_version.map => rte_pmd_null_version.map} |   0
 drivers/crypto/openssl/meson.build                 |  38 +++++++
 drivers/crypto/qat/meson.build                     |  41 ++++++++
 drivers/crypto/qat/qat_crypto.c                    |   1 -
 drivers/mempool/meson.build                        | 108 +++++++++++++++++++
 drivers/mempool/ring/meson.build                   |  32 ++++++
 drivers/mempool/stack/meson.build                  |  32 ++++++
 drivers/meson.build                                |  34 ++++++
 drivers/net/af_packet/meson.build                  |  35 +++++++
 drivers/net/ark/meson.build                        |  45 ++++++++
 drivers/net/avp/meson.build                        |  34 ++++++
 drivers/net/i40e/base/meson.build                  |  56 ++++++++++
 drivers/net/i40e/meson.build                       |  61 +++++++++++
 drivers/net/ixgbe/base/meson.build                 |  60 +++++++++++
 drivers/net/ixgbe/meson.build                      |  58 +++++++++++
 drivers/net/meson.build                            | 108 +++++++++++++++++++
 drivers/net/pcap/meson.build                       |  41 ++++++++
 examples/helloworld/Makefile                       |  13 +++
 examples/l2fwd/Makefile                            |  13 +++
 lib/librte_acl/meson.build                         |  60 +++++++++++
 lib/librte_bitratestats/meson.build                |  34 ++++++
 lib/librte_cfgfile/meson.build                     |  35 +++++++
 lib/librte_cmdline/meson.build                     |  57 +++++++++++
 lib/librte_compat/meson.build                      |  36 +++++++
 lib/librte_cryptodev/meson.build                   |  40 ++++++++
 lib/librte_distributor/meson.build                 |  39 +++++++
 lib/librte_eal/bsdapp/eal/meson.build              |  67 ++++++++++++
 lib/librte_eal/bsdapp/meson.build                  |  32 ++++++
 lib/librte_eal/common/arch/meson.build             |  33 ++++++
 lib/librte_eal/common/arch/x86/meson.build         |  32 ++++++
 lib/librte_eal/common/include/arch/meson.build     |  33 ++++++
 lib/librte_eal/common/include/arch/x86/meson.build |  48 +++++++++
 lib/librte_eal/common/include/meson.build          |  71 +++++++++++++
 lib/librte_eal/common/meson.build                  |  71 +++++++++++++
 lib/librte_eal/linuxapp/eal/meson.build            |  72 +++++++++++++
 lib/librte_eal/linuxapp/igb_uio/Kbuild             |   1 +
 lib/librte_eal/linuxapp/igb_uio/meson.build        |  47 +++++++++
 lib/librte_eal/linuxapp/meson.build                |  42 ++++++++
 lib/librte_eal/meson.build                         |  44 ++++++++
 lib/librte_efd/meson.build                         |  34 ++++++
 lib/librte_ether/meson.build                       |  46 +++++++++
 lib/librte_eventdev/meson.build                    |  36 +++++++
 lib/librte_gro/meson.build                         |  34 ++++++
 lib/librte_hash/meson.build                        |  46 +++++++++
 lib/librte_ip_frag/Makefile                        |   2 +-
 lib/librte_ip_frag/meson.build                     |  39 +++++++
 ..._ipfrag_version.map => rte_ip_frag_version.map} |   0
 lib/librte_jobstats/meson.build                    |  34 ++++++
 lib/librte_kni/meson.build                         |  35 +++++++
 lib/librte_kvargs/meson.build                      |  35 +++++++
 lib/librte_latencystats/meson.build                |  34 ++++++
 lib/librte_lpm/meson.build                         |  35 +++++++
 lib/librte_mbuf/meson.build                        |  36 +++++++
 lib/librte_mempool/meson.build                     |  35 +++++++
 lib/librte_meter/meson.build                       |  34 ++++++
 lib/librte_metrics/meson.build                     |  34 ++++++
 lib/librte_net/meson.build                         |  46 +++++++++
 lib/librte_pdump/meson.build                       |  34 ++++++
 lib/librte_pipeline/meson.build                    |  35 +++++++
 lib/librte_port/meson.build                        |  58 +++++++++++
 lib/librte_power/meson.build                       |  35 +++++++
 lib/librte_reorder/meson.build                     |  34 ++++++
 lib/librte_ring/meson.build                        |  34 ++++++
 lib/librte_sched/meson.build                       |  36 +++++++
 lib/librte_table/meson.build                       |  52 ++++++++++
 lib/librte_timer/meson.build                       |  34 ++++++
 lib/librte_vhost/meson.build                       |  36 +++++++
 lib/meson.build                                    | 105 +++++++++++++++++++
 meson.build                                        |  88 ++++++++++++++++
 meson_options.txt                                  |   8 ++
 usertools/meson.build                              |  32 ++++++
 82 files changed, 3536 insertions(+), 3 deletions(-)
 create mode 100644 app/meson.build
 create mode 100644 app/test-pmd/meson.build
 create mode 100755 buildtools/gen-pmdinfo-cfile.sh
 create mode 100644 buildtools/meson.build
 create mode 100644 buildtools/pmdinfogen/meson.build
 create mode 100644 config/meson.build
 create mode 100644 config/rte_config.h
 create mode 100644 config/x86/meson.build
 create mode 100644 drivers/crypto/meson.build
 create mode 100644 drivers/crypto/null/meson.build
 rename drivers/crypto/null/{rte_pmd_null_crypto_version.map => rte_pmd_null_version.map} (100%)
 create mode 100644 drivers/crypto/openssl/meson.build
 create mode 100644 drivers/crypto/qat/meson.build
 create mode 100644 drivers/mempool/meson.build
 create mode 100644 drivers/mempool/ring/meson.build
 create mode 100644 drivers/mempool/stack/meson.build
 create mode 100644 drivers/meson.build
 create mode 100644 drivers/net/af_packet/meson.build
 create mode 100644 drivers/net/ark/meson.build
 create mode 100644 drivers/net/avp/meson.build
 create mode 100644 drivers/net/i40e/base/meson.build
 create mode 100644 drivers/net/i40e/meson.build
 create mode 100644 drivers/net/ixgbe/base/meson.build
 create mode 100644 drivers/net/ixgbe/meson.build
 create mode 100644 drivers/net/meson.build
 create mode 100644 drivers/net/pcap/meson.build
 create mode 100644 lib/librte_acl/meson.build
 create mode 100644 lib/librte_bitratestats/meson.build
 create mode 100644 lib/librte_cfgfile/meson.build
 create mode 100644 lib/librte_cmdline/meson.build
 create mode 100644 lib/librte_compat/meson.build
 create mode 100644 lib/librte_cryptodev/meson.build
 create mode 100644 lib/librte_distributor/meson.build
 create mode 100644 lib/librte_eal/bsdapp/eal/meson.build
 create mode 100644 lib/librte_eal/bsdapp/meson.build
 create mode 100644 lib/librte_eal/common/arch/meson.build
 create mode 100644 lib/librte_eal/common/arch/x86/meson.build
 create mode 100644 lib/librte_eal/common/include/arch/meson.build
 create mode 100644 lib/librte_eal/common/include/arch/x86/meson.build
 create mode 100644 lib/librte_eal/common/include/meson.build
 create mode 100644 lib/librte_eal/common/meson.build
 create mode 100644 lib/librte_eal/linuxapp/eal/meson.build
 create mode 100644 lib/librte_eal/linuxapp/igb_uio/Kbuild
 create mode 100644 lib/librte_eal/linuxapp/igb_uio/meson.build
 create mode 100644 lib/librte_eal/linuxapp/meson.build
 create mode 100644 lib/librte_eal/meson.build
 create mode 100644 lib/librte_efd/meson.build
 create mode 100644 lib/librte_ether/meson.build
 create mode 100644 lib/librte_eventdev/meson.build
 create mode 100644 lib/librte_gro/meson.build
 create mode 100644 lib/librte_hash/meson.build
 create mode 100644 lib/librte_ip_frag/meson.build
 rename lib/librte_ip_frag/{rte_ipfrag_version.map => rte_ip_frag_version.map} (100%)
 create mode 100644 lib/librte_jobstats/meson.build
 create mode 100644 lib/librte_kni/meson.build
 create mode 100644 lib/librte_kvargs/meson.build
 create mode 100644 lib/librte_latencystats/meson.build
 create mode 100644 lib/librte_lpm/meson.build
 create mode 100644 lib/librte_mbuf/meson.build
 create mode 100644 lib/librte_mempool/meson.build
 create mode 100644 lib/librte_meter/meson.build
 create mode 100644 lib/librte_metrics/meson.build
 create mode 100644 lib/librte_net/meson.build
 create mode 100644 lib/librte_pdump/meson.build
 create mode 100644 lib/librte_pipeline/meson.build
 create mode 100644 lib/librte_port/meson.build
 create mode 100644 lib/librte_power/meson.build
 create mode 100644 lib/librte_reorder/meson.build
 create mode 100644 lib/librte_ring/meson.build
 create mode 100644 lib/librte_sched/meson.build
 create mode 100644 lib/librte_table/meson.build
 create mode 100644 lib/librte_timer/meson.build
 create mode 100644 lib/librte_vhost/meson.build
 create mode 100644 lib/meson.build
 create mode 100644 meson.build
 create mode 100644 meson_options.txt
 create mode 100644 usertools/meson.build
Signature · 1 line
2.13.4
#1 lore raw

RFC v2 1/40 build: initial hooks for using meson with DPDK

---
 config/meson.build     | 47 ++++++++++++++++++++++++++++++++++
 config/rte_config.h    | 50 +++++++++++++++++++++++++++++++++++++
 config/x86/meson.build | 68 ++++++++++++++++++++++++++++++++++++++++++++++++++
 meson.build            | 60 ++++++++++++++++++++++++++++++++++++++++++++
 meson_options.txt      |  1 +
 5 files changed, 226 insertions(+)
 create mode 100644 config/meson.build
 create mode 100644 config/rte_config.h
 create mode 100644 config/x86/meson.build
 create mode 100644 meson.build
 create mode 100644 meson_options.txt
config/meson.build new file +47 -0
new file mode 100644
index 000000000..59247d784
@@ -0,0 +1,47 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation. All rights reserved.
+#   All rights reserved.
+#
+#   Redistribution and use in source and binary forms, with or without
+#   modification, are permitted provided that the following conditions
+#   are met:
+#
+#     * Redistributions of source code must retain the above copyright
+#       notice, this list of conditions and the following disclaimer.
+#     * Redistributions in binary form must reproduce the above copyright
+#       notice, this list of conditions and the following disclaimer in
+#       the documentation and/or other materials provided with the
+#       distribution.
+#     * Neither the name of Intel Corporation nor the names of its
+#       contributors may be used to endorse or promote products derived
+#       from this software without specific prior written permission.
+#
+#   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+#   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+#   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+#   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+#   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+#   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+#   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+#   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+#   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+#   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+#   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+# set the machine type and cflags for it
+machine = get_option('machine')
+dpdk_conf.set('RTE_MACHINE', machine)
+add_project_arguments('-march=@0@'.format(machine), language: 'c')
+
+compile_time_cpuflags = []
+if host_machine.cpu_family().startswith('x86')
+	subdir('x86')
+endif
+dpdk_conf.set('RTE_COMPILE_TIME_CPUFLAGS', ','.join(compile_time_cpuflags))
+
+
+# set the install path for the drivers
+dpdk_conf.set_quoted('RTE_EAL_PMD_PATH', driver_install_path)
+
+install_headers('rte_config.h')
config/rte_config.h new file +50 -0

50 lines not on this page · raw message

config/x86/meson.build new file +68 -0

68 lines not on this page · raw message

meson.build new file +60 -0

60 lines not on this page · raw message

meson_options.txt new file +1 -0
new file mode 100644
index 000000000..94365567e
@@ -0,0 +1 @@
+option('machine', type : 'string', value : 'native', description : 'set the target machine type')
Signature · 1 line
2.13.4
#2 lore raw

RFC v2 2/40 build: create pkg-config file for DPDK

In reply to Bruce Richardson
---
 meson.build | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)
meson.build +16 -1
index 8383d23b5..d7acf174d 100644
@@ -36,9 +36,10 @@ project('DPDK', 'C',
 	meson_version: '>= 0.40.1'
 )
 
-# set up some global vars for compiler, platform and configuration
+# set up some global vars for compiler, platform, configuration, etc.
 cc = meson.get_compiler('c')
 dpdk_conf = configuration_data()
+dpdk_libraries = []
 
 # for static libs, treat the drivers as regular libraries, otherwise
 # for shared libs, put them in a driver folder
@@ -58,3 +59,17 @@ build_cfg = 'rte_build_config.h'
 configure_file(output: build_cfg,
 		configuration: dpdk_conf,
 		install_dir: get_option('includedir'))
+
+# the DPDK libs needs to be passed to the link command in reverse order
+dpdk_link_libs = []
+foreach lib: dpdk_libraries
+	dpdk_link_libs = [lib] + dpdk_link_libs
+endforeach
+
+pkg = import('pkgconfig')
+pkg.generate(name: meson.project_name(),
+	version: meson.project_version(),
+	libraries: dpdk_link_libs,
+	description: 'The Data Plane Development Kit (DPDK)',
+	extra_cflags: '-include "rte_config.h"'
+)
Signature · 1 line
2.13.4
#3 lore raw

RFC v2 3/40 build: build linuxapp EAL with meson and ninja

In reply to Bruce Richardson
---
 config/meson.build                                 | 24 +++++++-
 config/rte_config.h                                |  9 +++
 config/x86/meson.build                             |  2 +
 lib/librte_eal/common/arch/meson.build             | 33 ++++++++++
 lib/librte_eal/common/arch/x86/meson.build         | 32 ++++++++++
 lib/librte_eal/common/include/arch/meson.build     | 33 ++++++++++
 lib/librte_eal/common/include/arch/x86/meson.build | 47 ++++++++++++++
 lib/librte_eal/common/include/meson.build          | 71 ++++++++++++++++++++++
 lib/librte_eal/common/meson.build                  | 71 ++++++++++++++++++++++
 lib/librte_eal/linuxapp/eal/meson.build            | 62 +++++++++++++++++++
 lib/librte_eal/linuxapp/meson.build                | 32 ++++++++++
 lib/librte_eal/meson.build                         | 40 ++++++++++++
 lib/meson.build                                    | 41 +++++++++++++
 meson.build                                        |  3 +
 meson_options.txt                                  |  7 ++-
 15 files changed, 504 insertions(+), 3 deletions(-)
 create mode 100644 lib/librte_eal/common/arch/meson.build
 create mode 100644 lib/librte_eal/common/arch/x86/meson.build
 create mode 100644 lib/librte_eal/common/include/arch/meson.build
 create mode 100644 lib/librte_eal/common/include/arch/x86/meson.build
 create mode 100644 lib/librte_eal/common/include/meson.build
 create mode 100644 lib/librte_eal/common/meson.build
 create mode 100644 lib/librte_eal/linuxapp/eal/meson.build
 create mode 100644 lib/librte_eal/linuxapp/meson.build
 create mode 100644 lib/librte_eal/meson.build
 create mode 100644 lib/meson.build
config/meson.build +22 -2
index 59247d784..4a6a69d13 100644
@@ -34,14 +34,34 @@ machine = get_option('machine')
 dpdk_conf.set('RTE_MACHINE', machine)
 add_project_arguments('-march=@0@'.format(machine), language: 'c')
 
+# add -include rte_config to cflags
+add_project_arguments('-include', 'rte_config.h', language: 'c')
+
+# disable any unwanted warnings
+unwanted_warnings = [
+	'-Wno-address-of-packed-member',
+	'-Wno-format-truncation'
+]
+foreach arg: unwanted_warnings
+	if cc.has_argument(arg)
+		add_project_arguments(arg, language: 'c')
+	endif
+endforeach
+
 compile_time_cpuflags = []
 if host_machine.cpu_family().startswith('x86')
-	subdir('x86')
+	arch_subdir = 'x86'
+	subdir(arch_subdir)
 endif
 dpdk_conf.set('RTE_COMPILE_TIME_CPUFLAGS', ','.join(compile_time_cpuflags))
 
-
 # set the install path for the drivers
 dpdk_conf.set_quoted('RTE_EAL_PMD_PATH', driver_install_path)
 
+# set other values pulled from the build options
+dpdk_conf.set('RTE_MAX_LCORE', get_option('max_lcores'))
+dpdk_conf.set('RTE_MAX_NUMA_NODES', get_option('max_numa_nodes'))
+dpdk_conf.set('RTE_LIBEAL_USE_HPET', get_option('use_hpet'))
+dpdk_conf.set('RTE_EAL_ALLOW_INV_SOCKET_ID', get_option('allow_invalid_socket_id'))
+
 install_headers('rte_config.h')
config/rte_config.h +9 -0
index 79b0db90f..7724ebcbe 100644
@@ -47,4 +47,13 @@
 
 #include <rte_build_config.h>
 
+/* EAL defines */
+#define RTE_MAX_MEMSEG 512
+#define RTE_MAX_MEMZONE 2560
+#define RTE_MAX_TAILQ 32
+#define RTE_LOG_LEVEL RTE_LOG_INFO
+#define RTE_LOG_DP_LEVEL RTE_LOG_INFO
+#define RTE_BACKTRACE 1
+#define RTE_EAL_VFIO 1
+
 #endif /* _RTE_CONFIG_H_ */
config/x86/meson.build +2 -0
index 8fa3a38c0..54f8bcdb6 100644
@@ -66,3 +66,5 @@ if cc.get_define('__AVX2__', args: march_opt) != ''
 	dpdk_conf.set('RTE_MACHINE_CPUFLAG_AVX2', 1)
 	compile_time_cpuflags += ['RTE_CPUFLAG_AVX2']
 endif
+
+dpdk_conf.set('RTE_CACHE_LINE_SIZE', 64)
lib/librte_eal/common/arch/meson.build new file +33 -0
new file mode 100644
index 000000000..863d7e4bb
@@ -0,0 +1,33 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation. All rights reserved.
+#   All rights reserved.
+#
+#   Redistribution and use in source and binary forms, with or without
+#   modification, are permitted provided that the following conditions
+#   are met:
+#
+#     * Redistributions of source code must retain the above copyright
+#       notice, this list of conditions and the following disclaimer.
+#     * Redistributions in binary form must reproduce the above copyright
+#       notice, this list of conditions and the following disclaimer in
+#       the documentation and/or other materials provided with the
+#       distribution.
+#     * Neither the name of Intel Corporation nor the names of its
+#       contributors may be used to endorse or promote products derived
+#       from this software without specific prior written permission.
+#
+#   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+#   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+#   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+#   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+#   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+#   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+#   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+#   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+#   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+#   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+#   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+eal_inc += include_directories(arch_subdir)
+subdir(arch_subdir)
lib/librte_eal/common/arch/x86/meson.build new file +32 -0
new file mode 100644
index 000000000..8fabad648
@@ -0,0 +1,32 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation. All rights reserved.
+#   All rights reserved.
+#
+#   Redistribution and use in source and binary forms, with or without
+#   modification, are permitted provided that the following conditions
+#   are met:
+#
+#     * Redistributions of source code must retain the above copyright
+#       notice, this list of conditions and the following disclaimer.
+#     * Redistributions in binary form must reproduce the above copyright
+#       notice, this list of conditions and the following disclaimer in
+#       the documentation and/or other materials provided with the
+#       distribution.
+#     * Neither the name of Intel Corporation nor the names of its
+#       contributors may be used to endorse or promote products derived
+#       from this software without specific prior written permission.
+#
+#   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+#   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+#   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+#   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+#   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+#   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+#   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+#   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+#   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+#   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+#   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+eal_common_arch_sources = files('rte_spinlock.c', 'rte_cpuflags.c')
lib/librte_eal/common/include/arch/meson.build new file +33 -0
new file mode 100644
index 000000000..863d7e4bb
@@ -0,0 +1,33 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation. All rights reserved.
+#   All rights reserved.
+#
+#   Redistribution and use in source and binary forms, with or without
+#   modification, are permitted provided that the following conditions
+#   are met:
+#
+#     * Redistributions of source code must retain the above copyright
+#       notice, this list of conditions and the following disclaimer.
+#     * Redistributions in binary form must reproduce the above copyright
+#       notice, this list of conditions and the following disclaimer in
+#       the documentation and/or other materials provided with the
+#       distribution.
+#     * Neither the name of Intel Corporation nor the names of its
+#       contributors may be used to endorse or promote products derived
+#       from this software without specific prior written permission.
+#
+#   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+#   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+#   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+#   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+#   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+#   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+#   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+#   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+#   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+#   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+#   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+eal_inc += include_directories(arch_subdir)
+subdir(arch_subdir)
lib/librte_eal/common/include/arch/x86/meson.build new file +47 -0

47 lines not on this page · raw message

lib/librte_eal/common/include/meson.build new file +71 -0

71 lines not on this page · raw message

lib/librte_eal/common/meson.build new file +71 -0

71 lines not on this page · raw message

lib/librte_eal/linuxapp/eal/meson.build new file +62 -0

62 lines not on this page · raw message

lib/librte_eal/linuxapp/meson.build new file +32 -0
new file mode 100644
index 000000000..bc9f22175
@@ -0,0 +1,32 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation. All rights reserved.
+#   All rights reserved.
+#
+#   Redistribution and use in source and binary forms, with or without
+#   modification, are permitted provided that the following conditions
+#   are met:
+#
+#     * Redistributions of source code must retain the above copyright
+#       notice, this list of conditions and the following disclaimer.
+#     * Redistributions in binary form must reproduce the above copyright
+#       notice, this list of conditions and the following disclaimer in
+#       the documentation and/or other materials provided with the
+#       distribution.
+#     * Neither the name of Intel Corporation nor the names of its
+#       contributors may be used to endorse or promote products derived
+#       from this software without specific prior written permission.
+#
+#   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+#   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+#   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+#   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+#   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+#   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+#   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+#   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+#   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+#   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+#   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+subdir('eal')
lib/librte_eal/meson.build new file +40 -0
new file mode 100644
index 000000000..f24799625
@@ -0,0 +1,40 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation. All rights reserved.
+#   All rights reserved.
+#
+#   Redistribution and use in source and binary forms, with or without
+#   modification, are permitted provided that the following conditions
+#   are met:
+#
+#     * Redistributions of source code must retain the above copyright
+#       notice, this list of conditions and the following disclaimer.
+#     * Redistributions in binary form must reproduce the above copyright
+#       notice, this list of conditions and the following disclaimer in
+#       the documentation and/or other materials provided with the
+#       distribution.
+#     * Neither the name of Intel Corporation nor the names of its
+#       contributors may be used to endorse or promote products derived
+#       from this software without specific prior written permission.
+#
+#   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+#   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+#   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+#   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+#   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+#   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+#   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+#   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+#   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+#   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+#   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+eal_inc = [global_inc]
+subdir('common')
+if host_machine.system() == 'linux'
+	subdir('linuxapp')
+elif host_machine.system() == 'freebsd'
+	subdir('bsdapp')
+else
+	error('unsupported system type @0@'.format(hostmachine.system()))
+endif
lib/meson.build new file +41 -0

41 lines not on this page · raw message

meson.build +3 -0
index d7acf174d..d797bbbb2 100644
@@ -54,6 +54,9 @@ endif
 global_inc = include_directories('.', 'config')
 subdir('config')
 
+# now build libs and drivers
+subdir('lib')
+
 # write the build config
 build_cfg = 'rte_build_config.h'
 configure_file(output: build_cfg,
meson_options.txt +6 -1
index 94365567e..8f1db5330 100644
@@ -1 +1,6 @@
-option('machine', type : 'string', value : 'native', description : 'set the target machine type')
+option('machine', type: 'string', value: 'native', description: 'set the target machine type')
+option('max_lcores', type: 'string', value: '128', description: 'maximum number of cores/threads supported by EAL')
+option('max_numa_nodes', type: 'string', value: '4', description: 'maximum number of NUMA nodes supported by EAL')
+option('use_hpet', type: 'boolean', value: false, description: 'use HPET timer in EAL')
+option('allow_invalid_socket_id', type: 'boolean', value: false,
+	 description: 'allow out-of-range NUMA socket id\'s for platforms that don\'t report the value correctly')
Signature · 1 line
2.13.4
#4 lore raw

RFC v2 4/40 build: add EAL support under BSD

In reply to Bruce Richardson
---
 lib/librte_eal/bsdapp/eal/meson.build | 58 +++++++++++++++++++++++++++++++++++
 lib/librte_eal/bsdapp/meson.build     | 32 +++++++++++++++++++
 lib/librte_eal/meson.build            |  2 ++
 3 files changed, 92 insertions(+)
 create mode 100644 lib/librte_eal/bsdapp/eal/meson.build
 create mode 100644 lib/librte_eal/bsdapp/meson.build
lib/librte_eal/bsdapp/eal/meson.build new file +58 -0
new file mode 100644
index 000000000..1df28d507
@@ -0,0 +1,58 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation. All rights reserved.
+#   All rights reserved.
+#
+#   Redistribution and use in source and binary forms, with or without
+#   modification, are permitted provided that the following conditions
+#   are met:
+#
+#     * Redistributions of source code must retain the above copyright
+#       notice, this list of conditions and the following disclaimer.
+#     * Redistributions in binary form must reproduce the above copyright
+#       notice, this list of conditions and the following disclaimer in
+#       the documentation and/or other materials provided with the
+#       distribution.
+#     * Neither the name of Intel Corporation nor the names of its
+#       contributors may be used to endorse or promote products derived
+#       from this software without specific prior written permission.
+#
+#   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+#   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+#   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+#   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+#   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+#   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+#   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+#   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+#   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+#   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+#   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+eal_inc += include_directories('include')
+dpdk_includes += '-I@0@/include'.format(meson.current_source_dir())
+install_subdir('include/exec-env', install_dir: 'include')
+
+sources = ['eal_alarm.c',
+		'eal_debug.c',
+		'eal_hugepage_info.c',
+		'eal_interrupts.c',
+		'eal_lcore.c',
+		'eal_thread.c',
+		'eal_timer.c',
+		'eal.c',
+		'eal_memory.c',
+		'eal_pci.c',
+]
+
+eal_lib = library('rte_eal', sources, eal_common_sources, eal_common_arch_sources,
+			dependencies: dependency('threads'),
+			include_directories : eal_inc,
+			c_args: '-D_GNU_SOURCE',
+			link_args: '-lexecinfo',
+			install: true
+)
+
+dpdk_libraries += ['-pthread', eal_lib]
+
+rte_eal = declare_dependency(link_with: eal_lib, include_directories: eal_inc)
lib/librte_eal/bsdapp/meson.build new file +32 -0
new file mode 100644
index 000000000..bc9f22175
@@ -0,0 +1,32 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation. All rights reserved.
+#   All rights reserved.
+#
+#   Redistribution and use in source and binary forms, with or without
+#   modification, are permitted provided that the following conditions
+#   are met:
+#
+#     * Redistributions of source code must retain the above copyright
+#       notice, this list of conditions and the following disclaimer.
+#     * Redistributions in binary form must reproduce the above copyright
+#       notice, this list of conditions and the following disclaimer in
+#       the documentation and/or other materials provided with the
+#       distribution.
+#     * Neither the name of Intel Corporation nor the names of its
+#       contributors may be used to endorse or promote products derived
+#       from this software without specific prior written permission.
+#
+#   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+#   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+#   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+#   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+#   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+#   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+#   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+#   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+#   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+#   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+#   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+subdir('eal')
lib/librte_eal/meson.build +2 -0
index f24799625..219501c86 100644
@@ -32,8 +32,10 @@
 eal_inc = [global_inc]
 subdir('common')
 if host_machine.system() == 'linux'
+	dpdk_conf.set('RTE_EXEC_ENV_LINUXAPP', 1)
 	subdir('linuxapp')
 elif host_machine.system() == 'freebsd'
+	dpdk_conf.set('RTE_EXEC_ENV_BSDAPP', 1)
 	subdir('bsdapp')
 else
 	error('unsupported system type @0@'.format(hostmachine.system()))
Signature · 1 line
2.13.4
#5 lore raw

RFC v2 5/40 build: add core libraries to meson build system

In reply to Bruce Richardson
---
 config/rte_config.h            | 14 ++++++++++
 lib/librte_cmdline/meson.build | 63 ++++++++++++++++++++++++++++++++++++++++++
 lib/librte_compat/meson.build  | 35 +++++++++++++++++++++++
 lib/librte_ether/meson.build   | 49 ++++++++++++++++++++++++++++++++
 lib/librte_hash/meson.build    | 54 ++++++++++++++++++++++++++++++++++++
 lib/librte_kvargs/meson.build  | 43 ++++++++++++++++++++++++++++
 lib/librte_mbuf/meson.build    | 42 ++++++++++++++++++++++++++++
 lib/librte_mempool/meson.build | 43 ++++++++++++++++++++++++++++
 lib/librte_net/meson.build     | 52 ++++++++++++++++++++++++++++++++++
 lib/librte_ring/meson.build    | 43 ++++++++++++++++++++++++++++
 lib/meson.build                | 18 ++++++------
 11 files changed, 447 insertions(+), 9 deletions(-)
 create mode 100644 lib/librte_cmdline/meson.build
 create mode 100644 lib/librte_compat/meson.build
 create mode 100644 lib/librte_ether/meson.build
 create mode 100644 lib/librte_hash/meson.build
 create mode 100644 lib/librte_kvargs/meson.build
 create mode 100644 lib/librte_mbuf/meson.build
 create mode 100644 lib/librte_mempool/meson.build
 create mode 100644 lib/librte_net/meson.build
 create mode 100644 lib/librte_ring/meson.build
config/rte_config.h +14 -0
index 7724ebcbe..4d5f7214c 100644
@@ -56,4 +56,18 @@
 #define RTE_BACKTRACE 1
 #define RTE_EAL_VFIO 1
 
+/* mempool defines */
+#define RTE_MEMPOOL_CACHE_MAX_SIZE 512
+
+/* mbuf defines */
+#define RTE_MBUF_DEFAULT_MEMPOOL_OPS "ring_mp_mc"
+#define RTE_MBUF_REFCNT_ATOMIC 1
+#define RTE_PKTMBUF_HEADROOM 128
+
+/* ether defines */
+#define RTE_MAX_ETHPORTS 32
+#define RTE_MAX_QUEUES_PER_PORT 1024
+#define RTE_ETHDEV_QUEUE_STAT_CNTRS 16
+#define RTE_ETHDEV_RXTX_CALLBACKS 1
+
 #endif /* _RTE_CONFIG_H_ */
lib/librte_cmdline/meson.build new file +63 -0

63 lines not on this page · raw message

lib/librte_compat/meson.build new file +35 -0
new file mode 100644
index 000000000..d4a994523
@@ -0,0 +1,35 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation. All rights reserved.
+#   All rights reserved.
+#
+#   Redistribution and use in source and binary forms, with or without
+#   modification, are permitted provided that the following conditions
+#   are met:
+#
+#     * Redistributions of source code must retain the above copyright
+#       notice, this list of conditions and the following disclaimer.
+#     * Redistributions in binary form must reproduce the above copyright
+#       notice, this list of conditions and the following disclaimer in
+#       the documentation and/or other materials provided with the
+#       distribution.
+#     * Neither the name of Intel Corporation nor the names of its
+#       contributors may be used to endorse or promote products derived
+#       from this software without specific prior written permission.
+#
+#   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+#   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+#   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+#   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+#   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+#   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+#   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+#   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+#   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+#   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+#   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+install_headers('rte_compat.h')
+
+rte_compat = declare_dependency(include_directories: include_directories('.'))
lib/librte_ether/meson.build new file +49 -0

49 lines not on this page · raw message

lib/librte_hash/meson.build new file +54 -0

54 lines not on this page · raw message

lib/librte_kvargs/meson.build new file +43 -0

43 lines not on this page · raw message

lib/librte_mbuf/meson.build new file +42 -0

42 lines not on this page · raw message

lib/librte_mempool/meson.build new file +43 -0

43 lines not on this page · raw message

lib/librte_net/meson.build new file +52 -0

52 lines not on this page · raw message

lib/librte_ring/meson.build new file +43 -0

43 lines not on this page · raw message

lib/meson.build +9 -9
index e7249bc8d..0ea608684 100644
@@ -30,12 +30,12 @@
 #   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 subdir('librte_eal')
-#subdir('librte_ring')
-#subdir('librte_mempool')
-#subdir('librte_cmdline')
-#subdir('librte_mbuf')
-#subdir('librte_net')
-#subdir('librte_ether')
-#subdir('librte_compat')
-#subdir('librte_hash')
-#subdir('librte_kvargs')
+subdir('librte_ring')
+subdir('librte_mempool')
+subdir('librte_cmdline')
+subdir('librte_mbuf')
+subdir('librte_net')
+subdir('librte_ether')
+subdir('librte_compat')
+subdir('librte_hash')
+subdir('librte_kvargs')
Signature · 1 line
2.13.4
#6 lore raw

RFC v2 6/40 build: add i40e driver to meson build

In reply to Bruce Richardson
---
 config/rte_config.h               | 14 ++++++++
 drivers/meson.build               | 32 ++++++++++++++++++
 drivers/net/i40e/base/meson.build | 55 ++++++++++++++++++++++++++++++
 drivers/net/i40e/meson.build      | 70 +++++++++++++++++++++++++++++++++++++++
 drivers/net/meson.build           | 32 ++++++++++++++++++
 meson.build                       |  7 ++++
 6 files changed, 210 insertions(+)
 create mode 100644 drivers/meson.build
 create mode 100644 drivers/net/i40e/base/meson.build
 create mode 100644 drivers/net/i40e/meson.build
 create mode 100644 drivers/net/meson.build
config/rte_config.h +14 -0
index 4d5f7214c..5b687bb8e 100644
@@ -47,6 +47,8 @@
 
 #include <rte_build_config.h>
 
+/****** library defines ********/
+
 /* EAL defines */
 #define RTE_MAX_MEMSEG 512
 #define RTE_MAX_MEMZONE 2560
@@ -70,4 +72,16 @@
 #define RTE_ETHDEV_QUEUE_STAT_CNTRS 16
 #define RTE_ETHDEV_RXTX_CALLBACKS 1
 
+/****** driver defines ********/
+
+/* i40e defines */
+#define RTE_LIBRTE_I40E_RX_ALLOW_BULK_ALLOC 1
+#define RTE_LIBRTE_I40E_INC_VECTOR 1
+#undef RTE_LIBRTE_I40E_16BYTE_RX_DESC
+#define RTE_LIBRTE_I40E_QUEUE_NUM_PER_PF 64
+#define RTE_LIBRTE_I40E_QUEUE_NUM_PER_VF 4
+#define RTE_LIBRTE_I40E_QUEUE_NUM_PER_VM 4
+/* interval up to 8160 us, aligned to 2 (or default value) */
+#define RTE_LIBRTE_I40E_ITR_INTERVAL -1
+
 #endif /* _RTE_CONFIG_H_ */
drivers/meson.build new file +32 -0
new file mode 100644
index 000000000..57f47c36f
@@ -0,0 +1,32 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation. All rights reserved.
+#   All rights reserved.
+#
+#   Redistribution and use in source and binary forms, with or without
+#   modification, are permitted provided that the following conditions
+#   are met:
+#
+#     * Redistributions of source code must retain the above copyright
+#       notice, this list of conditions and the following disclaimer.
+#     * Redistributions in binary form must reproduce the above copyright
+#       notice, this list of conditions and the following disclaimer in
+#       the documentation and/or other materials provided with the
+#       distribution.
+#     * Neither the name of Intel Corporation nor the names of its
+#       contributors may be used to endorse or promote products derived
+#       from this software without specific prior written permission.
+#
+#   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+#   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+#   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+#   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+#   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+#   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+#   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+#   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+#   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+#   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+#   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+subdir('net')
drivers/net/i40e/base/meson.build new file +55 -0

55 lines not on this page · raw message

drivers/net/i40e/meson.build new file +70 -0

70 lines not on this page · raw message

drivers/net/meson.build new file +32 -0
new file mode 100644
index 000000000..22237b1aa
@@ -0,0 +1,32 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation. All rights reserved.
+#   All rights reserved.
+#
+#   Redistribution and use in source and binary forms, with or without
+#   modification, are permitted provided that the following conditions
+#   are met:
+#
+#     * Redistributions of source code must retain the above copyright
+#       notice, this list of conditions and the following disclaimer.
+#     * Redistributions in binary form must reproduce the above copyright
+#       notice, this list of conditions and the following disclaimer in
+#       the documentation and/or other materials provided with the
+#       distribution.
+#     * Neither the name of Intel Corporation nor the names of its
+#       contributors may be used to endorse or promote products derived
+#       from this software without specific prior written permission.
+#
+#   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+#   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+#   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+#   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+#   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+#   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+#   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+#   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+#   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+#   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+#   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+subdir('i40e')
meson.build +7 -0
index d797bbbb2..930656da6 100644
@@ -40,6 +40,7 @@ project('DPDK', 'C',
 cc = meson.get_compiler('c')
 dpdk_conf = configuration_data()
 dpdk_libraries = []
+dpdk_drivers = []
 
 # for static libs, treat the drivers as regular libraries, otherwise
 # for shared libs, put them in a driver folder
@@ -56,6 +57,7 @@ subdir('config')
 
 # now build libs and drivers
 subdir('lib')
+subdir('drivers')
 
 # write the build config
 build_cfg = 'rte_build_config.h'
@@ -63,6 +65,11 @@ configure_file(output: build_cfg,
 		configuration: dpdk_conf,
 		install_dir: get_option('includedir'))
 
+# for static builds, include the drivers directly
+if get_option('default_library') == 'static'
+	dpdk_libraries = dpdk_drivers + dpdk_libraries
+endif
+
 # the DPDK libs needs to be passed to the link command in reverse order
 dpdk_link_libs = []
 foreach lib: dpdk_libraries
Signature · 1 line
2.13.4
#7 lore raw

RFC v2 7/40 build: add pmdinfogen to build

In reply to Bruce Richardson
---
 buildtools/meson.build            | 32 +++++++++++++++++++++++++++++
 buildtools/pmdinfogen/meson.build | 43 +++++++++++++++++++++++++++++++++++++++
 meson.build                       |  1 +
 3 files changed, 76 insertions(+)
 create mode 100644 buildtools/meson.build
 create mode 100644 buildtools/pmdinfogen/meson.build
buildtools/meson.build new file +32 -0
new file mode 100644
index 000000000..92206f912
@@ -0,0 +1,32 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation. All rights reserved.
+#   All rights reserved.
+#
+#   Redistribution and use in source and binary forms, with or without
+#   modification, are permitted provided that the following conditions
+#   are met:
+#
+#     * Redistributions of source code must retain the above copyright
+#       notice, this list of conditions and the following disclaimer.
+#     * Redistributions in binary form must reproduce the above copyright
+#       notice, this list of conditions and the following disclaimer in
+#       the documentation and/or other materials provided with the
+#       distribution.
+#     * Neither the name of Intel Corporation nor the names of its
+#       contributors may be used to endorse or promote products derived
+#       from this software without specific prior written permission.
+#
+#   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+#   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+#   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+#   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+#   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+#   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+#   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+#   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+#   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+#   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+#   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+subdir('pmdinfogen')
buildtools/pmdinfogen/meson.build new file +43 -0

43 lines not on this page · raw message

meson.build +1 -0
index 930656da6..54bb4632e 100644
@@ -57,6 +57,7 @@ subdir('config')
 
 # now build libs and drivers
 subdir('lib')
+subdir('buildtools')
 subdir('drivers')
 
 # write the build config
Signature · 1 line
2.13.4
#8 lore raw

RFC v2 8/40 build: generate list of sources for pmdinfogen

In reply to Bruce Richardson
---
 drivers/net/i40e/meson.build | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
drivers/net/i40e/meson.build +6 -3
index 1e23e0820..a6d0bf4e4 100644
@@ -36,7 +36,7 @@ i40e_cflags = ['-DPF_DRIVER',
 
 subdir('base')
 
-sources = [
+sources = files(
 	'i40e_ethdev.c',
 	'i40e_rxtx.c',
 	'i40e_ethdev_vf.c',
@@ -45,12 +45,15 @@ sources = [
 	'i40e_flow.c',
 	'i40e_tm.c',
 	'rte_pmd_i40e.c'
-	]
+	)
 
 if arch_subdir == 'x86'
-	sources += 'i40e_rxtx_vec_sse.c'
+	sources += files('i40e_rxtx_vec_sse.c')
 endif
 
+pmdinfogen_srcs = run_command('grep', '--files-with-matches', 'RTE_PMD_REGISTER_.*(.*)', sources).stdout().strip().split()
+message(pmdinfogen_srcs)
+
 install_headers('rte_pmd_i40e.h')
 
 i40e_lib = library('rte_pmd_i40e', sources,
Signature · 1 line
2.13.4
#9 lore raw

RFC v2 9/40 build: build i40e driver, including pmdinfo

In reply to Bruce Richardson
---
 buildtools/gen-pmdinfo-cfile.sh                | 45 ++++++++++++++++++++++++++
 buildtools/meson.build                         |  2 ++
 drivers/net/i40e/meson.build                   | 30 ++++++++++++-----
 lib/librte_cmdline/meson.build                 | 17 +++++-----
 lib/librte_eal/common/include/arch/meson.build |  1 +
 lib/librte_eal/common/include/meson.build      |  1 +
 lib/librte_eal/linuxapp/eal/meson.build        |  1 +
 lib/librte_eal/meson.build                     |  1 +
 lib/librte_ether/meson.build                   |  5 ++-
 lib/librte_hash/meson.build                    |  5 ++-
 lib/librte_kvargs/meson.build                  |  5 ++-
 lib/librte_mbuf/meson.build                    |  5 ++-
 lib/librte_mempool/meson.build                 |  5 ++-
 lib/librte_net/meson.build                     |  5 ++-
 lib/librte_ring/meson.build                    |  5 ++-
 lib/meson.build                                | 31 ++++++++++++------
 meson.build                                    | 13 +++-----
 17 files changed, 122 insertions(+), 55 deletions(-)
 create mode 100755 buildtools/gen-pmdinfo-cfile.sh
buildtools/gen-pmdinfo-cfile.sh new file +45 -0
new file mode 100755
index 000000000..a042375a8
@@ -0,0 +1,45 @@
+#! /bin/sh
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation. All rights reserved.
+#   All rights reserved.
+#
+#   Redistribution and use in source and binary forms, with or without
+#   modification, are permitted provided that the following conditions
+#   are met:
+#
+#     * Redistributions of source code must retain the above copyright
+#       notice, this list of conditions and the following disclaimer.
+#     * Redistributions in binary form must reproduce the above copyright
+#       notice, this list of conditions and the following disclaimer in
+#       the documentation and/or other materials provided with the
+#       distribution.
+#     * Neither the name of Intel Corporation nor the names of its
+#       contributors may be used to endorse or promote products derived
+#       from this software without specific prior written permission.
+#
+#   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+#   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+#   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+#   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+#   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+#   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+#   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+#   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+#   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+#   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+#   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+input=$1
+output=$2
+pmdinfogen=$3
+CFLAGS=$4
+build_root=$5
+
+tmp_o=${output%.c.pmd.o}.o
+tmp_c=${output%.o}.c
+
+set -x
+cc -Wfatal-errors $CFLAGS -I$build_root -include rte_config.h -c $input -o $tmp_o && \
+		$pmdinfogen $tmp_o $tmp_c && \
+		cc -c $tmp_c -o $output
buildtools/meson.build +2 -0
index 92206f912..a08000be0 100644
@@ -30,3 +30,5 @@
 #   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 subdir('pmdinfogen')
+
+pmdinfo = find_program('gen-pmdinfo-cfile.sh')
drivers/net/i40e/meson.build +22 -8
index a6d0bf4e4..e1c3e17a9 100644
@@ -47,21 +47,35 @@ sources = files(
 	'rte_pmd_i40e.c'
 	)
 
+deps = [rte_eal, rte_net,
+	rte_mbuf, rte_ether,
+	rte_mempool, rte_ring,
+	rte_hash, rte_kvargs]
+
 if arch_subdir == 'x86'
 	sources += files('i40e_rxtx_vec_sse.c')
 endif
 
-pmdinfogen_srcs = run_command('grep', '--files-with-matches', 'RTE_PMD_REGISTER_.*(.*)', sources).stdout().strip().split()
-message(pmdinfogen_srcs)
-
 install_headers('rte_pmd_i40e.h')
 
-i40e_lib = library('rte_pmd_i40e', sources,
+pmdinfogen_srcs = run_command('grep', '--files-with-matches',
+		'RTE_PMD_REGISTER_.*(.*)', sources).stdout().strip().split()
+objs = []
+foreach src: pmdinfogen_srcs
+	out_filename = '@[email protected]'.format(src.split('/')[-1])
+	pmd_o_file = custom_target(out_filename,
+			command: [pmdinfo, '@INPUT@', '@OUTPUT@',
+			pmdinfogen.full_path(),
+			' '.join(dpdk_includes + i40e_cflags + ['-march=@0@'.format(machine)]),
+			meson.build_root()],
+			input: src, output: out_filename,
+			depends: pmdinfogen)
+	objs += pmd_o_file
+endforeach
+
+i40e_lib = library('rte_pmd_i40e', sources, objs,
 	include_directories: include_directories('base'),
-	dependencies: [rte_eal, rte_net,
-			rte_mbuf, rte_ether,
-			rte_mempool, rte_ring,
-			rte_hash, rte_kvargs],
+	dependencies: deps,
 	link_with: base_lib,
 	c_args: i40e_cflags,
 	install: true,
lib/librte_cmdline/meson.build +8 -9
index ceac0a429..0b909b77e 100644
@@ -29,7 +29,7 @@
 #   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 #   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-sources = [ 'cmdline.c',
+sources = files('cmdline.c',
 	'cmdline_cirbuf.c',
 	'cmdline_parse.c',
 	'cmdline_parse_etheraddr.c',
@@ -39,9 +39,9 @@ sources = [ 'cmdline.c',
 	'cmdline_parse_string.c',
 	'cmdline_rdline.c',
 	'cmdline_socket.c',
-	'cmdline_vt100.c']
+	'cmdline_vt100.c')
 
-install_headers('cmdline.h',
+headers = ['cmdline.h',
 	'cmdline_parse.h',
 	'cmdline_parse_num.h',
 	'cmdline_parse_ipaddr.h',
@@ -51,13 +51,12 @@ install_headers('cmdline.h',
 	'cmdline_vt100.h',
 	'cmdline_socket.h',
 	'cmdline_cirbuf.h',
-	'cmdline_parse_portlist.h')
+	'cmdline_parse_portlist.h']
 
-cmdline_lib = library('rte_cmdline', sources, dependencies: rte_eal,
+install_headers(headers)
+
+lib = library('rte_cmdline', sources, dependencies: rte_eal,
 		install: true)
-rte_cmdline = declare_dependency(link_with: cmdline_lib,
+rte_cmdline = declare_dependency(link_with: lib,
 	include_directories: include_directories('.'))
 
-dpdk_libraries += cmdline_lib
-
-dpdk_conf.set('RTE_LIBRTE_CMDLINE', 1)
lib/librte_eal/common/include/arch/meson.build +1 -0
index 863d7e4bb..0bf3ee94d 100644
@@ -30,4 +30,5 @@
 #   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 eal_inc += include_directories(arch_subdir)
+dpdk_includes += '-I@0@/@1@'.format(meson.current_source_dir(), arch_subdir)
 subdir(arch_subdir)
lib/librte_eal/common/include/meson.build +1 -0
index e92c4eb7c..6d61c8003 100644
@@ -30,6 +30,7 @@
 #   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 eal_inc += include_directories('.')
+dpdk_includes += '-I@0@'.format(meson.current_source_dir())
 
 common_headers = [
 	'rte_alarm.h',
lib/librte_eal/linuxapp/eal/meson.build +1 -0
index 79fcff42f..f8547a8a4 100644
@@ -30,6 +30,7 @@
 #   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 eal_inc += include_directories('include')
+dpdk_includes += '-I@0@/include'.format(meson.current_source_dir())
 install_subdir('include/exec-env', install_dir: 'include')
 
 sources = ['eal_alarm.c',
lib/librte_eal/meson.build +1 -0
index 219501c86..dec6baedd 100644
@@ -31,6 +31,7 @@
 
 eal_inc = [global_inc]
 subdir('common')
+
 if host_machine.system() == 'linux'
 	dpdk_conf.set('RTE_EXEC_ENV_LINUXAPP', 1)
 	subdir('linuxapp')
lib/librte_ether/meson.build +2 -3
index 55eabd23a..e9ef496ad 100644
@@ -40,10 +40,9 @@ install_headers('rte_ethdev.h',
 	'rte_flow.h',
 	'rte_flow_driver.h')
 
-ether_lib = library('rte_ether', sources,
+lib = library('rte_ether', sources,
 	dependencies: [rte_eal, rte_ring, rte_mempool, rte_net, rte_mbuf],
 	install: true)
-rte_ether = declare_dependency(link_with: ether_lib,
+rte_ether = declare_dependency(link_with: lib,
 	include_directories: include_directories('.'))
 
-dpdk_libraries += ether_lib
lib/librte_hash/meson.build +2 -3
index 6d8270b51..48d0ecf80 100644
@@ -45,10 +45,9 @@ headers = ['rte_cmp_arm64.h',
 
 install_headers(headers)
 
-hash_lib = library('rte_hash', sources,
+lib = library('rte_hash', sources,
 	dependencies: [rte_eal, rte_ring, rte_compat],
 	install: true)
-rte_hash = declare_dependency(link_with: hash_lib,
+rte_hash = declare_dependency(link_with: lib,
 	include_directories: include_directories('.'))
 
-dpdk_libraries += hash_lib
lib/librte_kvargs/meson.build +2 -3
index 6cd5ab377..bc79d55e9 100644
@@ -34,10 +34,9 @@ sources = ['rte_kvargs.c']
 
 install_headers('rte_kvargs.h')
 
-kvargs_lib = library('rte_kvargs', sources,
+lib = library('rte_kvargs', sources,
 	dependencies: rte_eal,
 	install: true)
-rte_kvargs = declare_dependency(link_with: kvargs_lib,
+rte_kvargs = declare_dependency(link_with: lib,
 	include_directories: include_directories('.'))
 
-dpdk_libraries += kvargs_lib
lib/librte_mbuf/meson.build +2 -3
index 7926e7236..0a302f464 100644
@@ -33,10 +33,9 @@ sources = ['rte_mbuf.c', 'rte_mbuf_ptype.c']
 
 install_headers('rte_mbuf.h', 'rte_mbuf_ptype.h')
 
-mbuf_lib = library('rte_mbuf', sources,
+lib = library('rte_mbuf', sources,
 	dependencies: [rte_eal, rte_mempool, rte_ring],
 	install: true)
-rte_mbuf = declare_dependency(link_with: mbuf_lib,
+rte_mbuf = declare_dependency(link_with: lib,
 	include_directories: include_directories('.'))
 
-dpdk_libraries += mbuf_lib
lib/librte_mempool/meson.build +2 -3
index 6da2403cc..15c5e6695 100644
@@ -34,10 +34,9 @@ sources = ['rte_mempool.c', 'rte_mempool_ops.c']
 
 install_headers('rte_mempool.h')
 
-mempool_lib = library('rte_mempool', sources,
+lib = library('rte_mempool', sources,
 	dependencies: [rte_eal, rte_ring],
 	install: true)
-rte_mempool = declare_dependency(link_with: mempool_lib,
+rte_mempool = declare_dependency(link_with: lib,
 	include_directories: include_directories('.'))
 
-dpdk_libraries += mempool_lib
lib/librte_net/meson.build +2 -3
index 7c8e323f6..f4df1691f 100644
@@ -43,10 +43,9 @@ install_headers('rte_ip.h',
 	'rte_net.h',
 	'rte_net_crc.h')
 
-net_lib = library('rte_net', sources,
+lib = library('rte_net', sources,
 	dependencies: [rte_eal, rte_mbuf, rte_ring, rte_mempool],
 	install: true)
-rte_net = declare_dependency(link_with: net_lib,
+rte_net = declare_dependency(link_with: lib,
 	include_directories: include_directories('.'))
 
-dpdk_libraries += net_lib
lib/librte_ring/meson.build +2 -3
index 5832a7632..20e623e9d 100644
@@ -34,10 +34,9 @@ sources = ['rte_ring.c']
 
 install_headers('rte_ring.h')
 
-ring_lib = library('rte_ring', sources,
+lib = library('rte_ring', sources,
 	dependencies: rte_eal,
 	install: true)
-rte_ring = declare_dependency(link_with: ring_lib,
+rte_ring = declare_dependency(link_with: lib,
 	include_directories: include_directories('.'))
 
-dpdk_libraries += ring_lib
lib/meson.build +22 -9
index 0ea608684..0af9eb706 100644
@@ -29,13 +29,26 @@
 #   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 #   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
+# special case for eal, not a simple lib
 subdir('librte_eal')
-subdir('librte_ring')
-subdir('librte_mempool')
-subdir('librte_cmdline')
-subdir('librte_mbuf')
-subdir('librte_net')
-subdir('librte_ether')
-subdir('librte_compat')
-subdir('librte_hash')
-subdir('librte_kvargs')
+
+# process all libraries equally, as far as possible
+libs = ['ring', 'mempool', 'cmdline', 'mbuf', 'net', 'ether', 'compat', 'hash', 'kvargs']
+foreach l:libs
+
+	dpdk_conf.set('RTE_LIBRTE_@0@'.format(l.to_upper()),1)
+	subdir('librte_@0@'.format(l))
+	dpdk_libraries = [lib] + dpdk_libraries
+	dpdk_includes += '-I@0@/librte_@1@'.format(meson.current_source_dir(), l)
+
+endforeach
+
+#subdir('librte_ring')
+#subdir('librte_mempool')
+#subdir('librte_cmdline')
+#subdir('librte_mbuf')
+#subdir('librte_net')
+#subdir('librte_ether')
+#subdir('librte_compat')
+#subdir('librte_hash')
+#subdir('librte_kvargs')
meson.build +5 -8
index 54bb4632e..a0ab08252 100644
@@ -51,8 +51,11 @@ else
 endif
 
 # configure the build, and make sure configs here and in config folder are
-# able to be included in any file
+# able to be included in any file. We also store a global array of include dirs
+# for passing to pmdinfogen scripts
 global_inc = include_directories('.', 'config')
+dpdk_includes = ['-I@0@'.format(meson.current_source_dir()),
+		'-I@0@/config'.format(meson.current_source_dir())]
 subdir('config')
 
 # now build libs and drivers
@@ -71,16 +74,10 @@ if get_option('default_library') == 'static'
 	dpdk_libraries = dpdk_drivers + dpdk_libraries
 endif
 
-# the DPDK libs needs to be passed to the link command in reverse order
-dpdk_link_libs = []
-foreach lib: dpdk_libraries
-	dpdk_link_libs = [lib] + dpdk_link_libs
-endforeach
-
 pkg = import('pkgconfig')
 pkg.generate(name: meson.project_name(),
 	version: meson.project_version(),
-	libraries: dpdk_link_libs,
+	libraries: dpdk_libraries,
 	description: 'The Data Plane Development Kit (DPDK)',
 	extra_cflags: '-include "rte_config.h"'
 )
Signature · 1 line
2.13.4
#10 lore raw

RFC v2 10/40 build: install usertools scripts

In reply to Bruce Richardson
---
 meson.build           |  1 +
 usertools/meson.build | 32 ++++++++++++++++++++++++++++++++
 2 files changed, 33 insertions(+)
 create mode 100644 usertools/meson.build
meson.build +1 -0
index a0ab08252..717ec070d 100644
@@ -62,6 +62,7 @@ subdir('config')
 subdir('lib')
 subdir('buildtools')
 subdir('drivers')
+subdir('usertools')
 
 # write the build config
 build_cfg = 'rte_build_config.h'
usertools/meson.build new file +32 -0
new file mode 100644
index 000000000..977cd8b58
@@ -0,0 +1,32 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation. All rights reserved.
+#   All rights reserved.
+#
+#   Redistribution and use in source and binary forms, with or without
+#   modification, are permitted provided that the following conditions
+#   are met:
+#
+#     * Redistributions of source code must retain the above copyright
+#       notice, this list of conditions and the following disclaimer.
+#     * Redistributions in binary form must reproduce the above copyright
+#       notice, this list of conditions and the following disclaimer in
+#       the documentation and/or other materials provided with the
+#       distribution.
+#     * Neither the name of Intel Corporation nor the names of its
+#       contributors may be used to endorse or promote products derived
+#       from this software without specific prior written permission.
+#
+#   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+#   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+#   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+#   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+#   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+#   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+#   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+#   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+#   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+#   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+#   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+install_data(['dpdk-devbind.py', 'dpdk-pmdinfo.py'], install_dir: 'bin')
Signature · 1 line
2.13.4
#11 lore raw

RFC v2 11/40 build: simplify generation of pmd.c files

In reply to Bruce Richardson

rather than using the compiler to generate a temporary .o file, get meson to do it, so we don't need to track dpdk includes directly, and pass in a range of parameters

---
 buildtools/gen-pmdinfo-cfile.sh                | 14 +++++---------
 drivers/net/i40e/meson.build                   | 21 ++++++++++-----------
 lib/librte_eal/bsdapp/eal/meson.build          |  1 -
 lib/librte_eal/common/include/arch/meson.build |  1 -
 lib/librte_eal/common/include/meson.build      |  1 -
 lib/librte_eal/linuxapp/eal/meson.build        |  1 -
 lib/meson.build                                |  3 ---
 meson.build                                    |  2 --
 8 files changed, 15 insertions(+), 29 deletions(-)
buildtools/gen-pmdinfo-cfile.sh +5 -9
index a042375a8..fe88e627e 100755
@@ -30,16 +30,12 @@
 #   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 #   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-input=$1
+
+arfile=$1
 output=$2
 pmdinfogen=$3
-CFLAGS=$4
-build_root=$5
 
-tmp_o=${output%.c.pmd.o}.o
-tmp_c=${output%.o}.c
+tmp_o=${output%.c.pmd.c}.tmp.o
 
-set -x
-cc -Wfatal-errors $CFLAGS -I$build_root -include rte_config.h -c $input -o $tmp_o && \
-		$pmdinfogen $tmp_o $tmp_c && \
-		cc -c $tmp_c -o $output
+ar p $arfile > $tmp_o && \
+		$pmdinfogen $tmp_o $output
drivers/net/i40e/meson.build +10 -11
index e1c3e17a9..7d103868d 100644
@@ -60,20 +60,19 @@ install_headers('rte_pmd_i40e.h')
 
 pmdinfogen_srcs = run_command('grep', '--files-with-matches',
 		'RTE_PMD_REGISTER_.*(.*)', sources).stdout().strip().split()
-objs = []
 foreach src: pmdinfogen_srcs
-	out_filename = '@[email protected]'.format(src.split('/')[-1])
-	pmd_o_file = custom_target(out_filename,
-			command: [pmdinfo, '@INPUT@', '@OUTPUT@',
-			pmdinfogen.full_path(),
-			' '.join(dpdk_includes + i40e_cflags + ['-march=@0@'.format(machine)]),
-			meson.build_root()],
-			input: src, output: out_filename,
-			depends: pmdinfogen)
-	objs += pmd_o_file
+	out_filename = '@[email protected]'.format(src.split('/')[-1])
+	tmp_lib = static_library('tmp_@0@'.format(src.underscorify()),
+		src, include_directories: include_directories('base'),
+		dependencies: deps,
+		c_args: i40e_cflags)
+	sources += custom_target(out_filename,
+			command: [pmdinfo, tmp_lib.full_path(), '@OUTPUT@', pmdinfogen],
+			output: out_filename,
+			depends: [pmdinfogen, tmp_lib])
 endforeach
 
-i40e_lib = library('rte_pmd_i40e', sources, objs,
+i40e_lib = library('rte_pmd_i40e', sources,
 	include_directories: include_directories('base'),
 	dependencies: deps,
 	link_with: base_lib,
lib/librte_eal/bsdapp/eal/meson.build +0 -1
index 1df28d507..008a719b8 100644
@@ -30,7 +30,6 @@
 #   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 eal_inc += include_directories('include')
-dpdk_includes += '-I@0@/include'.format(meson.current_source_dir())
 install_subdir('include/exec-env', install_dir: 'include')
 
 sources = ['eal_alarm.c',
lib/librte_eal/common/include/arch/meson.build +0 -1
index 0bf3ee94d..863d7e4bb 100644
@@ -30,5 +30,4 @@
 #   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 eal_inc += include_directories(arch_subdir)
-dpdk_includes += '-I@0@/@1@'.format(meson.current_source_dir(), arch_subdir)
 subdir(arch_subdir)
lib/librte_eal/common/include/meson.build +0 -1
index 6d61c8003..e92c4eb7c 100644
@@ -30,7 +30,6 @@
 #   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 eal_inc += include_directories('.')
-dpdk_includes += '-I@0@'.format(meson.current_source_dir())
 
 common_headers = [
 	'rte_alarm.h',
lib/librte_eal/linuxapp/eal/meson.build +0 -1
index f8547a8a4..79fcff42f 100644
@@ -30,7 +30,6 @@
 #   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 eal_inc += include_directories('include')
-dpdk_includes += '-I@0@/include'.format(meson.current_source_dir())
 install_subdir('include/exec-env', install_dir: 'include')
 
 sources = ['eal_alarm.c',
lib/meson.build +0 -3
index 0af9eb706..d628fd0ff 100644
@@ -35,12 +35,9 @@ subdir('librte_eal')
 # process all libraries equally, as far as possible
 libs = ['ring', 'mempool', 'cmdline', 'mbuf', 'net', 'ether', 'compat', 'hash', 'kvargs']
 foreach l:libs
-
 	dpdk_conf.set('RTE_LIBRTE_@0@'.format(l.to_upper()),1)
 	subdir('librte_@0@'.format(l))
 	dpdk_libraries = [lib] + dpdk_libraries
-	dpdk_includes += '-I@0@/librte_@1@'.format(meson.current_source_dir(), l)
-
 endforeach
 
 #subdir('librte_ring')
meson.build +0 -2
index 717ec070d..daadf7235 100644
@@ -54,8 +54,6 @@ endif
 # able to be included in any file. We also store a global array of include dirs
 # for passing to pmdinfogen scripts
 global_inc = include_directories('.', 'config')
-dpdk_includes = ['-I@0@'.format(meson.current_source_dir()),
-		'-I@0@/config'.format(meson.current_source_dir())]
 subdir('config')
 
 # now build libs and drivers
Signature · 1 line
2.13.4
#12 lore raw

RFC v2 12/40 build: generalize net driver build to higher level

In reply to Bruce Richardson

Move the logic for generating the pmdinfo file and the driver library itself to the meson.build file at the driver/net level, to avoid duplicating code.

---
 drivers/net/i40e/base/meson.build |  2 +-
 drivers/net/i40e/meson.build      | 31 ++++---------------------
 drivers/net/meson.build           | 48 ++++++++++++++++++++++++++++++++++++++-
 3 files changed, 52 insertions(+), 29 deletions(-)
drivers/net/i40e/base/meson.build +1 -1
index 43399cb11..69f55497e 100644
@@ -43,7 +43,7 @@ error_cflags = ['-Wno-sign-compare',
 		'-Wno-unused-value',
 		'-Wno-format',
 		'-Wno-unused-but-set-variable']
-c_args = i40e_cflags
+c_args = cflags
 foreach flag: error_cflags
 	if cc.has_argument(flag)
 		c_args += flag
drivers/net/i40e/meson.build +4 -27
index 7d103868d..4652b8ac9 100644
@@ -29,12 +29,13 @@
 #   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 #   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-i40e_cflags = ['-DPF_DRIVER',
+cflags = ['-DPF_DRIVER',
 	'-DVF_DRIVER',
 	'-DINTEGRATED_VF',
 	'-DX722_A0_SUPPORT']
 
 subdir('base')
+libs = [base_lib]
 
 sources = files(
 	'i40e_ethdev.c',
@@ -56,31 +57,7 @@ if arch_subdir == 'x86'
 	sources += files('i40e_rxtx_vec_sse.c')
 endif
 
-install_headers('rte_pmd_i40e.h')
-
-pmdinfogen_srcs = run_command('grep', '--files-with-matches',
-		'RTE_PMD_REGISTER_.*(.*)', sources).stdout().strip().split()
-foreach src: pmdinfogen_srcs
-	out_filename = '@[email protected]'.format(src.split('/')[-1])
-	tmp_lib = static_library('tmp_@0@'.format(src.underscorify()),
-		src, include_directories: include_directories('base'),
-		dependencies: deps,
-		c_args: i40e_cflags)
-	sources += custom_target(out_filename,
-			command: [pmdinfo, tmp_lib.full_path(), '@OUTPUT@', pmdinfogen],
-			output: out_filename,
-			depends: [pmdinfogen, tmp_lib])
-endforeach
+includes = include_directories('base', '.')
 
-i40e_lib = library('rte_pmd_i40e', sources,
-	include_directories: include_directories('base'),
-	dependencies: deps,
-	link_with: base_lib,
-	c_args: i40e_cflags,
-	install: true,
-	install_dir: 'dpdk/drivers')
-
-dpdk_drivers += i40e_lib
+install_headers('rte_pmd_i40e.h')
 
-i40e_pmd = declare_dependency(link_with: i40e_lib,
-	include_directories: include_directories('.'))
drivers/net/meson.build +47 -1

51 lines not on this page · raw message

Signature · 1 line
2.13.4
#13 lore raw

RFC v2 13/40 build: remove hard-coded enablement of vector driver

In reply to Bruce Richardson
---
 config/rte_config.h          | 1 -
 drivers/net/i40e/meson.build | 1 +
 2 files changed, 1 insertion(+), 1 deletion(-)
config/rte_config.h +0 -1
index 5b687bb8e..67028f682 100644
@@ -76,7 +76,6 @@
 
 /* i40e defines */
 #define RTE_LIBRTE_I40E_RX_ALLOW_BULK_ALLOC 1
-#define RTE_LIBRTE_I40E_INC_VECTOR 1
 #undef RTE_LIBRTE_I40E_16BYTE_RX_DESC
 #define RTE_LIBRTE_I40E_QUEUE_NUM_PER_PF 64
 #define RTE_LIBRTE_I40E_QUEUE_NUM_PER_VF 4
drivers/net/i40e/meson.build +1 -0
index 4652b8ac9..ea7f73d8e 100644
@@ -54,6 +54,7 @@ deps = [rte_eal, rte_net,
 	rte_hash, rte_kvargs]
 
 if arch_subdir == 'x86'
+	dpdk_conf.set('RTE_LIBRTE_I40E_INC_VECTOR', 1)
 	sources += files('i40e_rxtx_vec_sse.c')
 endif
 
Signature · 1 line
2.13.4
#14 lore raw

RFC v2 14/40 build: add ixgbe driver to build

In reply to Bruce Richardson
---
 drivers/net/ixgbe/base/meson.build | 59 ++++++++++++++++++++++++++++++++++++
 drivers/net/ixgbe/meson.build      | 61 ++++++++++++++++++++++++++++++++++++++
 drivers/net/meson.build            |  5 ++--
 3 files changed, 123 insertions(+), 2 deletions(-)
 create mode 100644 drivers/net/ixgbe/base/meson.build
 create mode 100644 drivers/net/ixgbe/meson.build
drivers/net/ixgbe/base/meson.build new file +59 -0
new file mode 100644
index 000000000..d5fb435e4
@@ -0,0 +1,59 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation. All rights reserved.
+#   All rights reserved.
+#
+#   Redistribution and use in source and binary forms, with or without
+#   modification, are permitted provided that the following conditions
+#   are met:
+#
+#     * Redistributions of source code must retain the above copyright
+#       notice, this list of conditions and the following disclaimer.
+#     * Redistributions in binary form must reproduce the above copyright
+#       notice, this list of conditions and the following disclaimer in
+#       the documentation and/or other materials provided with the
+#       distribution.
+#     * Neither the name of Intel Corporation nor the names of its
+#       contributors may be used to endorse or promote products derived
+#       from this software without specific prior written permission.
+#
+#   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+#   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+#   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+#   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+#   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+#   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+#   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+#   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+#   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+#   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+#   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+sources = [
+	'ixgbe_82598.c',
+	'ixgbe_82599.c',
+	'ixgbe_api.c',
+	'ixgbe_common.c',
+	'ixgbe_dcb_82598.c',
+	'ixgbe_dcb_82599.c',
+	'ixgbe_dcb.c',
+	'ixgbe_hv_vf.c',
+	'ixgbe_mbx.c',
+	'ixgbe_phy.c',
+	'ixgbe_vf.c',
+	'ixgbe_x540.c',
+	'ixgbe_x550.c'
+]
+
+error_cflags = ['-Wno-unused-value',
+		'-Wno-unused-but-set-variable']
+c_args = cflags
+foreach flag: error_cflags
+	if cc.has_argument(flag)
+		c_args += flag
+	endif
+endforeach
+
+base_lib = static_library('ixgbe_base', sources,
+	dependencies: rte_eal,
+	c_args: c_args)
drivers/net/ixgbe/meson.build new file +61 -0

61 lines not on this page · raw message

drivers/net/meson.build +3 -2
index db242d71b..eccdc83d7 100644
@@ -29,7 +29,7 @@
 #   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 #   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-drivers = ['i40e']
+drivers = ['i40e', 'ixgbe']
 
 foreach drv:drivers
 	dpdk_conf.set('RTE_LIBRTE_@0@_PMD'.format(drv.to_upper()),1)
@@ -60,7 +60,8 @@ foreach drv:drivers
 	endforeach
 
 	# now build the driver itself, and add to the drivers list
-	lib = library('rte_pmd_@0@'.format(drv), sources,
+	lib = library('rte_pmd_@0@'.format(drv),
+		sources,
 		include_directories: includes,
 		dependencies: deps,
 		link_with: libs,
Signature · 1 line
2.13.4
#15 lore raw

RFC v2 15/40 build: set up standard deps for drivers

In reply to Bruce Richardson

Driver should not need to specify that they depend on EAL, mempool, mbuf etc., since all drivers are likely to depend on those. Instead, have it that drivers only need to append to the deps array any extra dependencies they have.

---
 drivers/net/i40e/meson.build  | 7 ++-----
 drivers/net/ixgbe/meson.build | 7 ++-----
 drivers/net/meson.build       | 4 +++-
 3 files changed, 7 insertions(+), 11 deletions(-)
drivers/net/i40e/meson.build +2 -5
index ea7f73d8e..3786af1ed 100644
@@ -48,17 +48,14 @@ sources = files(
 	'rte_pmd_i40e.c'
 	)
 
-deps = [rte_eal, rte_net,
-	rte_mbuf, rte_ether,
-	rte_mempool, rte_ring,
-	rte_hash, rte_kvargs]
+deps += rte_hash
 
 if arch_subdir == 'x86'
 	dpdk_conf.set('RTE_LIBRTE_I40E_INC_VECTOR', 1)
 	sources += files('i40e_rxtx_vec_sse.c')
 endif
 
-includes = include_directories('base', '.')
+includes = include_directories('base')
 
 install_headers('rte_pmd_i40e.h')
 
drivers/net/ixgbe/meson.build +2 -5
index b1efd96be..65c215271 100644
@@ -46,16 +46,13 @@ sources = files(
 	'rte_pmd_ixgbe.c'
 )
 
-deps = [rte_eal, rte_net,
-	rte_mbuf, rte_ether,
-	rte_mempool, rte_ring,
-	rte_hash, rte_kvargs]
+deps += rte_hash
 
 if arch_subdir == 'x86'
 	dpdk_conf.set('RTE_IXGBE_INC_VECTOR', 1)
 	sources += files('ixgbe_rxtx_vec_sse.c')
 endif
 
-includes = include_directories('base', '.')
+includes = include_directories('base')
 
 install_headers('rte_pmd_ixgbe.h')
drivers/net/meson.build +3 -1
index eccdc83d7..c1728e700 100644
@@ -38,8 +38,10 @@ foreach drv:drivers
 	sources = []
 	libs = []
 	cflags = []
-	deps = []
 	includes = []
+	# set up standard deps. Drivers can append/override as necessary
+	deps = [rte_eal, rte_net, rte_mbuf, rte_ether,
+		rte_mempool, rte_ring, rte_kvargs]
 
 	# pull in driver directory which should assign to each of the above
 	subdir(drv)
Signature · 1 line
2.13.4
#16 lore raw

RFC v2 16/40 build: add af_packet driver to build

In reply to Bruce Richardson
---
 drivers/net/af_packet/meson.build | 32 ++++++++++++++++++++++++++++++++
 drivers/net/meson.build           |  5 +++++
 2 files changed, 37 insertions(+)
 create mode 100644 drivers/net/af_packet/meson.build
drivers/net/af_packet/meson.build new file +32 -0
new file mode 100644
index 000000000..56ba22e73
@@ -0,0 +1,32 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation. All rights reserved.
+#   All rights reserved.
+#
+#   Redistribution and use in source and binary forms, with or without
+#   modification, are permitted provided that the following conditions
+#   are met:
+#
+#     * Redistributions of source code must retain the above copyright
+#       notice, this list of conditions and the following disclaimer.
+#     * Redistributions in binary form must reproduce the above copyright
+#       notice, this list of conditions and the following disclaimer in
+#       the documentation and/or other materials provided with the
+#       distribution.
+#     * Neither the name of Intel Corporation nor the names of its
+#       contributors may be used to endorse or promote products derived
+#       from this software without specific prior written permission.
+#
+#   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+#   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+#   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+#   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+#   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+#   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+#   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+#   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+#   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+#   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+#   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+sources = files('rte_eth_af_packet.c')
drivers/net/meson.build +5 -0
index c1728e700..df78c26d7 100644
@@ -31,6 +31,11 @@
 
 drivers = ['i40e', 'ixgbe']
 
+# af_packet only works on linux
+if host_machine.system() == 'linux'
+	drivers += 'af_packet'
+endif
+
 foreach drv:drivers
 	dpdk_conf.set('RTE_LIBRTE_@0@_PMD'.format(drv.to_upper()),1)
 
Signature · 1 line
2.13.4
#17 lore raw

RFC v2 17/40 build: add pcap PMD support

In reply to Bruce Richardson
---
 drivers/net/meson.build      | 13 ++++++++++---
 drivers/net/pcap/meson.build | 38 ++++++++++++++++++++++++++++++++++++++
 2 files changed, 48 insertions(+), 3 deletions(-)
 create mode 100644 drivers/net/pcap/meson.build
drivers/net/meson.build +10 -3
index df78c26d7..f64ab07f7 100644
@@ -29,14 +29,21 @@
 #   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 #   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-drivers = ['i40e', 'ixgbe']
+net_drivers = ['i40e', 'ixgbe']
 
 # af_packet only works on linux
 if host_machine.system() == 'linux'
-	drivers += 'af_packet'
+	net_drivers += 'af_packet'
 endif
 
-foreach drv:drivers
+pcap_dep = dependency('pcap', required: false)
+# pcap doesn't use pkg-config, but future meson versions should support picking
+# it up as a dependency. For older versions <0.42 use find_program instead
+if pcap_dep.found() or find_program('pcap-config', required: false).found()
+	net_drivers += 'pcap'
+endif
+
+foreach drv:net_drivers
 	dpdk_conf.set('RTE_LIBRTE_@0@_PMD'.format(drv.to_upper()),1)
 
 	# set up empty variables used for build
drivers/net/pcap/meson.build new file +38 -0
new file mode 100644
index 000000000..015f6bfeb
@@ -0,0 +1,38 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation. All rights reserved.
+#   All rights reserved.
+#
+#   Redistribution and use in source and binary forms, with or without
+#   modification, are permitted provided that the following conditions
+#   are met:
+#
+#     * Redistributions of source code must retain the above copyright
+#       notice, this list of conditions and the following disclaimer.
+#     * Redistributions in binary form must reproduce the above copyright
+#       notice, this list of conditions and the following disclaimer in
+#       the documentation and/or other materials provided with the
+#       distribution.
+#     * Neither the name of Intel Corporation nor the names of its
+#       contributors may be used to endorse or promote products derived
+#       from this software without specific prior written permission.
+#
+#   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+#   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+#   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+#   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+#   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+#   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+#   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+#   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+#   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+#   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+#   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+sources = files('rte_eth_pcap.c')
+
+if pcap_dep.found()
+	deps += pcap_dep
+else
+	deps += cc.find_library('pcap')
+endif
\ No newline at end of file
Signature · 1 line
2.13.4
#18 lore raw

RFC v2 18/40 build: add symbol version map file support to libs

In reply to Bruce Richardson
---
 drivers/net/meson.build | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/net/meson.build +6 -1
index f64ab07f7..2358194e0 100644
@@ -74,12 +74,17 @@ foreach drv:net_drivers
 	endforeach
 
 	# now build the driver itself, and add to the drivers list
-	lib = library('rte_pmd_@0@'.format(drv),
+	drv_name = 'rte_pmd_@0@'.format(drv)
+	version_map = '@0@/@1@/rte_pmd_@1@_version.map'.format(
+			meson.current_source_dir(), drv)
+	lib = library(drv_name,
 		sources,
 		include_directories: includes,
 		dependencies: deps,
 		link_with: libs,
 		c_args: cflags,
+		link_args: '-Wl,--version-script=' + version_map,
+		link_depends: version_map,
 		install: true,
 		install_dir: driver_install_path)
 
Signature · 1 line
2.13.4
#19 lore raw

RFC v2 19/40 build: build libraries in a loop for brevity

In reply to Bruce Richardson

now each library just has to specify it's source files, header files and dependencies, and the higher level lib directory will take care of the rest. Special case for eal, which is not just in one subdir, and is more complicated. It is also used sometimes by e.g. base code drivers, so give it it's own shortcut dependency in case needed.

---
 drivers/net/i40e/meson.build            |  2 +-
 drivers/net/ixgbe/meson.build           |  2 +-
 drivers/net/meson.build                 | 19 +++++++++++----
 drivers/net/pcap/meson.build            |  6 ++---
 lib/librte_cmdline/meson.build          | 12 +++-------
 lib/librte_compat/meson.build           |  3 ++-
 lib/librte_eal/bsdapp/eal/meson.build   |  1 +
 lib/librte_eal/linuxapp/eal/meson.build |  1 +
 lib/librte_ether/meson.build            | 13 ++++------
 lib/librte_hash/meson.build             | 16 ++++---------
 lib/librte_kvargs/meson.build           | 13 +++-------
 lib/librte_mbuf/meson.build             | 12 +++-------
 lib/librte_mempool/meson.build          | 12 +++-------
 lib/librte_net/meson.build              | 12 +++-------
 lib/librte_ring/meson.build             | 14 +++--------
 lib/meson.build                         | 42 +++++++++++++++++++++++----------
 16 files changed, 79 insertions(+), 101 deletions(-)
drivers/net/i40e/meson.build +1 -1
index 3786af1ed..3139fb001 100644
@@ -48,7 +48,7 @@ sources = files(
 	'rte_pmd_i40e.c'
 	)
 
-deps += rte_hash
+deps += ['hash']
 
 if arch_subdir == 'x86'
 	dpdk_conf.set('RTE_LIBRTE_I40E_INC_VECTOR', 1)
drivers/net/ixgbe/meson.build +1 -1
index 65c215271..1ea60b0e2 100644
@@ -46,7 +46,7 @@ sources = files(
 	'rte_pmd_ixgbe.c'
 )
 
-deps += rte_hash
+deps += ['hash']
 
 if arch_subdir == 'x86'
 	dpdk_conf.set('RTE_IXGBE_INC_VECTOR', 1)
drivers/net/meson.build +14 -5
index 2358194e0..cd2328605 100644
@@ -51,13 +51,21 @@ foreach drv:net_drivers
 	libs = []
 	cflags = []
 	includes = []
+	# dependency managment. External deps managed using dependency
+	# objects, internal deps managed by name of lib
+	ext_deps = []
 	# set up standard deps. Drivers can append/override as necessary
-	deps = [rte_eal, rte_net, rte_mbuf, rte_ether,
-		rte_mempool, rte_ring, rte_kvargs]
+	deps = ['eal', 'net', 'mbuf', 'ether', 'mempool', 'ring', 'kvargs']
 
 	# pull in driver directory which should assign to each of the above
 	subdir(drv)
 
+	# get dependency objs from strings
+	dep_objs = ext_deps
+	foreach d:deps
+		dep_objs += [get_variable('dep_rte_' + d)] + dep_objs
+	endforeach
+
 	# generate pmdinfo sources
 	pmdinfogen_srcs = run_command('grep', '--files-with-matches',
 		'RTE_PMD_REGISTER_.*(.*)', sources).stdout().strip().split()
@@ -65,10 +73,11 @@ foreach drv:net_drivers
 		out_filename = '@[email protected]'.format(src.split('/')[-1])
 		tmp_lib = static_library('tmp_@0@'.format(src.underscorify()),
 			src, include_directories: includes,
-			dependencies: deps,
+			dependencies: dep_objs,
 			c_args: cflags)
 		sources += custom_target(out_filename,
-				command: [pmdinfo, tmp_lib.full_path(), '@OUTPUT@', pmdinfogen],
+				command: [pmdinfo, tmp_lib.full_path(),
+					'@OUTPUT@', pmdinfogen],
 				output: out_filename,
 				depends: [pmdinfogen, tmp_lib])
 	endforeach
@@ -80,7 +89,7 @@ foreach drv:net_drivers
 	lib = library(drv_name,
 		sources,
 		include_directories: includes,
-		dependencies: deps,
+		dependencies: dep_objs,
 		link_with: libs,
 		c_args: cflags,
 		link_args: '-Wl,--version-script=' + version_map,
drivers/net/pcap/meson.build +3 -3
index 015f6bfeb..a61668236 100644
@@ -32,7 +32,7 @@
 sources = files('rte_eth_pcap.c')
 
 if pcap_dep.found()
-	deps += pcap_dep
+	ext_deps += pcap_dep
 else
-	deps += cc.find_library('pcap')
-endif
\ No newline at end of file
+	ext_deps += cc.find_library('pcap')
+endif
lib/librte_cmdline/meson.build +3 -9
index 0b909b77e..ed24b0b0e 100644
@@ -41,7 +41,7 @@ sources = files('cmdline.c',
 	'cmdline_socket.c',
 	'cmdline_vt100.c')
 
-headers = ['cmdline.h',
+headers = files('cmdline.h',
 	'cmdline_parse.h',
 	'cmdline_parse_num.h',
 	'cmdline_parse_ipaddr.h',
@@ -51,12 +51,6 @@ headers = ['cmdline.h',
 	'cmdline_vt100.h',
 	'cmdline_socket.h',
 	'cmdline_cirbuf.h',
-	'cmdline_parse_portlist.h']
-
-install_headers(headers)
-
-lib = library('rte_cmdline', sources, dependencies: rte_eal,
-		install: true)
-rte_cmdline = declare_dependency(link_with: lib,
-	include_directories: include_directories('.'))
+	'cmdline_parse_portlist.h')
 
+deps = ['eal']
lib/librte_compat/meson.build +2 -1
index d4a994523..6773e2203 100644
@@ -32,4 +32,5 @@
 
 install_headers('rte_compat.h')
 
-rte_compat = declare_dependency(include_directories: include_directories('.'))
+set_variable('dep_rte_compat',
+	declare_dependency(include_directories: include_directories('.')))
lib/librte_eal/bsdapp/eal/meson.build +1 -0
index 008a719b8..ff2c2fee8 100644
@@ -55,3 +55,4 @@ eal_lib = library('rte_eal', sources, eal_common_sources, eal_common_arch_source
 dpdk_libraries += ['-pthread', eal_lib]
 
 rte_eal = declare_dependency(link_with: eal_lib, include_directories: eal_inc)
+set_variable('dep_rte_eal', rte_eal)
lib/librte_eal/linuxapp/eal/meson.build +1 -0
index 79fcff42f..d290ae65e 100644
@@ -60,3 +60,4 @@ eal_lib = library('rte_eal', sources, eal_common_sources, eal_common_arch_source
 dpdk_libraries += ['-pthread', '-ldl', eal_lib]
 
 rte_eal = declare_dependency(link_with: eal_lib, include_directories: eal_inc)
+set_variable('dep_rte_eal', rte_eal)
lib/librte_ether/meson.build +5 -8
index e9ef496ad..1c1f69802 100644
@@ -30,19 +30,16 @@
 #   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 
-sources = ['rte_ethdev.c', 'rte_flow.c']
+sources = files('rte_ethdev.c', 'rte_flow.c', 'rte_tm.c')
 
-install_headers('rte_ethdev.h',
+headers = files('rte_ethdev.h',
 	'rte_ethdev_pci.h',
 	'rte_ethdev_vdev.h',
 	'rte_eth_ctrl.h',
 	'rte_dev_info.h',
 	'rte_flow.h',
-	'rte_flow_driver.h')
+	'rte_flow_driver.h',
+	'rte_tm.h')
 
-lib = library('rte_ether', sources,
-	dependencies: [rte_eal, rte_ring, rte_mempool, rte_net, rte_mbuf],
-	install: true)
-rte_ether = declare_dependency(link_with: lib,
-	include_directories: include_directories('.'))
+deps = ['eal', 'ring', 'mempool', 'net', 'mbuf']
 
lib/librte_hash/meson.build +4 -12
index 48d0ecf80..2a0d21520 100644
@@ -29,10 +29,7 @@
 #   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 #   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-
-sources = ['rte_cuckoo_hash.c', 'rte_fbk_hash.c']
-
-headers = ['rte_cmp_arm64.h',
+headers = files('rte_cmp_arm64.h',
 	'rte_cmp_x86.h',
 	'rte_crc_arm64.h',
 	'rte_cuckoo_hash.h',
@@ -41,13 +38,8 @@ headers = ['rte_cmp_arm64.h',
 	'rte_hash_crc.h',
 	'rte_hash.h',
 	'rte_jhash.h',
-	'rte_thash.h']
-
-install_headers(headers)
+	'rte_thash.h')
 
-lib = library('rte_hash', sources,
-	dependencies: [rte_eal, rte_ring, rte_compat],
-	install: true)
-rte_hash = declare_dependency(link_with: lib,
-	include_directories: include_directories('.'))
+sources = files('rte_cuckoo_hash.c', 'rte_fbk_hash.c')
+deps = ['eal', 'ring', 'compat']
 
lib/librte_kvargs/meson.build +3 -10
index bc79d55e9..f70c3970c 100644
@@ -30,13 +30,6 @@
 #   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 
-sources = ['rte_kvargs.c']
-
-install_headers('rte_kvargs.h')
-
-lib = library('rte_kvargs', sources,
-	dependencies: rte_eal,
-	install: true)
-rte_kvargs = declare_dependency(link_with: lib,
-	include_directories: include_directories('.'))
-
+sources = files('rte_kvargs.c')
+headers = files('rte_kvargs.h')
+deps = ['eal']
lib/librte_mbuf/meson.build +3 -9
index 0a302f464..8235a2b28 100644
@@ -29,13 +29,7 @@
 #   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 #   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-sources = ['rte_mbuf.c', 'rte_mbuf_ptype.c']
-
-install_headers('rte_mbuf.h', 'rte_mbuf_ptype.h')
-
-lib = library('rte_mbuf', sources,
-	dependencies: [rte_eal, rte_mempool, rte_ring],
-	install: true)
-rte_mbuf = declare_dependency(link_with: lib,
-	include_directories: include_directories('.'))
+sources = files('rte_mbuf.c', 'rte_mbuf_ptype.c')
+headers = files('rte_mbuf.h', 'rte_mbuf_ptype.h')
+deps = ['eal', 'mempool', 'ring']
 
lib/librte_mempool/meson.build +3 -9
index 15c5e6695..1de47a6c9 100644
@@ -30,13 +30,7 @@
 #   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 
-sources = ['rte_mempool.c', 'rte_mempool_ops.c']
-
-install_headers('rte_mempool.h')
-
-lib = library('rte_mempool', sources,
-	dependencies: [rte_eal, rte_ring],
-	install: true)
-rte_mempool = declare_dependency(link_with: lib,
-	include_directories: include_directories('.'))
+sources = files('rte_mempool.c', 'rte_mempool_ops.c')
+headers = files('rte_mempool.h')
+deps = ['eal', 'ring']
 
lib/librte_net/meson.build +3 -9
index f4df1691f..493139d8c 100644
@@ -29,10 +29,7 @@
 #   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 #   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-
-sources = ['rte_net.c', 'rte_net_crc.c']
-
-install_headers('rte_ip.h',
+headers = files('rte_ip.h',
 	'rte_tcp.h',
 	'rte_udp.h',
 	'rte_sctp.h',
@@ -43,9 +40,6 @@ install_headers('rte_ip.h',
 	'rte_net.h',
 	'rte_net_crc.h')
 
-lib = library('rte_net', sources,
-	dependencies: [rte_eal, rte_mbuf, rte_ring, rte_mempool],
-	install: true)
-rte_net = declare_dependency(link_with: lib,
-	include_directories: include_directories('.'))
+sources = files('rte_net.c', 'rte_net_crc.c')
+deps = ['eal', 'mbuf', 'ring', 'mempool']
 
lib/librte_ring/meson.build +3 -11
index 20e623e9d..e36977f4e 100644
@@ -29,14 +29,6 @@
 #   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 #   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-
-sources = ['rte_ring.c']
-
-install_headers('rte_ring.h')
-
-lib = library('rte_ring', sources,
-	dependencies: rte_eal,
-	install: true)
-rte_ring = declare_dependency(link_with: lib,
-	include_directories: include_directories('.'))
-
+sources = files('rte_ring.c')
+headers = files('rte_ring.h')
+deps = ['eal']
lib/meson.build +29 -13

52 lines not on this page · raw message

Signature · 1 line
2.13.4
#20 lore raw

RFC v2 20/40 build: version library .so files

In reply to Bruce Richardson

Also rename the ether library to ethdev to maintain backwards compatibility

---
 drivers/net/meson.build        |  2 ++
 lib/librte_cmdline/meson.build |  1 +
 lib/librte_ether/meson.build   |  1 +
 lib/librte_hash/meson.build    |  1 +
 lib/librte_kvargs/meson.build  |  2 +-
 lib/librte_mbuf/meson.build    |  1 +
 lib/librte_mempool/meson.build |  2 +-
 lib/librte_net/meson.build     |  1 +
 lib/meson.build                | 14 +++++++++++++-
 9 files changed, 22 insertions(+), 3 deletions(-)
drivers/net/meson.build +2 -0
index cd2328605..6b9177c05 100644
@@ -47,6 +47,7 @@ foreach drv:net_drivers
 	dpdk_conf.set('RTE_LIBRTE_@0@_PMD'.format(drv.to_upper()),1)
 
 	# set up empty variables used for build
+	version = 1
 	sources = []
 	libs = []
 	cflags = []
@@ -94,6 +95,7 @@ foreach drv:net_drivers
 		c_args: cflags,
 		link_args: '-Wl,--version-script=' + version_map,
 		link_depends: version_map,
+		version: '@[email protected]'.format(version),
 		install: true,
 		install_dir: driver_install_path)
 
lib/librte_cmdline/meson.build +1 -0
index ed24b0b0e..c773f38c5 100644
@@ -29,6 +29,7 @@
 #   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 #   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
+version = 2
 sources = files('cmdline.c',
 	'cmdline_cirbuf.c',
 	'cmdline_parse.c',
lib/librte_ether/meson.build +1 -0
index 1c1f69802..ed9c29a78 100644
@@ -30,6 +30,7 @@
 #   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 
+version = 6
 sources = files('rte_ethdev.c', 'rte_flow.c', 'rte_tm.c')
 
 headers = files('rte_ethdev.h',
lib/librte_hash/meson.build +1 -0
index 2a0d21520..e3fb9fe0d 100644
@@ -29,6 +29,7 @@
 #   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 #   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
+version = 2
 headers = files('rte_cmp_arm64.h',
 	'rte_cmp_x86.h',
 	'rte_crc_arm64.h',
lib/librte_kvargs/meson.build +1 -1
index f70c3970c..30599d06e 100644
@@ -29,7 +29,7 @@
 #   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 #   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-
+version = 1
 sources = files('rte_kvargs.c')
 headers = files('rte_kvargs.h')
 deps = ['eal']
lib/librte_mbuf/meson.build +1 -0
index 8235a2b28..19cd68528 100644
@@ -29,6 +29,7 @@
 #   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 #   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
+version = 3
 sources = files('rte_mbuf.c', 'rte_mbuf_ptype.c')
 headers = files('rte_mbuf.h', 'rte_mbuf_ptype.h')
 deps = ['eal', 'mempool', 'ring']
lib/librte_mempool/meson.build +1 -1
index 1de47a6c9..9617010dd 100644
@@ -29,7 +29,7 @@
 #   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 #   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-
+version = 2
 sources = files('rte_mempool.c', 'rte_mempool_ops.c')
 headers = files('rte_mempool.h')
 deps = ['eal', 'ring']
lib/librte_net/meson.build +1 -0
index 493139d8c..0bfe53873 100644
@@ -29,6 +29,7 @@
 #   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 #   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
+version = 1
 headers = files('rte_ip.h',
 	'rte_tcp.h',
 	'rte_udp.h',
lib/meson.build +13 -1
index a6b820661..55018173b 100644
@@ -37,6 +37,7 @@ subdir('librte_compat')
 libs = ['ring', 'mempool', 'cmdline', 'mbuf', 'net', 'ether', 'hash', 'kvargs']
 
 foreach l:libs
+	version = 1
 	sources = []
 	headers = []
 	# use "deps" for internal DPDK dependencies, and "ext_deps" for
@@ -55,8 +56,19 @@ foreach l:libs
 		dep_objs = [get_variable('dep_rte_' + d)] + dep_objs
 	endforeach
 
-	lib = library('rte_' + l, sources, dependencies: dep_objs,
+	version_map = '@0@/@1@/rte_@2@_version.map'.format(
+			meson.current_source_dir(), dir_name, l)
+	libname = 'rte_' + l
+	if libname == 'rte_ether'
+		libname = 'rte_ethdev'
+	endif
+	lib = library(libname,
+			sources,
+			dependencies: dep_objs,
 			include_directories: include_directories(dir_name),
+			link_args: '-Wl,--version-script=' + version_map,
+			link_depends: version_map,
+			version: '@[email protected]'.format(version),
 			install: true)
 	dep = declare_dependency(link_with: lib,
 			include_directories: include_directories(dir_name))
Signature · 1 line
2.13.4
#21 lore raw

RFC v2 21/40 eal: add version information to meson build

In reply to Bruce Richardson
---
 lib/librte_eal/bsdapp/eal/meson.build   | 6 +++++-
 lib/librte_eal/linuxapp/eal/meson.build | 6 +++++-
 lib/librte_eal/meson.build              | 1 +
 3 files changed, 11 insertions(+), 2 deletions(-)
lib/librte_eal/bsdapp/eal/meson.build +5 -1
index ff2c2fee8..6c5f5e93d 100644
@@ -44,11 +44,15 @@ sources = ['eal_alarm.c',
 		'eal_pci.c',
 ]
 
+version_map = join_paths(meson.current_source_dir(), 'rte_eal_version.map')
 eal_lib = library('rte_eal', sources, eal_common_sources, eal_common_arch_sources,
 			dependencies: dependency('threads'),
 			include_directories : eal_inc,
+			version: '@[email protected]'.format(version),
 			c_args: '-D_GNU_SOURCE',
-			link_args: '-lexecinfo',
+			link_depends: version_map,
+			link_args: ['-lexecinfo',
+				'-Wl,--version-script=' + version_map],
 			install: true
 )
 
lib/librte_eal/linuxapp/eal/meson.build +5 -1
index d290ae65e..57bb5d52d 100644
@@ -49,11 +49,15 @@ sources = ['eal_alarm.c',
 		'eal_pci.c',
 ]
 
+version_map = join_paths(meson.current_source_dir(), 'rte_eal_version.map')
 eal_lib = library('rte_eal', sources, eal_common_sources, eal_common_arch_sources,
 			dependencies: dependency('threads'),
 			include_directories : eal_inc,
+			version: '@[email protected]'.format(version),
 			c_args: '-D_GNU_SOURCE',
-			link_args: '-ldl',
+			link_depends: version_map,
+			link_args: ['-ldl',
+				'-Wl,--version-script=' + version_map],
 			install: true
 )
 
lib/librte_eal/meson.build +1 -0
index dec6baedd..1b2556121 100644
@@ -29,6 +29,7 @@
 #   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 #   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
+version = 4  # the version of the EAL API
 eal_inc = [global_inc]
 subdir('common')
 
Signature · 1 line
2.13.4
#22 lore raw

RFC v2 22/40 build: add mempool drivers to build

In reply to Bruce Richardson
---
 drivers/mempool/meson.build       | 97 +++++++++++++++++++++++++++++++++++++++
 drivers/mempool/ring/meson.build  | 32 +++++++++++++
 drivers/mempool/stack/meson.build | 32 +++++++++++++
 drivers/meson.build               |  1 +
 4 files changed, 162 insertions(+)
 create mode 100644 drivers/mempool/meson.build
 create mode 100644 drivers/mempool/ring/meson.build
 create mode 100644 drivers/mempool/stack/meson.build
drivers/mempool/meson.build new file +97 -0
new file mode 100644
index 000000000..869e75cb7
@@ -0,0 +1,97 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation. All rights reserved.
+#   All rights reserved.
+#
+#   Redistribution and use in source and binary forms, with or without
+#   modification, are permitted provided that the following conditions
+#   are met:
+#
+#     * Redistributions of source code must retain the above copyright
+#       notice, this list of conditions and the following disclaimer.
+#     * Redistributions in binary form must reproduce the above copyright
+#       notice, this list of conditions and the following disclaimer in
+#       the documentation and/or other materials provided with the
+#       distribution.
+#     * Neither the name of Intel Corporation nor the names of its
+#       contributors may be used to endorse or promote products derived
+#       from this software without specific prior written permission.
+#
+#   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+#   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+#   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+#   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+#   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+#   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+#   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+#   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+#   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+#   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+#   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+mempool_drivers = ['ring', 'stack']
+
+foreach drv:mempool_drivers
+	dpdk_conf.set('RTE_LIBRTE_@0@_PMD'.format(drv.to_upper()),1)
+
+	# set up empty variables used for build
+	version = 1
+	sources = []
+	libs = []
+	cflags = []
+	includes = []
+	# dependency managment. External deps managed using dependency
+	# objects, internal deps managed by name of lib
+	ext_deps = []
+	# set up standard deps. Drivers can append/override as necessary
+	deps = ['eal', 'mempool', 'ring']
+
+	# pull in driver directory which should assign to each of the above
+	subdir(drv)
+
+	# get dependency objs from strings
+	dep_objs = ext_deps
+	foreach d:deps
+		dep_objs = [get_variable('dep_rte_' + d)] + dep_objs
+	endforeach
+
+	# generate pmdinfo sources
+	pmdinfogen_srcs = run_command('grep', '--files-with-matches',
+		'RTE_PMD_REGISTER_.*(.*)', sources).stdout().strip().split()
+	foreach src: pmdinfogen_srcs
+		out_filename = '@[email protected]'.format(src.split('/')[-1])
+		tmp_lib = static_library('tmp_@0@'.format(src.underscorify()),
+			src, include_directories: includes,
+			dependencies: dep_objs,
+			c_args: cflags)
+		sources += custom_target(out_filename,
+				command: [pmdinfo, tmp_lib.full_path(),
+					'@OUTPUT@', pmdinfogen],
+				output: out_filename,
+				depends: [pmdinfogen, tmp_lib])
+	endforeach
+
+	# now build the driver itself, and add to the drivers list
+	drv_name = 'rte_mempool_@0@'.format(drv)
+	version_map = '@0@/@1@/rte_mempool_@1@_version.map'.format(
+			meson.current_source_dir(), drv)
+	lib = library(drv_name,
+		sources,
+		include_directories: includes,
+		dependencies: dep_objs,
+		link_with: libs,
+		c_args: cflags,
+		link_args: '-Wl,--version-script=' + version_map,
+		link_depends: version_map,
+		version: '@[email protected]'.format(version),
+		install: true,
+		install_dir: driver_install_path)
+
+	dpdk_drivers += lib
+
+	# create a dependency object and add it to the global dictionary so
+	# testpmd or other built-in apps can find it if necessary
+	set_variable('dep_pmd_@0@'.format(drv),
+			declare_dependency(link_with: lib,
+			include_directories: includes))
+endforeach
drivers/mempool/ring/meson.build new file +32 -0
new file mode 100644
index 000000000..72e104315
@@ -0,0 +1,32 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation. All rights reserved.
+#   All rights reserved.
+#
+#   Redistribution and use in source and binary forms, with or without
+#   modification, are permitted provided that the following conditions
+#   are met:
+#
+#     * Redistributions of source code must retain the above copyright
+#       notice, this list of conditions and the following disclaimer.
+#     * Redistributions in binary form must reproduce the above copyright
+#       notice, this list of conditions and the following disclaimer in
+#       the documentation and/or other materials provided with the
+#       distribution.
+#     * Neither the name of Intel Corporation nor the names of its
+#       contributors may be used to endorse or promote products derived
+#       from this software without specific prior written permission.
+#
+#   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+#   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+#   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+#   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+#   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+#   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+#   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+#   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+#   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+#   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+#   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+sources = files('rte_mempool_ring.c')
drivers/mempool/stack/meson.build new file +32 -0
new file mode 100644
index 000000000..84856a387
@@ -0,0 +1,32 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation. All rights reserved.
+#   All rights reserved.
+#
+#   Redistribution and use in source and binary forms, with or without
+#   modification, are permitted provided that the following conditions
+#   are met:
+#
+#     * Redistributions of source code must retain the above copyright
+#       notice, this list of conditions and the following disclaimer.
+#     * Redistributions in binary form must reproduce the above copyright
+#       notice, this list of conditions and the following disclaimer in
+#       the documentation and/or other materials provided with the
+#       distribution.
+#     * Neither the name of Intel Corporation nor the names of its
+#       contributors may be used to endorse or promote products derived
+#       from this software without specific prior written permission.
+#
+#   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+#   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+#   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+#   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+#   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+#   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+#   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+#   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+#   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+#   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+#   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+sources = files('rte_mempool_stack.c')
drivers/meson.build +1 -0
index 57f47c36f..f8ad7d0e2 100644
@@ -30,3 +30,4 @@
 #   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 subdir('net')
+subdir('mempool')
Signature · 1 line
2.13.4
#23 lore raw

RFC v2 23/40 build: add gro library to meson build

In reply to Bruce Richardson
---
 lib/librte_gro/meson.build | 34 ++++++++++++++++++++++++++++++++++
 lib/meson.build            |  3 ++-
 2 files changed, 36 insertions(+), 1 deletion(-)
 create mode 100644 lib/librte_gro/meson.build
lib/librte_gro/meson.build new file +34 -0
new file mode 100644
index 000000000..3949575b7
@@ -0,0 +1,34 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation. All rights reserved.
+#   All rights reserved.
+#
+#   Redistribution and use in source and binary forms, with or without
+#   modification, are permitted provided that the following conditions
+#   are met:
+#
+#     * Redistributions of source code must retain the above copyright
+#       notice, this list of conditions and the following disclaimer.
+#     * Redistributions in binary form must reproduce the above copyright
+#       notice, this list of conditions and the following disclaimer in
+#       the documentation and/or other materials provided with the
+#       distribution.
+#     * Neither the name of Intel Corporation nor the names of its
+#       contributors may be used to endorse or promote products derived
+#       from this software without specific prior written permission.
+#
+#   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+#   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+#   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+#   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+#   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+#   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+#   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+#   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+#   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+#   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+#   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+sources = files('rte_gro.c', 'gro_tcp4.c')
+headers = files('rte_gro.h')
+deps = ['eal', 'mbuf', 'ether', 'net', 'mempool', 'ring']
lib/meson.build +2 -1
index 55018173b..ce74c609b 100644
@@ -34,7 +34,8 @@ subdir('librte_eal')
 subdir('librte_compat')
 
 # process all libraries equally, as far as possible
-libs = ['ring', 'mempool', 'cmdline', 'mbuf', 'net', 'ether', 'hash', 'kvargs']
+libs = ['ring', 'mempool', 'cmdline', 'mbuf', 'net', 'ether', 'hash',
+	'kvargs', 'gro']
 
 foreach l:libs
 	version = 1
Signature · 1 line
2.13.4
#24 lore raw

RFC v2 24/40 build: tweak naming of pmd dependencies

In reply to Bruce Richardson
---
 drivers/mempool/meson.build | 2 +-
 drivers/net/meson.build     | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/mempool/meson.build +1 -1
index 869e75cb7..1d003b757 100644
@@ -91,7 +91,7 @@ foreach drv:mempool_drivers
 
 	# create a dependency object and add it to the global dictionary so
 	# testpmd or other built-in apps can find it if necessary
-	set_variable('dep_pmd_@0@'.format(drv),
+	set_variable('dep_rte_mempool_@0@'.format(drv),
 			declare_dependency(link_with: lib,
 			include_directories: includes))
 endforeach
drivers/net/meson.build +1 -1
index 6b9177c05..07f3f7969 100644
@@ -103,7 +103,7 @@ foreach drv:net_drivers
 
 	# create a dependency object and add it to the global dictionary so
 	# testpmd or other built-in apps can find it if necessary
-	set_variable('dep_pmd_@0@'.format(drv),
+	set_variable('dep_rte_pmd_@0@'.format(drv),
 			declare_dependency(link_with: lib,
 			include_directories: includes))
 endforeach
Signature · 1 line
2.13.4
#25 lore raw

RFC v2 25/40 build: track driver include directories properly

In reply to Bruce Richardson
---
 drivers/mempool/meson.build   | 2 +-
 drivers/net/i40e/meson.build  | 2 +-
 drivers/net/ixgbe/meson.build | 2 +-
 drivers/net/meson.build       | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)
drivers/mempool/meson.build +1 -1
index 1d003b757..daaabc5b6 100644
@@ -39,7 +39,7 @@ foreach drv:mempool_drivers
 	sources = []
 	libs = []
 	cflags = []
-	includes = []
+	includes = [include_directories(drv)]
 	# dependency managment. External deps managed using dependency
 	# objects, internal deps managed by name of lib
 	ext_deps = []
drivers/net/i40e/meson.build +1 -1
index 3139fb001..dcc832b6f 100644
@@ -55,7 +55,7 @@ if arch_subdir == 'x86'
 	sources += files('i40e_rxtx_vec_sse.c')
 endif
 
-includes = include_directories('base')
+includes += include_directories('base')
 
 install_headers('rte_pmd_i40e.h')
 
drivers/net/ixgbe/meson.build +1 -1
index 1ea60b0e2..3e164f97f 100644
@@ -53,6 +53,6 @@ if arch_subdir == 'x86'
 	sources += files('ixgbe_rxtx_vec_sse.c')
 endif
 
-includes = include_directories('base')
+includes += include_directories('base')
 
 install_headers('rte_pmd_ixgbe.h')
drivers/net/meson.build +1 -1
index 07f3f7969..3e587d809 100644
@@ -51,7 +51,7 @@ foreach drv:net_drivers
 	sources = []
 	libs = []
 	cflags = []
-	includes = []
+	includes = [include_directories(drv)]
 	# dependency managment. External deps managed using dependency
 	# objects, internal deps managed by name of lib
 	ext_deps = []
Signature · 1 line
2.13.4
#26 lore raw

RFC v2 26/40 metrics: add metrics lib to meson build

In reply to Bruce Richardson
---
 lib/librte_metrics/meson.build | 34 ++++++++++++++++++++++++++++++++++
 lib/meson.build                |  2 +-
 2 files changed, 35 insertions(+), 1 deletion(-)
 create mode 100644 lib/librte_metrics/meson.build
lib/librte_metrics/meson.build new file +34 -0
new file mode 100644
index 000000000..3b67fff56
@@ -0,0 +1,34 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation. All rights reserved.
+#   All rights reserved.
+#
+#   Redistribution and use in source and binary forms, with or without
+#   modification, are permitted provided that the following conditions
+#   are met:
+#
+#     * Redistributions of source code must retain the above copyright
+#       notice, this list of conditions and the following disclaimer.
+#     * Redistributions in binary form must reproduce the above copyright
+#       notice, this list of conditions and the following disclaimer in
+#       the documentation and/or other materials provided with the
+#       distribution.
+#     * Neither the name of Intel Corporation nor the names of its
+#       contributors may be used to endorse or promote products derived
+#       from this software without specific prior written permission.
+#
+#   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+#   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+#   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+#   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+#   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+#   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+#   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+#   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+#   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+#   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+#   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+sources = files('rte_metrics.c')
+headers = files('rte_metrics.h')
+deps = ['eal']
lib/meson.build +1 -1
index ce74c609b..0caf7bc75 100644
@@ -35,7 +35,7 @@ subdir('librte_compat')
 
 # process all libraries equally, as far as possible
 libs = ['ring', 'mempool', 'cmdline', 'mbuf', 'net', 'ether', 'hash',
-	'kvargs', 'gro']
+	'kvargs', 'gro', 'metrics']
 
 foreach l:libs
 	version = 1
Signature · 1 line
2.13.4
#27 lore raw

RFC v2 27/40 build: track dependencies recursively

In reply to Bruce Richardson
---
 drivers/mempool/meson.build             | 3 ++-
 drivers/net/meson.build                 | 6 ++++--
 lib/librte_eal/bsdapp/eal/meson.build   | 5 ++++-
 lib/librte_eal/linuxapp/eal/meson.build | 5 ++++-
 lib/meson.build                         | 3 ++-
 5 files changed, 16 insertions(+), 6 deletions(-)
drivers/mempool/meson.build +2 -1
index daaabc5b6..d998797ca 100644
@@ -93,5 +93,6 @@ foreach drv:mempool_drivers
 	# testpmd or other built-in apps can find it if necessary
 	set_variable('dep_rte_mempool_@0@'.format(drv),
 			declare_dependency(link_with: lib,
-			include_directories: includes))
+			include_directories: includes,
+			dependencies: dep_objs))
 endforeach
drivers/net/meson.build +4 -2
index 3e587d809..00ee65988 100644
@@ -56,7 +56,8 @@ foreach drv:net_drivers
 	# objects, internal deps managed by name of lib
 	ext_deps = []
 	# set up standard deps. Drivers can append/override as necessary
-	deps = ['eal', 'net', 'mbuf', 'ether', 'mempool', 'ring', 'kvargs']
+	# 'ether' as dep, also pulls in mbuf, net, mempool, ring, eal etc
+	deps = ['ether', 'kvargs']
 
 	# pull in driver directory which should assign to each of the above
 	subdir(drv)
@@ -105,5 +106,6 @@ foreach drv:net_drivers
 	# testpmd or other built-in apps can find it if necessary
 	set_variable('dep_rte_pmd_@0@'.format(drv),
 			declare_dependency(link_with: lib,
-			include_directories: includes))
+			include_directories: includes,
+			dependencies: dep_objs))
 endforeach
lib/librte_eal/bsdapp/eal/meson.build +4 -1
index 6c5f5e93d..86a9e3d14 100644
@@ -58,5 +58,8 @@ eal_lib = library('rte_eal', sources, eal_common_sources, eal_common_arch_source
 
 dpdk_libraries += ['-pthread', eal_lib]
 
-rte_eal = declare_dependency(link_with: eal_lib, include_directories: eal_inc)
+rte_eal = declare_dependency(link_with: eal_lib,
+		include_directories: eal_inc,
+		dependencies: dependency('threads'),
+		link_args: '-lexecinfo')
 set_variable('dep_rte_eal', rte_eal)
lib/librte_eal/linuxapp/eal/meson.build +4 -1
index 57bb5d52d..90ecfc394 100644
@@ -63,5 +63,8 @@ eal_lib = library('rte_eal', sources, eal_common_sources, eal_common_arch_source
 
 dpdk_libraries += ['-pthread', '-ldl', eal_lib]
 
-rte_eal = declare_dependency(link_with: eal_lib, include_directories: eal_inc)
+rte_eal = declare_dependency(link_with: eal_lib,
+		include_directories: eal_inc,
+		dependencies: dependency('threads'),
+		link_args: '-ldl')
 set_variable('dep_rte_eal', rte_eal)
lib/meson.build +2 -1
index 0caf7bc75..e0c9c3c81 100644
@@ -72,7 +72,8 @@ foreach l:libs
 			version: '@[email protected]'.format(version),
 			install: true)
 	dep = declare_dependency(link_with: lib,
-			include_directories: include_directories(dir_name))
+			include_directories: include_directories(dir_name),
+			dependencies: dep_objs)
 	set_variable('dep_rte_' + l, dep)
 
 	dpdk_libraries = [lib] + dpdk_libraries
Signature · 1 line
2.13.4
#28 lore raw

RFC v2 28/40 testpmd: compile testpmd with meson and ninja

In reply to Bruce Richardson

Add testpmd to build. When done, it was found that the -ldl flag was getting duplicated too many times in the build causing static linkage to fail on testpmd as the commandline got to long. [Possible meson bug]. Fix this by making testpmd link explicitly against libdl (or libexecinfo on BSD) and don't have EAL track it as its dependency.

---
 app/meson.build                         | 32 +++++++++++++++
 app/test-pmd/meson.build                | 71 +++++++++++++++++++++++++++++++++
 lib/librte_eal/bsdapp/eal/meson.build   |  9 +++--
 lib/librte_eal/linuxapp/eal/meson.build |  9 +++--
 meson.build                             |  6 ++-
 5 files changed, 118 insertions(+), 9 deletions(-)
 create mode 100644 app/meson.build
 create mode 100644 app/test-pmd/meson.build
app/meson.build new file +32 -0
new file mode 100644
index 000000000..bdf043ead
@@ -0,0 +1,32 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation. All rights reserved.
+#   All rights reserved.
+#
+#   Redistribution and use in source and binary forms, with or without
+#   modification, are permitted provided that the following conditions
+#   are met:
+#
+#     * Redistributions of source code must retain the above copyright
+#       notice, this list of conditions and the following disclaimer.
+#     * Redistributions in binary form must reproduce the above copyright
+#       notice, this list of conditions and the following disclaimer in
+#       the documentation and/or other materials provided with the
+#       distribution.
+#     * Neither the name of Intel Corporation nor the names of its
+#       contributors may be used to endorse or promote products derived
+#       from this software without specific prior written permission.
+#
+#   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+#   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+#   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+#   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+#   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+#   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+#   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+#   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+#   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+#   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+#   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+subdir('test-pmd')
app/test-pmd/meson.build new file +71 -0

71 lines not on this page · raw message

lib/librte_eal/bsdapp/eal/meson.build +5 -4
index 86a9e3d14..96ad1cef7 100644
@@ -44,6 +44,8 @@ sources = ['eal_alarm.c',
 		'eal_pci.c',
 ]
 
+eal_extra_link_arg = '-lexecinfo'
+
 version_map = join_paths(meson.current_source_dir(), 'rte_eal_version.map')
 eal_lib = library('rte_eal', sources, eal_common_sources, eal_common_arch_sources,
 			dependencies: dependency('threads'),
@@ -51,15 +53,14 @@ eal_lib = library('rte_eal', sources, eal_common_sources, eal_common_arch_source
 			version: '@[email protected]'.format(version),
 			c_args: '-D_GNU_SOURCE',
 			link_depends: version_map,
-			link_args: ['-lexecinfo',
+			link_args: [eal_extra_link_arg,
 				'-Wl,--version-script=' + version_map],
 			install: true
 )
 
-dpdk_libraries += ['-pthread', eal_lib]
+dpdk_libraries += [eal_lib, '-pthread', eal_extra_link_arg]
 
 rte_eal = declare_dependency(link_with: eal_lib,
 		include_directories: eal_inc,
-		dependencies: dependency('threads'),
-		link_args: '-lexecinfo')
+		dependencies: dependency('threads'))
 set_variable('dep_rte_eal', rte_eal)
lib/librte_eal/linuxapp/eal/meson.build +5 -4
index 90ecfc394..30741519b 100644
@@ -49,6 +49,8 @@ sources = ['eal_alarm.c',
 		'eal_pci.c',
 ]
 
+eal_extra_link_arg = '-ldl'
+
 version_map = join_paths(meson.current_source_dir(), 'rte_eal_version.map')
 eal_lib = library('rte_eal', sources, eal_common_sources, eal_common_arch_sources,
 			dependencies: dependency('threads'),
@@ -56,15 +58,14 @@ eal_lib = library('rte_eal', sources, eal_common_sources, eal_common_arch_source
 			version: '@[email protected]'.format(version),
 			c_args: '-D_GNU_SOURCE',
 			link_depends: version_map,
-			link_args: ['-ldl',
+			link_args: [eal_extra_link_arg,
 				'-Wl,--version-script=' + version_map],
 			install: true
 )
 
-dpdk_libraries += ['-pthread', '-ldl', eal_lib]
+dpdk_libraries += [eal_lib, '-pthread', eal_extra_link_arg]
 
 rte_eal = declare_dependency(link_with: eal_lib,
 		include_directories: eal_inc,
-		dependencies: dependency('threads'),
-		link_args: '-ldl')
+		dependencies: dependency('threads'))
 set_variable('dep_rte_eal', rte_eal)
meson.build +5 -1
index daadf7235..dfcead92a 100644
@@ -60,7 +60,10 @@ subdir('config')
 subdir('lib')
 subdir('buildtools')
 subdir('drivers')
+
+# build binaries and installable tools
 subdir('usertools')
+subdir('app')
 
 # write the build config
 build_cfg = 'rte_build_config.h'
@@ -68,7 +71,8 @@ configure_file(output: build_cfg,
 		configuration: dpdk_conf,
 		install_dir: get_option('includedir'))
 
-# for static builds, include the drivers directly
+# for static builds, include the drivers as libs, and also any
+# other dependent libs that DPDK needs to link against
 if get_option('default_library') == 'static'
 	dpdk_libraries = dpdk_drivers + dpdk_libraries
 endif
Signature · 1 line
2.13.4
#29 lore raw

RFC v2 29/40 crypto/null: rename the version file to standard

In reply to Bruce Richardson
---
 drivers/crypto/null/Makefile                                            | 2 +-
 .../null/{rte_pmd_null_crypto_version.map => rte_pmd_null_version.map}  | 0
 2 files changed, 1 insertion(+), 1 deletion(-)
 rename drivers/crypto/null/{rte_pmd_null_crypto_version.map => rte_pmd_null_version.map} (100%)
drivers/crypto/null/Makefile +1 -1
index bc2724b39..b12b6f797 100644
@@ -42,7 +42,7 @@ CFLAGS += $(WERROR_FLAGS)
 LIBABIVER := 1
 
 # versioning export map
-EXPORT_MAP := rte_pmd_null_crypto_version.map
+EXPORT_MAP := rte_pmd_null_version.map
 
 # library source files
 SRCS-$(CONFIG_RTE_LIBRTE_PMD_NULL_CRYPTO) += null_crypto_pmd.c
drivers/crypto/null/rte_pmd_null_version.map renamed from drivers/crypto/null/rte_pmd_null_crypto_version.map +0 -0
similarity index 100%
rename from drivers/crypto/null/rte_pmd_null_crypto_version.map
rename to drivers/crypto/null/rte_pmd_null_version.map
Signature · 1 line
2.13.4
#30 lore raw

RFC v2 30/40 crypto/qat: remove dependency on ether library

In reply to Bruce Richardson
---
 drivers/crypto/qat/qat_crypto.c | 1 -
 1 file changed, 1 deletion(-)
drivers/crypto/qat/qat_crypto.c +0 -1
index 1f52cabfd..62ee175ba 100644
@@ -46,7 +46,6 @@
 #include <rte_memory.h>
 #include <rte_memzone.h>
 #include <rte_tailq.h>
-#include <rte_ether.h>
 #include <rte_malloc.h>
 #include <rte_launch.h>
 #include <rte_eal.h>
Signature · 1 line
2.13.4
#31 lore raw

RFC v2 31/40 build: add cryptodev and some crypto drivers to build

In reply to Bruce Richardson
---
 config/rte_config.h                |   9 ++++
 drivers/crypto/meson.build         | 103 +++++++++++++++++++++++++++++++++++++
 drivers/crypto/null/meson.build    |  32 ++++++++++++
 drivers/crypto/openssl/meson.build |  33 ++++++++++++
 drivers/crypto/qat/meson.build     |  36 +++++++++++++
 drivers/meson.build                |   3 +-
 lib/librte_cryptodev/meson.build   |  39 ++++++++++++++
 lib/meson.build                    |   2 +-
 8 files changed, 255 insertions(+), 2 deletions(-)
 create mode 100644 drivers/crypto/meson.build
 create mode 100644 drivers/crypto/null/meson.build
 create mode 100644 drivers/crypto/openssl/meson.build
 create mode 100644 drivers/crypto/qat/meson.build
 create mode 100644 lib/librte_cryptodev/meson.build
config/rte_config.h +9 -0
index 67028f682..6eb72415a 100644
@@ -72,6 +72,9 @@
 #define RTE_ETHDEV_QUEUE_STAT_CNTRS 16
 #define RTE_ETHDEV_RXTX_CALLBACKS 1
 
+/* cryptodev defines */
+#define RTE_CRYPTO_MAX_DEVS 64
+#define RTE_CRYPTODEV_NAME_LEN 64
 /****** driver defines ********/
 
 /* i40e defines */
@@ -83,4 +86,10 @@
 /* interval up to 8160 us, aligned to 2 (or default value) */
 #define RTE_LIBRTE_I40E_ITR_INTERVAL -1
 
+/*
+ * Number of sessions to create in the session memory pool
+ * on a single QuickAssist device.
+ */
+#define RTE_QAT_PMD_MAX_NB_SESSIONS 2048
+
 #endif /* _RTE_CONFIG_H_ */
drivers/crypto/meson.build new file +103 -0

103 lines not on this page · raw message

drivers/crypto/null/meson.build new file +32 -0
new file mode 100644
index 000000000..0a8d65ad5
@@ -0,0 +1,32 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation. All rights reserved.
+#   All rights reserved.
+#
+#   Redistribution and use in source and binary forms, with or without
+#   modification, are permitted provided that the following conditions
+#   are met:
+#
+#     * Redistributions of source code must retain the above copyright
+#       notice, this list of conditions and the following disclaimer.
+#     * Redistributions in binary form must reproduce the above copyright
+#       notice, this list of conditions and the following disclaimer in
+#       the documentation and/or other materials provided with the
+#       distribution.
+#     * Neither the name of Intel Corporation nor the names of its
+#       contributors may be used to endorse or promote products derived
+#       from this software without specific prior written permission.
+#
+#   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+#   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+#   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+#   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+#   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+#   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+#   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+#   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+#   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+#   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+#   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+sources = files('null_crypto_pmd.c', 'null_crypto_pmd_ops.c')
drivers/crypto/openssl/meson.build new file +33 -0
new file mode 100644
index 000000000..b4337f85e
@@ -0,0 +1,33 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation. All rights reserved.
+#   All rights reserved.
+#
+#   Redistribution and use in source and binary forms, with or without
+#   modification, are permitted provided that the following conditions
+#   are met:
+#
+#     * Redistributions of source code must retain the above copyright
+#       notice, this list of conditions and the following disclaimer.
+#     * Redistributions in binary form must reproduce the above copyright
+#       notice, this list of conditions and the following disclaimer in
+#       the documentation and/or other materials provided with the
+#       distribution.
+#     * Neither the name of Intel Corporation nor the names of its
+#       contributors may be used to endorse or promote products derived
+#       from this software without specific prior written permission.
+#
+#   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+#   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+#   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+#   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+#   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+#   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+#   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+#   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+#   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+#   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+#   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+sources = files('rte_openssl_pmd.c', 'rte_openssl_pmd_ops.c')
+ext_deps += libcrypto_dep
drivers/crypto/qat/meson.build new file +36 -0
new file mode 100644
index 000000000..aa124a0a0
@@ -0,0 +1,36 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation. All rights reserved.
+#   All rights reserved.
+#
+#   Redistribution and use in source and binary forms, with or without
+#   modification, are permitted provided that the following conditions
+#   are met:
+#
+#     * Redistributions of source code must retain the above copyright
+#       notice, this list of conditions and the following disclaimer.
+#     * Redistributions in binary form must reproduce the above copyright
+#       notice, this list of conditions and the following disclaimer in
+#       the documentation and/or other materials provided with the
+#       distribution.
+#     * Neither the name of Intel Corporation nor the names of its
+#       contributors may be used to endorse or promote products derived
+#       from this software without specific prior written permission.
+#
+#   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+#   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+#   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+#   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+#   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+#   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+#   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+#   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+#   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+#   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+#   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+sources = files('qat_crypto.c', 'qat_qp.c',
+		'qat_adf/qat_algs_build_desc.c',
+		'rte_qat_cryptodev.c')
+includes += include_directories('qat_adf')
+ext_deps += libcrypto_dep
drivers/meson.build +2 -1
index f8ad7d0e2..10c5912c0 100644
@@ -29,5 +29,6 @@
 #   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 #   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-subdir('net')
 subdir('mempool')
+subdir('net')
+subdir('crypto')
lib/librte_cryptodev/meson.build new file +39 -0
new file mode 100644
index 000000000..c732e2094
@@ -0,0 +1,39 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation. All rights reserved.
+#   All rights reserved.
+#
+#   Redistribution and use in source and binary forms, with or without
+#   modification, are permitted provided that the following conditions
+#   are met:
+#
+#     * Redistributions of source code must retain the above copyright
+#       notice, this list of conditions and the following disclaimer.
+#     * Redistributions in binary form must reproduce the above copyright
+#       notice, this list of conditions and the following disclaimer in
+#       the documentation and/or other materials provided with the
+#       distribution.
+#     * Neither the name of Intel Corporation nor the names of its
+#       contributors may be used to endorse or promote products derived
+#       from this software without specific prior written permission.
+#
+#   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+#   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+#   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+#   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+#   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+#   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+#   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+#   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+#   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+#   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+#   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+sources = files('rte_cryptodev.c', 'rte_cryptodev_pmd.c')
+headers = files('rte_cryptodev.h',
+	'rte_cryptodev_pci.h',
+	'rte_cryptodev_pmd.h',
+	'rte_cryptodev_vdev.h',
+	'rte_crypto.h',
+	'rte_crypto_sym.h')
+deps = ['eal', 'mempool', 'kvargs', 'mbuf']
lib/meson.build +1 -1
index e0c9c3c81..917eee7b2 100644
@@ -35,7 +35,7 @@ subdir('librte_compat')
 
 # process all libraries equally, as far as possible
 libs = ['ring', 'mempool', 'cmdline', 'mbuf', 'net', 'ether', 'hash',
-	'kvargs', 'gro', 'metrics']
+	'kvargs', 'gro', 'metrics', 'cryptodev']
 
 foreach l:libs
 	version = 1
Signature · 1 line
2.13.4
#32 lore raw

RFC v2 32/40 igb_uio: add igb_uio to meson build

In reply to Bruce Richardson
---
 lib/librte_eal/linuxapp/igb_uio/Kbuild      |  1 +
 lib/librte_eal/linuxapp/igb_uio/meson.build | 47 +++++++++++++++++++++++++++++
 lib/librte_eal/linuxapp/meson.build         | 10 ++++++
 meson_options.txt                           |  4 ++-
 4 files changed, 61 insertions(+), 1 deletion(-)
 create mode 100644 lib/librte_eal/linuxapp/igb_uio/Kbuild
 create mode 100644 lib/librte_eal/linuxapp/igb_uio/meson.build
lib/librte_eal/linuxapp/igb_uio/Kbuild new file +1 -0
new file mode 100644
index 000000000..98c98fe52
@@ -0,0 +1 @@
+obj-m := igb_uio.o
lib/librte_eal/linuxapp/igb_uio/meson.build new file +47 -0

47 lines not on this page · raw message

lib/librte_eal/linuxapp/meson.build +10 -0
index bc9f22175..88164f297 100644
@@ -30,3 +30,13 @@
 #   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 subdir('eal')
+
+if get_option('enable_kmods')
+	kernel_dir = get_option('kernel_dir')
+	if kernel_dir == ''
+		kernel_version = run_command('uname', '-r').stdout().strip()
+		kernel_dir = '/lib/modules/' + kernel_version + '/build'
+	endif
+
+	subdir('igb_uio')
+endif
\ No newline at end of file
meson_options.txt +3 -1
index 8f1db5330..9c45b8159 100644
@@ -3,4 +3,6 @@ option('max_lcores', type: 'string', value: '128', description: 'maximum number
 option('max_numa_nodes', type: 'string', value: '4', description: 'maximum number of NUMA nodes supported by EAL')
 option('use_hpet', type: 'boolean', value: false, description: 'use HPET timer in EAL')
 option('allow_invalid_socket_id', type: 'boolean', value: false,
-	 description: 'allow out-of-range NUMA socket id\'s for platforms that don\'t report the value correctly')
+	description: 'allow out-of-range NUMA socket id\'s for platforms that don\'t report the value correctly')
+option('enable_kmods', type: 'boolean', value: true, description: 'build kernel modules')
+option('kernel_dir', type: 'string', value: '', description: 'path to the kernel for building kernel modules')
Signature · 1 line
2.13.4
#33 lore raw

RFC v2 33/40 ip_frag: rename version file to standard name

In reply to Bruce Richardson

The version file did not quite match the directory name, as it was missing an '_' between ip and frag.

---
 lib/librte_ip_frag/Makefile                                            | 2 +-
 lib/librte_ip_frag/{rte_ipfrag_version.map => rte_ip_frag_version.map} | 0
 2 files changed, 1 insertion(+), 1 deletion(-)
 rename lib/librte_ip_frag/{rte_ipfrag_version.map => rte_ip_frag_version.map} (100%)
lib/librte_ip_frag/Makefile +1 -1
index 4e693bf8f..2a8c3e374 100644
@@ -37,7 +37,7 @@ LIB = librte_ip_frag.a
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR)
 
-EXPORT_MAP := rte_ipfrag_version.map
+EXPORT_MAP := rte_ip_frag_version.map
 
 LIBABIVER := 1
 
lib/librte_ip_frag/rte_ip_frag_version.map renamed from lib/librte_ip_frag/rte_ipfrag_version.map +0 -0
similarity index 100%
rename from lib/librte_ip_frag/rte_ipfrag_version.map
rename to lib/librte_ip_frag/rte_ip_frag_version.map
Signature · 1 line
2.13.4
#34 lore raw

RFC v2 34/40 build: add most remaining libraries to meson build

In reply to Bruce Richardson

Only libraries not included in meson build at this point are the three packet framework libs, and the acl library (which needs some custom handling for the different instruction set levels it has).

---
 app/test-pmd/meson.build            |  3 +++
 config/meson.build                  |  2 ++
 config/rte_config.h                 | 19 ++++++++++++++++++
 drivers/mempool/meson.build         |  2 +-
 lib/librte_bitratestats/meson.build | 34 ++++++++++++++++++++++++++++++++
 lib/librte_cfgfile/meson.build      | 35 +++++++++++++++++++++++++++++++++
 lib/librte_cryptodev/meson.build    |  1 +
 lib/librte_distributor/meson.build  | 39 +++++++++++++++++++++++++++++++++++++
 lib/librte_efd/meson.build          | 34 ++++++++++++++++++++++++++++++++
 lib/librte_ether/meson.build        |  2 +-
 lib/librte_eventdev/meson.build     | 36 ++++++++++++++++++++++++++++++++++
 lib/librte_ip_frag/meson.build      | 39 +++++++++++++++++++++++++++++++++++++
 lib/librte_jobstats/meson.build     | 34 ++++++++++++++++++++++++++++++++
 lib/librte_kni/meson.build          | 35 +++++++++++++++++++++++++++++++++
 lib/librte_latencystats/meson.build | 34 ++++++++++++++++++++++++++++++++
 lib/librte_lpm/meson.build          | 35 +++++++++++++++++++++++++++++++++
 lib/librte_mbuf/meson.build         |  2 +-
 lib/librte_mempool/meson.build      |  3 +--
 lib/librte_meter/meson.build        | 34 ++++++++++++++++++++++++++++++++
 lib/librte_net/meson.build          |  2 +-
 lib/librte_pdump/meson.build        | 34 ++++++++++++++++++++++++++++++++
 lib/librte_power/meson.build        | 35 +++++++++++++++++++++++++++++++++
 lib/librte_reorder/meson.build      | 34 ++++++++++++++++++++++++++++++++
 lib/librte_sched/meson.build        | 36 ++++++++++++++++++++++++++++++++++
 lib/librte_timer/meson.build        | 34 ++++++++++++++++++++++++++++++++
 lib/librte_vhost/meson.build        | 36 ++++++++++++++++++++++++++++++++++
 lib/meson.build                     | 24 +++++++++++++++++++----
 27 files changed, 648 insertions(+), 10 deletions(-)
 create mode 100644 lib/librte_bitratestats/meson.build
 create mode 100644 lib/librte_cfgfile/meson.build
 create mode 100644 lib/librte_distributor/meson.build
 create mode 100644 lib/librte_efd/meson.build
 create mode 100644 lib/librte_eventdev/meson.build
 create mode 100644 lib/librte_ip_frag/meson.build
 create mode 100644 lib/librte_jobstats/meson.build
 create mode 100644 lib/librte_kni/meson.build
 create mode 100644 lib/librte_latencystats/meson.build
 create mode 100644 lib/librte_lpm/meson.build
 create mode 100644 lib/librte_meter/meson.build
 create mode 100644 lib/librte_pdump/meson.build
 create mode 100644 lib/librte_power/meson.build
 create mode 100644 lib/librte_reorder/meson.build
 create mode 100644 lib/librte_sched/meson.build
 create mode 100644 lib/librte_timer/meson.build
 create mode 100644 lib/librte_vhost/meson.build
app/test-pmd/meson.build +3 -0
index 9c60f4bc0..843feb54f 100644
@@ -46,6 +46,9 @@ sources = files('cmdline.c',
 
 deps = ['rte_eal', 'rte_net', 'rte_ether', 'rte_mempool', 'rte_ring',
 	'rte_mbuf', 'rte_gro', 'rte_cmdline', 'rte_metrics']
+if dpdk_conf.has('RTE_LIBRTE_PDUMP')
+	deps += 'rte_pdump'
+endif
 if dpdk_conf.has('RTE_LIBRTE_I40E_PMD')
 	deps += 'rte_pmd_i40e'
 endif
config/meson.build +2 -0
index 4a6a69d13..3a6bcc58d 100644
@@ -33,6 +33,8 @@
 machine = get_option('machine')
 dpdk_conf.set('RTE_MACHINE', machine)
 add_project_arguments('-march=@0@'.format(machine), language: 'c')
+# some libs depend on maths lib
+add_project_link_arguments('-lm', language: 'c')
 
 # add -include rte_config to cflags
 add_project_arguments('-include', 'rte_config.h', language: 'c')
config/rte_config.h +19 -0
index 6eb72415a..651c9b5d6 100644
@@ -75,6 +75,25 @@
 /* cryptodev defines */
 #define RTE_CRYPTO_MAX_DEVS 64
 #define RTE_CRYPTODEV_NAME_LEN 64
+
+/* eventdev defines */
+#define RTE_EVENT_MAX_DEVS 16
+#define RTE_EVENT_MAX_QUEUES_PER_DEV 64
+
+/* ip_fragmentation defines */
+#define RTE_LIBRTE_IP_FRAG_MAX_FRAG 4
+#undef RTE_LIBRTE_IP_FRAG_TBL_STAT
+
+/* rte_power defines */
+#define RTE_MAX_LCORE_FREQS 64
+
+/* rte_sched defines */
+#undef RTE_SCHED_RED
+#undef RTE_SCHED_COLLECT_STATS
+#undef RTE_SCHED_SUBPORT_TC_OV
+#define RTE_SCHED_PORT_N_GRINDERS 8
+#undef RTE_SCHED_VECTOR
+
 /****** driver defines ********/
 
 /* i40e defines */
drivers/mempool/meson.build +1 -1
index d998797ca..a426b8f92 100644
@@ -52,7 +52,7 @@ foreach drv:mempool_drivers
 	# get dependency objs from strings
 	dep_objs = ext_deps
 	foreach d:deps
-		dep_objs = [get_variable('dep_rte_' + d)] + dep_objs
+		dep_objs += [get_variable('dep_rte_' + d)] + dep_objs
 	endforeach
 
 	# generate pmdinfo sources
lib/librte_bitratestats/meson.build new file +34 -0
new file mode 100644
index 000000000..6e58d68aa
@@ -0,0 +1,34 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation. All rights reserved.
+#   All rights reserved.
+#
+#   Redistribution and use in source and binary forms, with or without
+#   modification, are permitted provided that the following conditions
+#   are met:
+#
+#     * Redistributions of source code must retain the above copyright
+#       notice, this list of conditions and the following disclaimer.
+#     * Redistributions in binary form must reproduce the above copyright
+#       notice, this list of conditions and the following disclaimer in
+#       the documentation and/or other materials provided with the
+#       distribution.
+#     * Neither the name of Intel Corporation nor the names of its
+#       contributors may be used to endorse or promote products derived
+#       from this software without specific prior written permission.
+#
+#   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+#   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+#   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+#   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+#   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+#   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+#   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+#   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+#   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+#   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+#   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+sources = files('rte_bitrate.c')
+headers = files('rte_bitrate.h')
+deps = ['eal', 'ether', 'metrics']
lib/librte_cfgfile/meson.build new file +35 -0
new file mode 100644
index 000000000..4484f9b45
@@ -0,0 +1,35 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation. All rights reserved.
+#   All rights reserved.
+#
+#   Redistribution and use in source and binary forms, with or without
+#   modification, are permitted provided that the following conditions
+#   are met:
+#
+#     * Redistributions of source code must retain the above copyright
+#       notice, this list of conditions and the following disclaimer.
+#     * Redistributions in binary form must reproduce the above copyright
+#       notice, this list of conditions and the following disclaimer in
+#       the documentation and/or other materials provided with the
+#       distribution.
+#     * Neither the name of Intel Corporation nor the names of its
+#       contributors may be used to endorse or promote products derived
+#       from this software without specific prior written permission.
+#
+#   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+#   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+#   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+#   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+#   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+#   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+#   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+#   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+#   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+#   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+#   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+version = 2
+sources = files('rte_cfgfile.c')
+headers = files('rte_cfgfile.h')
+deps = ['eal']
lib/librte_cryptodev/meson.build +1 -0
index c732e2094..226f2c790 100644
@@ -29,6 +29,7 @@
 #   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 #   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
+version = 3
 sources = files('rte_cryptodev.c', 'rte_cryptodev_pmd.c')
 headers = files('rte_cryptodev.h',
 	'rte_cryptodev_pci.h',
lib/librte_distributor/meson.build new file +39 -0
new file mode 100644
index 000000000..09595d75f
@@ -0,0 +1,39 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation. All rights reserved.
+#   All rights reserved.
+#
+#   Redistribution and use in source and binary forms, with or without
+#   modification, are permitted provided that the following conditions
+#   are met:
+#
+#     * Redistributions of source code must retain the above copyright
+#       notice, this list of conditions and the following disclaimer.
+#     * Redistributions in binary form must reproduce the above copyright
+#       notice, this list of conditions and the following disclaimer in
+#       the documentation and/or other materials provided with the
+#       distribution.
+#     * Neither the name of Intel Corporation nor the names of its
+#       contributors may be used to endorse or promote products derived
+#       from this software without specific prior written permission.
+#
+#   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+#   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+#   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+#   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+#   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+#   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+#   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+#   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+#   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+#   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+#   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+sources = files('rte_distributor.c', 'rte_distributor_v20.c')
+if arch_subdir == 'x86'
+	sources += files('rte_distributor_match_sse.c')
+else
+	sources += files('rte_distributor_match_generic.c')
+endif
+headers = files('rte_distributor.h')
+deps = ['eal', 'mbuf', 'compat']
lib/librte_efd/meson.build new file +34 -0
new file mode 100644
index 000000000..299381522
@@ -0,0 +1,34 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation. All rights reserved.
+#   All rights reserved.
+#
+#   Redistribution and use in source and binary forms, with or without
+#   modification, are permitted provided that the following conditions
+#   are met:
+#
+#     * Redistributions of source code must retain the above copyright
+#       notice, this list of conditions and the following disclaimer.
+#     * Redistributions in binary form must reproduce the above copyright
+#       notice, this list of conditions and the following disclaimer in
+#       the documentation and/or other materials provided with the
+#       distribution.
+#     * Neither the name of Intel Corporation nor the names of its
+#       contributors may be used to endorse or promote products derived
+#       from this software without specific prior written permission.
+#
+#   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+#   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+#   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+#   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+#   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+#   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+#   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+#   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+#   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+#   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+#   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+sources = files('rte_efd.c')
+headers = files('rte_efd.h')
+deps = ['eal', 'ring', 'hash']
lib/librte_ether/meson.build +1 -1
index ed9c29a78..65c054e0d 100644
@@ -42,5 +42,5 @@ headers = files('rte_ethdev.h',
 	'rte_flow_driver.h',
 	'rte_tm.h')
 
-deps = ['eal', 'ring', 'mempool', 'net', 'mbuf']
+deps = ['net']
 
lib/librte_eventdev/meson.build new file +36 -0
new file mode 100644
index 000000000..4da39fa0d
@@ -0,0 +1,36 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation. All rights reserved.
+#   All rights reserved.
+#
+#   Redistribution and use in source and binary forms, with or without
+#   modification, are permitted provided that the following conditions
+#   are met:
+#
+#     * Redistributions of source code must retain the above copyright
+#       notice, this list of conditions and the following disclaimer.
+#     * Redistributions in binary form must reproduce the above copyright
+#       notice, this list of conditions and the following disclaimer in
+#       the documentation and/or other materials provided with the
+#       distribution.
+#     * Neither the name of Intel Corporation nor the names of its
+#       contributors may be used to endorse or promote products derived
+#       from this software without specific prior written permission.
+#
+#   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+#   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+#   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+#   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+#   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+#   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+#   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+#   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+#   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+#   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+#   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+sources = files('rte_eventdev.c', 'rte_event_ring.c')
+headers = files('rte_eventdev.h', 'rte_eventdev_pmd.h',
+		'rte_eventdev_pmd_pci.h', 'rte_eventdev_pmd_vdev.h',
+		'rte_event_ring.h')
+deps = ['eal', 'ring']
lib/librte_ip_frag/meson.build new file +39 -0
new file mode 100644
index 000000000..6c7765cf7
@@ -0,0 +1,39 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation. All rights reserved.
+#   All rights reserved.
+#
+#   Redistribution and use in source and binary forms, with or without
+#   modification, are permitted provided that the following conditions
+#   are met:
+#
+#     * Redistributions of source code must retain the above copyright
+#       notice, this list of conditions and the following disclaimer.
+#     * Redistributions in binary form must reproduce the above copyright
+#       notice, this list of conditions and the following disclaimer in
+#       the documentation and/or other materials provided with the
+#       distribution.
+#     * Neither the name of Intel Corporation nor the names of its
+#       contributors may be used to endorse or promote products derived
+#       from this software without specific prior written permission.
+#
+#   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+#   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+#   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+#   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+#   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+#   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+#   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+#   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+#   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+#   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+#   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+sources = files('rte_ipv4_fragmentation.c',
+		'rte_ipv6_fragmentation.c',
+		'rte_ipv4_reassembly.c',
+		'rte_ipv6_reassembly.c',
+		'rte_ip_frag_common.c',
+		'ip_frag_internal.c')
+headers = files('rte_ip_frag.h')
+deps = ['eal', 'mempool', 'mbuf', 'ether', 'hash']
lib/librte_jobstats/meson.build new file +34 -0
new file mode 100644
index 000000000..4bb5b6e49
@@ -0,0 +1,34 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation. All rights reserved.
+#   All rights reserved.
+#
+#   Redistribution and use in source and binary forms, with or without
+#   modification, are permitted provided that the following conditions
+#   are met:
+#
+#     * Redistributions of source code must retain the above copyright
+#       notice, this list of conditions and the following disclaimer.
+#     * Redistributions in binary form must reproduce the above copyright
+#       notice, this list of conditions and the following disclaimer in
+#       the documentation and/or other materials provided with the
+#       distribution.
+#     * Neither the name of Intel Corporation nor the names of its
+#       contributors may be used to endorse or promote products derived
+#       from this software without specific prior written permission.
+#
+#   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+#   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+#   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+#   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+#   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+#   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+#   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+#   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+#   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+#   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+#   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+sources = files('rte_jobstats.c')
+headers = files('rte_jobstats.h')
+deps = ['eal']
lib/librte_kni/meson.build new file +35 -0
new file mode 100644
index 000000000..95c5edf96
@@ -0,0 +1,35 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation. All rights reserved.
+#   All rights reserved.
+#
+#   Redistribution and use in source and binary forms, with or without
+#   modification, are permitted provided that the following conditions
+#   are met:
+#
+#     * Redistributions of source code must retain the above copyright
+#       notice, this list of conditions and the following disclaimer.
+#     * Redistributions in binary form must reproduce the above copyright
+#       notice, this list of conditions and the following disclaimer in
+#       the documentation and/or other materials provided with the
+#       distribution.
+#     * Neither the name of Intel Corporation nor the names of its
+#       contributors may be used to endorse or promote products derived
+#       from this software without specific prior written permission.
+#
+#   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+#   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+#   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+#   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+#   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+#   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+#   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+#   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+#   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+#   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+#   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+version = 2
+sources = files('rte_kni.c')
+headers = files('rte_kni.h')
+deps = ['eal', 'mempool', 'mbuf', 'ether']
lib/librte_latencystats/meson.build new file +34 -0
new file mode 100644
index 000000000..0efade639
@@ -0,0 +1,34 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation. All rights reserved.
+#   All rights reserved.
+#
+#   Redistribution and use in source and binary forms, with or without
+#   modification, are permitted provided that the following conditions
+#   are met:
+#
+#     * Redistributions of source code must retain the above copyright
+#       notice, this list of conditions and the following disclaimer.
+#     * Redistributions in binary form must reproduce the above copyright
+#       notice, this list of conditions and the following disclaimer in
+#       the documentation and/or other materials provided with the
+#       distribution.
+#     * Neither the name of Intel Corporation nor the names of its
+#       contributors may be used to endorse or promote products derived
+#       from this software without specific prior written permission.
+#
+#   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+#   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+#   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+#   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+#   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+#   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+#   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+#   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+#   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+#   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+#   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+sources = files('rte_latencystats.c')
+headers = files('rte_latencystats.h')
+deps = ['eal', 'metrics', 'ether', 'mbuf']
lib/librte_lpm/meson.build new file +35 -0
new file mode 100644
index 000000000..9d276d55f
@@ -0,0 +1,35 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation. All rights reserved.
+#   All rights reserved.
+#
+#   Redistribution and use in source and binary forms, with or without
+#   modification, are permitted provided that the following conditions
+#   are met:
+#
+#     * Redistributions of source code must retain the above copyright
+#       notice, this list of conditions and the following disclaimer.
+#     * Redistributions in binary form must reproduce the above copyright
+#       notice, this list of conditions and the following disclaimer in
+#       the documentation and/or other materials provided with the
+#       distribution.
+#     * Neither the name of Intel Corporation nor the names of its
+#       contributors may be used to endorse or promote products derived
+#       from this software without specific prior written permission.
+#
+#   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+#   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+#   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+#   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+#   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+#   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+#   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+#   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+#   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+#   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+#   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+version = 2
+sources = files('rte_lpm.c', 'rte_lpm6.c')
+headers = files('rte_lpm.h', 'rte_lpm6.h')
+deps = ['eal', 'compat']
lib/librte_mbuf/meson.build +1 -1
index 19cd68528..1477cb0a3 100644
@@ -32,5 +32,5 @@
 version = 3
 sources = files('rte_mbuf.c', 'rte_mbuf_ptype.c')
 headers = files('rte_mbuf.h', 'rte_mbuf_ptype.h')
-deps = ['eal', 'mempool', 'ring']
+deps = ['mempool']
 
lib/librte_mempool/meson.build +1 -2
index 9617010dd..3d39ab119 100644
@@ -32,5 +32,4 @@
 version = 2
 sources = files('rte_mempool.c', 'rte_mempool_ops.c')
 headers = files('rte_mempool.h')
-deps = ['eal', 'ring']
-
+deps = ['ring']
lib/librte_meter/meson.build new file +34 -0
new file mode 100644
index 000000000..ada4dfa01
@@ -0,0 +1,34 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation. All rights reserved.
+#   All rights reserved.
+#
+#   Redistribution and use in source and binary forms, with or without
+#   modification, are permitted provided that the following conditions
+#   are met:
+#
+#     * Redistributions of source code must retain the above copyright
+#       notice, this list of conditions and the following disclaimer.
+#     * Redistributions in binary form must reproduce the above copyright
+#       notice, this list of conditions and the following disclaimer in
+#       the documentation and/or other materials provided with the
+#       distribution.
+#     * Neither the name of Intel Corporation nor the names of its
+#       contributors may be used to endorse or promote products derived
+#       from this software without specific prior written permission.
+#
+#   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+#   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+#   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+#   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+#   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+#   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+#   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+#   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+#   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+#   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+#   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+sources = files('rte_meter.c')
+headers = files('rte_meter.h')
+deps = ['eal']
lib/librte_net/meson.build +1 -1
index 0bfe53873..9d92770fa 100644
@@ -42,5 +42,5 @@ headers = files('rte_ip.h',
 	'rte_net_crc.h')
 
 sources = files('rte_net.c', 'rte_net_crc.c')
-deps = ['eal', 'mbuf', 'ring', 'mempool']
+deps = ['mbuf']
 
lib/librte_pdump/meson.build new file +34 -0
new file mode 100644
index 000000000..9b8d53b87
@@ -0,0 +1,34 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation. All rights reserved.
+#   All rights reserved.
+#
+#   Redistribution and use in source and binary forms, with or without
+#   modification, are permitted provided that the following conditions
+#   are met:
+#
+#     * Redistributions of source code must retain the above copyright
+#       notice, this list of conditions and the following disclaimer.
+#     * Redistributions in binary form must reproduce the above copyright
+#       notice, this list of conditions and the following disclaimer in
+#       the documentation and/or other materials provided with the
+#       distribution.
+#     * Neither the name of Intel Corporation nor the names of its
+#       contributors may be used to endorse or promote products derived
+#       from this software without specific prior written permission.
+#
+#   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+#   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+#   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+#   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+#   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+#   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+#   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+#   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+#   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+#   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+#   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+sources = files('rte_pdump.c')
+headers = files('rte_pdump.h')
+deps = ['eal', 'mbuf', 'ether']
lib/librte_power/meson.build new file +35 -0
new file mode 100644
index 000000000..bd32714d3
@@ -0,0 +1,35 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation. All rights reserved.
+#   All rights reserved.
+#
+#   Redistribution and use in source and binary forms, with or without
+#   modification, are permitted provided that the following conditions
+#   are met:
+#
+#     * Redistributions of source code must retain the above copyright
+#       notice, this list of conditions and the following disclaimer.
+#     * Redistributions in binary form must reproduce the above copyright
+#       notice, this list of conditions and the following disclaimer in
+#       the documentation and/or other materials provided with the
+#       distribution.
+#     * Neither the name of Intel Corporation nor the names of its
+#       contributors may be used to endorse or promote products derived
+#       from this software without specific prior written permission.
+#
+#   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+#   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+#   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+#   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+#   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+#   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+#   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+#   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+#   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+#   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+#   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+sources = files('rte_power.c', 'rte_power_acpi_cpufreq.c',
+		'rte_power_kvm_vm.c', 'guest_channel.c')
+headers = files('rte_power.h')
+deps = ['eal']
lib/librte_reorder/meson.build new file +34 -0
new file mode 100644
index 000000000..4f6d732ba
@@ -0,0 +1,34 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation. All rights reserved.
+#   All rights reserved.
+#
+#   Redistribution and use in source and binary forms, with or without
+#   modification, are permitted provided that the following conditions
+#   are met:
+#
+#     * Redistributions of source code must retain the above copyright
+#       notice, this list of conditions and the following disclaimer.
+#     * Redistributions in binary form must reproduce the above copyright
+#       notice, this list of conditions and the following disclaimer in
+#       the documentation and/or other materials provided with the
+#       distribution.
+#     * Neither the name of Intel Corporation nor the names of its
+#       contributors may be used to endorse or promote products derived
+#       from this software without specific prior written permission.
+#
+#   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+#   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+#   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+#   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+#   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+#   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+#   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+#   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+#   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+#   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+#   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+sources = files('rte_reorder.c')
+headers = files('rte_reorder.h')
+deps = ['eal', 'mbuf']
lib/librte_sched/meson.build new file +36 -0
new file mode 100644
index 000000000..7443cd650
@@ -0,0 +1,36 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation. All rights reserved.
+#   All rights reserved.
+#
+#   Redistribution and use in source and binary forms, with or without
+#   modification, are permitted provided that the following conditions
+#   are met:
+#
+#     * Redistributions of source code must retain the above copyright
+#       notice, this list of conditions and the following disclaimer.
+#     * Redistributions in binary form must reproduce the above copyright
+#       notice, this list of conditions and the following disclaimer in
+#       the documentation and/or other materials provided with the
+#       distribution.
+#     * Neither the name of Intel Corporation nor the names of its
+#       contributors may be used to endorse or promote products derived
+#       from this software without specific prior written permission.
+#
+#   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+#   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+#   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+#   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+#   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+#   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+#   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+#   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+#   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+#   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+#   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+sources = files('rte_sched.c', 'rte_red.c', 'rte_approx.c',
+		'rte_reciprocal.c')
+headers = files('rte_sched.h', 'rte_bitmap.h', 'rte_sched_common.h',
+		'rte_red.h', 'rte_approx.h', 'rte_reciprocal.h')
+deps = ['mbuf', 'meter']
lib/librte_timer/meson.build new file +34 -0
new file mode 100644
index 000000000..708712097
@@ -0,0 +1,34 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation. All rights reserved.
+#   All rights reserved.
+#
+#   Redistribution and use in source and binary forms, with or without
+#   modification, are permitted provided that the following conditions
+#   are met:
+#
+#     * Redistributions of source code must retain the above copyright
+#       notice, this list of conditions and the following disclaimer.
+#     * Redistributions in binary form must reproduce the above copyright
+#       notice, this list of conditions and the following disclaimer in
+#       the documentation and/or other materials provided with the
+#       distribution.
+#     * Neither the name of Intel Corporation nor the names of its
+#       contributors may be used to endorse or promote products derived
+#       from this software without specific prior written permission.
+#
+#   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+#   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+#   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+#   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+#   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+#   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+#   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+#   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+#   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+#   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+#   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+sources = files('rte_timer.c')
+headers = files('rte_timer.h')
+deps = ['eal']
lib/librte_vhost/meson.build new file +36 -0
new file mode 100644
index 000000000..d0a1382b3
@@ -0,0 +1,36 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation. All rights reserved.
+#   All rights reserved.
+#
+#   Redistribution and use in source and binary forms, with or without
+#   modification, are permitted provided that the following conditions
+#   are met:
+#
+#     * Redistributions of source code must retain the above copyright
+#       notice, this list of conditions and the following disclaimer.
+#     * Redistributions in binary form must reproduce the above copyright
+#       notice, this list of conditions and the following disclaimer in
+#       the documentation and/or other materials provided with the
+#       distribution.
+#     * Neither the name of Intel Corporation nor the names of its
+#       contributors may be used to endorse or promote products derived
+#       from this software without specific prior written permission.
+#
+#   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+#   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+#   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+#   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+#   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+#   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+#   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+#   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+#   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+#   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+#   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+version = 4
+sources = files('fd_man.c', 'socket.c', 'vhost.c', 'vhost_user.c',
+		'virtio_net.c')
+headers = files('rte_vhost.h')
+deps = ['eal', 'mbuf', 'ether']
lib/meson.build +20 -4
index 917eee7b2..453d6ee0d 100644
@@ -34,8 +34,24 @@ subdir('librte_eal')
 subdir('librte_compat')
 
 # process all libraries equally, as far as possible
-libs = ['ring', 'mempool', 'cmdline', 'mbuf', 'net', 'ether', 'hash',
-	'kvargs', 'gro', 'metrics', 'cryptodev']
+# "core" libs first, then others alphebetically as far as possible
+# NOTE: for speed of meson runs, the dependencies in the subdirectories
+# sometimes skip deps that would be implied by others, e.g. if mempool is
+# given as a dep, no need to mention ring. This is especially true for the
+# core libs which are widely reused, so their deps are kept to a minimum.
+libs = ['ring', 'mempool', 'mbuf', 'net', 'ether', # core
+	'metrics', # bitrate/latency stats depends on this
+	'hash',    # efd depends on this
+	'kvargs',  # cryptodev depends on this
+	'bitratestats', 'cfgfile', 'cmdline', 'cryptodev', 'distributor',
+	'efd', 'eventdev', 'gro', 'ip_frag', 'jobstats',
+	'latencystats', 'lpm', 'meter', 'pdump', 'reorder', 'sched',
+	'timer']
+# pipeline, port, table, acl # todo
+
+if host_machine.system() == 'linux'
+	libs += ['kni', 'power', 'vhost']
+endif
 
 foreach l:libs
 	version = 1
@@ -52,9 +68,9 @@ foreach l:libs
 
 	install_headers(headers)
 
-	dep_objs = []
+	dep_objs = ext_deps
 	foreach d:deps
-		dep_objs = [get_variable('dep_rte_' + d)] + dep_objs
+		dep_objs += [get_variable('dep_rte_' + d)] + dep_objs
 	endforeach
 
 	version_map = '@0@/@1@/rte_@2@_version.map'.format(
Signature · 1 line
2.13.4
#35 lore raw

RFC v2 35/40 build: add packet framework libs to meson build

In reply to Bruce Richardson
---
 lib/librte_pipeline/meson.build | 35 +++++++++++++++++++++++++
 lib/librte_port/meson.build     | 58 +++++++++++++++++++++++++++++++++++++++++
 lib/librte_table/meson.build    | 52 ++++++++++++++++++++++++++++++++++++
 lib/meson.build                 |  6 ++++-
 4 files changed, 150 insertions(+), 1 deletion(-)
 create mode 100644 lib/librte_pipeline/meson.build
 create mode 100644 lib/librte_port/meson.build
 create mode 100644 lib/librte_table/meson.build
lib/librte_pipeline/meson.build new file +35 -0
new file mode 100644
index 000000000..56a3cf69f
@@ -0,0 +1,35 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation. All rights reserved.
+#   All rights reserved.
+#
+#   Redistribution and use in source and binary forms, with or without
+#   modification, are permitted provided that the following conditions
+#   are met:
+#
+#     * Redistributions of source code must retain the above copyright
+#       notice, this list of conditions and the following disclaimer.
+#     * Redistributions in binary form must reproduce the above copyright
+#       notice, this list of conditions and the following disclaimer in
+#       the documentation and/or other materials provided with the
+#       distribution.
+#     * Neither the name of Intel Corporation nor the names of its
+#       contributors may be used to endorse or promote products derived
+#       from this software without specific prior written permission.
+#
+#   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+#   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+#   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+#   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+#   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+#   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+#   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+#   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+#   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+#   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+#   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+version = 3
+sources = files('rte_pipeline.c')
+headers = files('rte_pipeline.h')
+deps += ['port', 'table']
\ No newline at end of file
lib/librte_port/meson.build new file +58 -0

58 lines not on this page · raw message

lib/librte_table/meson.build new file +52 -0

53 lines not on this page · raw message

lib/meson.build +5 -1
index 453d6ee0d..92d26b8aa 100644
@@ -47,12 +47,16 @@ libs = ['ring', 'mempool', 'mbuf', 'net', 'ether', # core
 	'efd', 'eventdev', 'gro', 'ip_frag', 'jobstats',
 	'latencystats', 'lpm', 'meter', 'pdump', 'reorder', 'sched',
 	'timer']
-# pipeline, port, table, acl # todo
+# acl - todo
 
 if host_machine.system() == 'linux'
 	libs += ['kni', 'power', 'vhost']
 endif
 
+# add pkt framework libs which use other libs from above, including optional
+# ones for linux
+libs += ['port', 'table', 'pipeline']
+
 foreach l:libs
 	version = 1
 	sources = []
Signature · 1 line
2.13.4
#36 lore raw

RFC v2 36/40 acl: add acl library to meson build

In reply to Bruce Richardson
---
 lib/librte_acl/meson.build | 60 ++++++++++++++++++++++++++++++++++++++++++++++
 lib/meson.build            | 18 ++++++++------
 2 files changed, 71 insertions(+), 7 deletions(-)
 create mode 100644 lib/librte_acl/meson.build
lib/librte_acl/meson.build new file +60 -0
new file mode 100644
index 000000000..ddaf29bf5
@@ -0,0 +1,60 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation. All rights reserved.
+#   All rights reserved.
+#
+#   Redistribution and use in source and binary forms, with or without
+#   modification, are permitted provided that the following conditions
+#   are met:
+#
+#     * Redistributions of source code must retain the above copyright
+#       notice, this list of conditions and the following disclaimer.
+#     * Redistributions in binary form must reproduce the above copyright
+#       notice, this list of conditions and the following disclaimer in
+#       the documentation and/or other materials provided with the
+#       distribution.
+#     * Neither the name of Intel Corporation nor the names of its
+#       contributors may be used to endorse or promote products derived
+#       from this software without specific prior written permission.
+#
+#   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+#   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+#   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+#   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+#   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+#   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+#   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+#   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+#   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+#   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+#   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+version = 2
+sources = files('acl_bld.c', 'acl_gen.c', 'acl_run_scalar.c',
+		'rte_acl.c', 'tb_mem.c')
+headers = files('rte_acl.h', 'rte_acl_osdep.h')
+deps += ['eal']
+
+if arch_subdir == 'x86'
+	sources += files('acl_run_sse.c')
+
+	# compile AVX2 version if either:
+	# a. we have AVX supported in minimum instruction set baseline
+	# b. it's not minimum instruction set, but supported by compiler
+	#
+	# in former case, just add avx2 C file to files list
+	# in latter case, compile c file to static lib, using correct compiler
+	# flags, and then have the .o file from static lib linked into main lib.
+	if dpdk_conf.has('RTE_MACHINE_CPUFLAG_AVX2')
+		sources += files('acl_run_avx2.c')
+		cflags += '-DCC_AVX2_SUPPORT'
+	elif cc.has_argument('-mavx2')
+		avx2_tmplib = static_library('avx2_tmp',
+				'acl_run_avx2.c',
+				dependencies: rte_eal,
+				c_args: '-mavx2')
+		objs += avx2_tmplib.extract_objects('acl_run_avx2.c')
+		cflags += '-DCC_AVX2_SUPPORT'
+	endif
+
+endif
lib/meson.build +11 -7
index 92d26b8aa..54efb4ba7 100644
@@ -39,28 +39,30 @@ subdir('librte_compat')
 # sometimes skip deps that would be implied by others, e.g. if mempool is
 # given as a dep, no need to mention ring. This is especially true for the
 # core libs which are widely reused, so their deps are kept to a minimum.
-libs = ['ring', 'mempool', 'mbuf', 'net', 'ether', # core
+libraries = ['ring', 'mempool', 'mbuf', 'net', 'ether', # core
 	'metrics', # bitrate/latency stats depends on this
 	'hash',    # efd depends on this
 	'kvargs',  # cryptodev depends on this
-	'bitratestats', 'cfgfile', 'cmdline', 'cryptodev', 'distributor',
-	'efd', 'eventdev', 'gro', 'ip_frag', 'jobstats',
+	'acl', 'bitratestats', 'cfgfile', 'cmdline', 'cryptodev',
+	'distributor', 'efd', 'eventdev', 'gro', 'ip_frag', 'jobstats',
 	'latencystats', 'lpm', 'meter', 'pdump', 'reorder', 'sched',
 	'timer']
-# acl - todo
 
 if host_machine.system() == 'linux'
-	libs += ['kni', 'power', 'vhost']
+	libraries += ['kni', 'power', 'vhost']
 endif
 
 # add pkt framework libs which use other libs from above, including optional
 # ones for linux
-libs += ['port', 'table', 'pipeline']
+libraries += ['port', 'table', 'pipeline']
 
-foreach l:libs
+foreach l:libraries
 	version = 1
 	sources = []
 	headers = []
+	cflags = []
+	objs = [] # other object files to link against, used e.g. for instruction-
+	          # optimized versions of code
 	# use "deps" for internal DPDK dependencies, and "ext_deps" for
 	# external package/library requirements
 	deps = []
@@ -85,6 +87,8 @@ foreach l:libs
 	endif
 	lib = library(libname,
 			sources,
+			objects: objs,
+			c_args: cflags,
 			dependencies: dep_objs,
 			include_directories: include_directories(dir_name),
 			link_args: '-Wl,--version-script=' + version_map,
Signature · 1 line
2.13.4
#37 lore raw

RFC v2 37/40 build: add ark and avp PMDs to build

In reply to Bruce Richardson
---
 drivers/net/ark/meson.build | 44 ++++++++++++++++++++++++++++++++++++++++++++
 drivers/net/avp/meson.build | 36 ++++++++++++++++++++++++++++++++++++
 drivers/net/meson.build     |  2 +-
 3 files changed, 81 insertions(+), 1 deletion(-)
 create mode 100644 drivers/net/ark/meson.build
 create mode 100644 drivers/net/avp/meson.build
drivers/net/ark/meson.build new file +44 -0
new file mode 100644
index 000000000..a94d70383
@@ -0,0 +1,44 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation. All rights reserved.
+#   All rights reserved.
+#
+#   Redistribution and use in source and binary forms, with or without
+#   modification, are permitted provided that the following conditions
+#   are met:
+#
+#     * Redistributions of source code must retain the above copyright
+#       notice, this list of conditions and the following disclaimer.
+#     * Redistributions in binary form must reproduce the above copyright
+#       notice, this list of conditions and the following disclaimer in
+#       the documentation and/or other materials provided with the
+#       distribution.
+#     * Neither the name of Intel Corporation nor the names of its
+#       contributors may be used to endorse or promote products derived
+#       from this software without specific prior written permission.
+#
+#   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+#   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+#   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+#   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+#   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+#   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+#   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+#   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+#   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+#   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+#   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+sources = files('ark_ddm.c',
+		'ark_ethdev.c',
+		'ark_ethdev_rx.c',
+		'ark_ethdev_tx.c',
+		'ark_mpu.c',
+		'ark_pktchkr.c',
+		'ark_pktdir.c',
+		'ark_pktgen.c',
+		'ark_rqp.c',
+		'ark_udm.c')
+if host_machine.system() == 'linux'
+	ext_deps += cc.find_library('dl')
+endif
drivers/net/avp/meson.build new file +36 -0
new file mode 100644
index 000000000..b42ed9df5
@@ -0,0 +1,36 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation. All rights reserved.
+#   All rights reserved.
+#
+#   Redistribution and use in source and binary forms, with or without
+#   modification, are permitted provided that the following conditions
+#   are met:
+#
+#     * Redistributions of source code must retain the above copyright
+#       notice, this list of conditions and the following disclaimer.
+#     * Redistributions in binary form must reproduce the above copyright
+#       notice, this list of conditions and the following disclaimer in
+#       the documentation and/or other materials provided with the
+#       distribution.
+#     * Neither the name of Intel Corporation nor the names of its
+#       contributors may be used to endorse or promote products derived
+#       from this software without specific prior written permission.
+#
+#   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+#   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+#   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+#   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+#   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+#   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+#   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+#   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+#   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+#   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+#   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+if host_machine.system() != 'linux'
+	build = false
+endif
+sources = files('avp_ethdev.c')
+install_headers('rte_avp_common.h', 'rte_avp_fifo.h')
drivers/net/meson.build +1 -1
index 00ee65988..0c804d073 100644
@@ -29,7 +29,7 @@
 #   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 #   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-net_drivers = ['i40e', 'ixgbe']
+net_drivers = ['ark', 'avp', 'i40e', 'ixgbe']
 
 # af_packet only works on linux
 if host_machine.system() == 'linux'
Signature · 1 line
2.13.4
#38 lore raw

RFC v2 38/40 build: fix static library builds with base code

In reply to Bruce Richardson

for static library builds, we miss the base code, as the base code .a file is not included in the overall driver .a file. Instead mark the objects in the base code lib to be included in the overall library.

---
 drivers/crypto/meson.build         | 6 +++---
 drivers/mempool/meson.build        | 4 ++--
 drivers/net/i40e/base/meson.build  | 1 +
 drivers/net/i40e/meson.build       | 2 +-
 drivers/net/ixgbe/base/meson.build | 1 +
 drivers/net/ixgbe/meson.build      | 2 +-
 drivers/net/meson.build            | 4 ++--
 7 files changed, 11 insertions(+), 9 deletions(-)
drivers/crypto/meson.build +3 -3
index c26e3d387..495e9350c 100644
@@ -42,14 +42,14 @@ foreach drv:crypto_drivers
 	# set up empty variables used for build
 	version = 1
 	sources = []
-	libs = []
+	objs = []
 	cflags = []
 	includes = [include_directories(drv)]
 	# dependency managment. External deps managed using dependency
 	# objects, internal deps managed by name of lib
 	ext_deps = []
 	# set up standard deps. Drivers can append/override as necessary
-	deps = ['eal', 'mbuf', 'cryptodev', 'mempool', 'kvargs']
+	deps = ['mbuf', 'cryptodev', 'kvargs']
 
 	# pull in driver directory which should assign to each of the above
 	subdir(drv)
@@ -82,9 +82,9 @@ foreach drv:crypto_drivers
 			meson.current_source_dir(), drv)
 	lib = library(drv_name,
 		sources,
+		objects: objs,
 		include_directories: includes,
 		dependencies: dep_objs,
-		link_with: libs,
 		c_args: cflags,
 		link_args: '-Wl,--version-script=' + version_map,
 		link_depends: version_map,
drivers/mempool/meson.build +2 -2
index a426b8f92..32763b326 100644
@@ -37,7 +37,7 @@ foreach drv:mempool_drivers
 	# set up empty variables used for build
 	version = 1
 	sources = []
-	libs = []
+	objs = []
 	cflags = []
 	includes = [include_directories(drv)]
 	# dependency managment. External deps managed using dependency
@@ -77,9 +77,9 @@ foreach drv:mempool_drivers
 			meson.current_source_dir(), drv)
 	lib = library(drv_name,
 		sources,
+		objects: objs,
 		include_directories: includes,
 		dependencies: dep_objs,
-		link_with: libs,
 		c_args: cflags,
 		link_args: '-Wl,--version-script=' + version_map,
 		link_depends: version_map,
drivers/net/i40e/base/meson.build +1 -0
index 69f55497e..ef19e358d 100644
@@ -53,3 +53,4 @@ endforeach
 base_lib = static_library('i40e_base', sources,
 	dependencies: rte_eal,
 	c_args: c_args)
+base_objs = base_lib.extract_all_objects()
drivers/net/i40e/meson.build +1 -1
index dcc832b6f..da3f0b6dc 100644
@@ -35,7 +35,7 @@ cflags = ['-DPF_DRIVER',
 	'-DX722_A0_SUPPORT']
 
 subdir('base')
-libs = [base_lib]
+objs = [base_objs]
 
 sources = files(
 	'i40e_ethdev.c',
drivers/net/ixgbe/base/meson.build +1 -0
index d5fb435e4..2f3fe0491 100644
@@ -57,3 +57,4 @@ endforeach
 base_lib = static_library('ixgbe_base', sources,
 	dependencies: rte_eal,
 	c_args: c_args)
+base_objs = base_lib.extract_all_objects()
drivers/net/ixgbe/meson.build +1 -1
index 3e164f97f..32c10a5e2 100644
@@ -32,7 +32,7 @@
 cflags = ['-DRTE_LIBRTE_IXGBE_BYPASS']
 
 subdir('base')
-libs = [base_lib]
+objs = [base_objs]
 
 sources = files(
 	'ixgbe_82599_bypass.c',
drivers/net/meson.build +2 -2
index 0c804d073..2fb7577fa 100644
@@ -49,7 +49,7 @@ foreach drv:net_drivers
 	# set up empty variables used for build
 	version = 1
 	sources = []
-	libs = []
+	objs = []
 	cflags = []
 	includes = [include_directories(drv)]
 	# dependency managment. External deps managed using dependency
@@ -90,9 +90,9 @@ foreach drv:net_drivers
 			meson.current_source_dir(), drv)
 	lib = library(drv_name,
 		sources,
+		objects: objs,
 		include_directories: includes,
 		dependencies: dep_objs,
-		link_with: libs,
 		c_args: cflags,
 		link_args: '-Wl,--version-script=' + version_map,
 		link_depends: version_map,
Signature · 1 line
2.13.4
#39 lore raw

RFC v2 39/40 build: fix driver dependencies for static builds

In reply to Bruce Richardson

For static builds we need to better track the dependencies of drivers, because, unlike with shared libs, the static libs don't track them themselves. Because of this we have a new global list of external dependencies which is used for creating the pkg-config file. We also move the logic for what dependencies a driver has, and if those deps are met, from the higher level build file to the drivers themselves.

---
 drivers/crypto/meson.build                         | 115 ++++++++++---------
 drivers/crypto/openssl/meson.build                 |   7 +-
 drivers/crypto/qat/meson.build                     |   7 +-
 drivers/mempool/meson.build                        | 110 +++++++++---------
 drivers/net/af_packet/meson.build                  |   3 +
 drivers/net/ark/meson.build                        |   1 +
 drivers/net/meson.build                            | 123 ++++++++++-----------
 drivers/net/pcap/meson.build                       |  11 +-
 lib/librte_eal/bsdapp/eal/meson.build              |   3 +-
 lib/librte_eal/common/include/arch/x86/meson.build |   1 +
 lib/librte_eal/linuxapp/eal/meson.build            |   3 +-
 meson.build                                        |   4 +-
 12 files changed, 211 insertions(+), 177 deletions(-)
drivers/crypto/meson.build +60 -55
index 495e9350c..d27889088 100644
@@ -29,75 +29,80 @@
 #   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 #   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-crypto_drivers = ['null']
-
-libcrypto_dep = dependency('libcrypto', required: false)
-if libcrypto_dep.found()
-	crypto_drivers += ['qat', 'openssl']
-endif
-
-foreach drv:crypto_drivers
-	dpdk_conf.set('RTE_LIBRTE_@0@_PMD'.format(drv.to_upper()),1)
+drivers = ['null', 'qat', 'openssl']
+std_deps = ['cryptodev'] # cryptodev pulls in all other needed deps
 
+foreach drv:drivers
 	# set up empty variables used for build
+	build = true # set to false to disable, e.g. missing deps
 	version = 1
 	sources = []
 	objs = []
 	cflags = []
 	includes = [include_directories(drv)]
-	# dependency managment. External deps managed using dependency
-	# objects, internal deps managed by name of lib
+	# set up internal deps. Drivers can append/override as necessary
+	deps = std_deps
+	# ext_deps: Stores external library dependency got
+	# using dependency() or cc.find_library(). For most cases, we
+	# probably also need to specify the "-l" flags in
+	# pkgconfig_extra_libs variable too, so that it can be reflected
+	# in the pkgconfig output for static builds
 	ext_deps = []
-	# set up standard deps. Drivers can append/override as necessary
-	deps = ['mbuf', 'cryptodev', 'kvargs']
+	pkgconfig_extra_libs = []
 
 	# pull in driver directory which should assign to each of the above
 	subdir(drv)
 
-	# get dependency objs from strings
-	dep_objs = ext_deps
-	foreach d:deps
-		dep_objs += [get_variable('dep_rte_' + d)] + dep_objs
-	endforeach
-
-	# generate pmdinfo sources
-	pmdinfogen_srcs = run_command('grep', '--files-with-matches',
-		'RTE_PMD_REGISTER_.*(.*)', sources).stdout().strip().split()
-	foreach src: pmdinfogen_srcs
-		out_filename = '@[email protected]'.format(src.split('/')[-1])
-		tmp_lib = static_library('tmp_@0@'.format(src.underscorify()),
-			src, include_directories: includes,
-			dependencies: dep_objs,
-			c_args: cflags)
-		sources += custom_target(out_filename,
-				command: [pmdinfo, tmp_lib.full_path(),
-					'@OUTPUT@', pmdinfogen],
-				output: out_filename,
-				depends: [pmdinfogen, tmp_lib])
-	endforeach
+	if build
+		dpdk_conf.set('RTE_LIBRTE_@0@_PMD'.format(drv.to_upper()),1)
 
-	# now build the driver itself, and add to the drivers list
-	drv_name = 'rte_pmd_@0@'.format(drv)
-	version_map = '@0@/@1@/rte_pmd_@1@_version.map'.format(
-			meson.current_source_dir(), drv)
-	lib = library(drv_name,
-		sources,
-		objects: objs,
-		include_directories: includes,
-		dependencies: dep_objs,
-		c_args: cflags,
-		link_args: '-Wl,--version-script=' + version_map,
-		link_depends: version_map,
-		version: '@[email protected]'.format(version),
-		install: true,
-		install_dir: driver_install_path)
+		# get dependency objs from strings
+		dep_objs = []
+		foreach d:deps
+			dep_objs += [get_variable('dep_rte_' + d)] + dep_objs
+		endforeach
+		dep_objs += ext_deps
+		dpdk_extra_ldflags += pkgconfig_extra_libs
 
-	dpdk_drivers += lib
+		# generate pmdinfo sources
+		pmdinfogen_srcs = run_command('grep', '--files-with-matches',
+			'RTE_PMD_REGISTER_.*(.*)', sources).stdout().strip().split()
+		foreach src: pmdinfogen_srcs
+			out_filename = '@[email protected]'.format(src.split('/')[-1])
+			tmp_lib = static_library('tmp_@0@'.format(src.underscorify()),
+				src, include_directories: includes,
+				dependencies: dep_objs,
+				c_args: cflags)
+			sources += custom_target(out_filename,
+					command: [pmdinfo, tmp_lib.full_path(),
+						'@OUTPUT@', pmdinfogen],
+					output: out_filename,
+					depends: [pmdinfogen, tmp_lib])
+		endforeach
 
-	# create a dependency object and add it to the global dictionary so
-	# testpmd or other built-in apps can find it if necessary
-	set_variable('dep_rte_pmd_@0@'.format(drv),
-			declare_dependency(link_with: lib,
+		# now build the driver itself, and add to the drivers list
+		drv_name = 'rte_pmd_@0@'.format(drv)
+		version_map = '@0@/@1@/rte_pmd_@1@_version.map'.format(
+				meson.current_source_dir(), drv)
+		lib = library(drv_name,
+			sources,
+			objects: objs,
 			include_directories: includes,
-			dependencies: dep_objs))
+			dependencies: dep_objs,
+			c_args: cflags,
+			link_args: '-Wl,--version-script=' + version_map,
+			link_depends: version_map,
+			version: '@[email protected]'.format(version),
+			install: true,
+			install_dir: driver_install_path)
+
+		dpdk_drivers += lib
+
+		# create a dependency object and add it to the global dictionary so
+		# testpmd or other built-in apps can find it if necessary
+		set_variable('dep_rte_pmd_@0@'.format(drv),
+				declare_dependency(link_with: lib,
+				include_directories: includes,
+				dependencies: dep_objs))
+	endif # build
 endforeach
drivers/crypto/openssl/meson.build +6 -1
index b4337f85e..eb7f10226 100644
@@ -29,5 +29,10 @@
 #   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 #   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
+dep = dependency('libcrypto', required: false)
+if not dep.found()
+	build = false
+endif
 sources = files('rte_openssl_pmd.c', 'rte_openssl_pmd_ops.c')
-ext_deps += libcrypto_dep
+ext_deps += dep
+pkgconfig_extra_libs += '-lcrypto'
drivers/crypto/qat/meson.build +6 -1
index aa124a0a0..7d959e7f5 100644
@@ -29,8 +29,13 @@
 #   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 #   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
+dep = dependency('libcrypto', required: false)
+if not dep.found()
+	build = false
+endif
 sources = files('qat_crypto.c', 'qat_qp.c',
 		'qat_adf/qat_algs_build_desc.c',
 		'rte_qat_cryptodev.c')
 includes += include_directories('qat_adf')
-ext_deps += libcrypto_dep
+ext_deps += dep
+pkgconfig_extra_libs += '-lcrypto'
drivers/mempool/meson.build +60 -50

130 lines not on this page · raw message

drivers/net/af_packet/meson.build +3 -0
index 56ba22e73..c0dcc9b1f 100644
@@ -29,4 +29,7 @@
 #   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 #   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
+if host_machine.system() != 'linux'
+	build = false
+endif
 sources = files('rte_eth_af_packet.c')
drivers/net/ark/meson.build +1 -0
index a94d70383..385413af1 100644
@@ -41,4 +41,5 @@ sources = files('ark_ddm.c',
 		'ark_udm.c')
 if host_machine.system() == 'linux'
 	ext_deps += cc.find_library('dl')
+	pkgconfig_extra_libs += '-ldl'
 endif
drivers/net/meson.build +60 -63

143 lines not on this page · raw message

drivers/net/pcap/meson.build +7 -4
index a61668236..2cfe76410 100644
@@ -29,10 +29,13 @@
 #   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 #   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-sources = files('rte_eth_pcap.c')
-
-if pcap_dep.found()
+pcap_dep = dependency('pcap', required: false)
+if pcap_dep.found() == true
 	ext_deps += pcap_dep
-else
+elif find_program('pcap-config', required: false).found() == true
 	ext_deps += cc.find_library('pcap')
+else
+	build = false
 endif
+sources = files('rte_eth_pcap.c')
+pkgconfig_extra_libs += '-lpcap'
lib/librte_eal/bsdapp/eal/meson.build +2 -1
index 96ad1cef7..bc9c3f0cb 100644
@@ -58,7 +58,8 @@ eal_lib = library('rte_eal', sources, eal_common_sources, eal_common_arch_source
 			install: true
 )
 
-dpdk_libraries += [eal_lib, '-pthread', eal_extra_link_arg]
+dpdk_libraries += eal_lib
+dpdk_extra_ldflags += ['-pthread', eal_extra_link_arg]
 
 rte_eal = declare_dependency(link_with: eal_lib,
 		include_directories: eal_inc,
lib/librte_eal/common/include/arch/x86/meson.build +1 -0
index bd162938c..ad0949a92 100644
@@ -41,6 +41,7 @@ install_headers(
 	'rte_io.h',
 	'rte_memcpy.h',
 	'rte_prefetch.h',
+	'rte_pause.h',
 	'rte_rtm.h',
 	'rte_rwlock.h',
 	'rte_spinlock.h',
lib/librte_eal/linuxapp/eal/meson.build +2 -1
index 30741519b..886bcbf0e 100644
@@ -63,7 +63,8 @@ eal_lib = library('rte_eal', sources, eal_common_sources, eal_common_arch_source
 			install: true
 )
 
-dpdk_libraries += [eal_lib, '-pthread', eal_extra_link_arg]
+dpdk_libraries += eal_lib
+dpdk_extra_ldflags += ['-pthread', eal_extra_link_arg]
 
 rte_eal = declare_dependency(link_with: eal_lib,
 		include_directories: eal_inc,
meson.build +3 -1
index dfcead92a..ca495ec7e 100644
@@ -41,6 +41,7 @@ cc = meson.get_compiler('c')
 dpdk_conf = configuration_data()
 dpdk_libraries = []
 dpdk_drivers = []
+dpdk_extra_ldflags = []
 
 # for static libs, treat the drivers as regular libraries, otherwise
 # for shared libs, put them in a driver folder
@@ -74,7 +75,8 @@ configure_file(output: build_cfg,
 # for static builds, include the drivers as libs, and also any
 # other dependent libs that DPDK needs to link against
 if get_option('default_library') == 'static'
-	dpdk_libraries = dpdk_drivers + dpdk_libraries
+	dpdk_drivers = ['-Wl,--whole-archive'] + dpdk_drivers + ['-Wl,--no-whole-archive']
+	dpdk_libraries = dpdk_drivers + dpdk_libraries + dpdk_extra_ldflags
 endif
 
 pkg = import('pkgconfig')
Signature · 1 line
2.13.4
#40 lore raw

RFC v2 40/40 examples: allow basic sample app build using pkg-config

In reply to Bruce Richardson
---
 examples/helloworld/Makefile | 13 +++++++++++++
 examples/l2fwd/Makefile      | 13 +++++++++++++
 2 files changed, 26 insertions(+)
examples/helloworld/Makefile +13 -0
index c83ec01e8..270f02f91 100644
@@ -29,6 +29,17 @@
 #   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 #   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
+ifeq ($(shell pkg-config --exists DPDK || echo 1),)
+# we have pkg-config install DPDK
+
+CFLAGS += $(shell pkg-config --cflags DPDK)
+LDFLAGS += $(shell pkg-config --libs DPDK)
+
+helloworld: main.o
+	$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS)
+
+else # legacy build system
+
 ifeq ($(RTE_SDK),)
 $(error "Please define RTE_SDK environment variable")
 endif
@@ -48,3 +59,5 @@ CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
 
 include $(RTE_SDK)/mk/rte.extapp.mk
+
+endif
examples/l2fwd/Makefile +13 -0
index 8896ab452..d631c7d35 100644
@@ -29,6 +29,17 @@
 #   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 #   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
+ifeq ($(shell pkg-config --exists DPDK || echo 1),)
+# we have pkg-config install DPDK
+
+CFLAGS += $(shell pkg-config --cflags DPDK)
+LDFLAGS += $(shell pkg-config --libs DPDK)
+
+l2fwd: main.o
+	$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS)
+
+else # legacy build system
+
 ifeq ($(RTE_SDK),)
 $(error "Please define RTE_SDK environment variable")
 endif
@@ -48,3 +59,5 @@ CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
 
 include $(RTE_SDK)/mk/rte.extapp.mk
+
+endif
Signature · 1 line
2.13.4
#41 lore raw
In reply to Bruce Richardson
Quoted 68 lines · Bruce Richardson

Following on from previous RFC [http://dpdk.org/dev/patchwork/patch/2
5104/]
here is a second draft implementation for building DPDK with meson and
ninja. While still not building all of DPDK, and needing patch cleanup so
that patches don't overwrite previous work, it is more complete in many
ways than the previous version and includes:

* dynamic build configuration e.g. building pcap driver only if pcap is
  found, only build af_packet if the target is linux, and only building QAT
  and openssl crypto drivers if libcrypto is found
* support for pmdinfo inside the PMDs(for shared builds) and binaries (for
  static builds)
* generalized/standardized way of building libs and drivers, though the
  drivers code still needs generalization at the driver, rather than driver-class level.
* support for having a pkgconfig file for DPDK on install, and helloworld
  and l2fwd can be built using the pkgconfig info (via make, not ninja)
* support for library versions
* an implementation for FreeBSD as well as Linux
* all libraries are included in the build, as well as a number of NIC,
  crypto, and mempool drivers
* the igb_uio kernel module is build via the kernel Kbuild system as part
  of a meson/ninja DPDK build

there is still plenty to do on this, but please review and test it out.
I've kept the patches split so that the evolution of the work is a bit
clearer than having it all send in a monolithic patch. All feedback welcome. I recommend one uses the latest meson release for this, though the
minimum version supported should be v0.4.

I've tested static and dynamic builds with clang and gcc on Fedora 26, and
done test builds on FreeBSD 11 with clang too. Build with other compilers
and on other OS's may have issues, so YMMV.

To do a basic build, using gcc and with shared libs, in a folder called "gcc-build":

	user@host:dpdk$ meson gcc-build
	....
	user@host:dpdk$ cd gcc-build
	user@host:gcc-build$ ninja
	user@host:gcc-build$ sudo ninja install

To do a build with clang, using static libs:

	user@host:dpdk$ CC=clang meson --default_library=static clang-
build
	....
	user@host:dpdk$ cd clang-build
	user@host:clang-build$ ninja
	user@host:clang-build$ sudo ninja install
Quoted 2 lines

Other options can be adjusted by running "mesonconf" in the build directory, i.e. gcc-build or clang-build in the examples above.

Hi Bruce,

This is great, thank you!

I'll try to give this set a run in the Debian context as soon as I have time.

It's also great to see a pkg-config file!

I haven't gone through the diff yet, but do you think it would be possible, now or later on, to add the option to install architecture- specific headers in a different directory than the arch-independent ones?

This is in the context of multi-arch: on Debian and Ubuntu there's a lot of effort to make sure libraries built on different architectures are co-installable. Which means either the files must be identical, or in arch-specific paths (eg: /usr/include/x86_64-linux-gnu/ and /usr/lib/x86_64-linux-gnu/).

Signature · 2 lines
Kind regards,
Luca Boccassi
#42 lore raw
Quoted 72 lines · Luca Boccassi
Quoted 68 lines · Bruce Richardson

Following on from previous RFC [http://dpdk.org/dev/patchwork/patch/2
5104/]
here is a second draft implementation for building DPDK with meson and
ninja. While still not building all of DPDK, and needing patch cleanup so
that patches don't overwrite previous work, it is more complete in many
ways than the previous version and includes:

* dynamic build configuration e.g. building pcap driver only if pcap is
  found, only build af_packet if the target is linux, and only building QAT
  and openssl crypto drivers if libcrypto is found
* support for pmdinfo inside the PMDs(for shared builds) and binaries (for
  static builds)
* generalized/standardized way of building libs and drivers, though the
  drivers code still needs generalization at the driver, rather than driver-class level.
* support for having a pkgconfig file for DPDK on install, and helloworld
  and l2fwd can be built using the pkgconfig info (via make, not ninja)
* support for library versions
* an implementation for FreeBSD as well as Linux
* all libraries are included in the build, as well as a number of NIC,
  crypto, and mempool drivers
* the igb_uio kernel module is build via the kernel Kbuild system as part
  of a meson/ninja DPDK build

there is still plenty to do on this, but please review and test it out.
I've kept the patches split so that the evolution of the work is a bit
clearer than having it all send in a monolithic patch. All feedback welcome. I recommend one uses the latest meson release for this, though the
minimum version supported should be v0.4.

I've tested static and dynamic builds with clang and gcc on Fedora 26, and
done test builds on FreeBSD 11 with clang too. Build with other compilers
and on other OS's may have issues, so YMMV.

To do a basic build, using gcc and with shared libs, in a folder called "gcc-build":

	user@host:dpdk$ meson gcc-build
	....
	user@host:dpdk$ cd gcc-build
	user@host:gcc-build$ ninja
	user@host:gcc-build$ sudo ninja install

To do a build with clang, using static libs:

	user@host:dpdk$ CC=clang meson --default_library=static clang-
build
	....
	user@host:dpdk$ cd clang-build
	user@host:clang-build$ ninja
	user@host:clang-build$ sudo ninja install
Quoted 2 lines

Other options can be adjusted by running "mesonconf" in the build directory, i.e. gcc-build or clang-build in the examples above.

Quoted 7 lines

Hi Bruce,

This is great, thank you!

I'll try to give this set a run in the Debian context as soon as I have time.

Please do, thanks. Let me know any issues you hit, or further suggestions for improvement. Please also check the reproducible build aspects, as I may have let some absolute paths sneek in some places inadvertently, while getting the more awkward stuff (like pmdinfo) ported over.

Quoted 2 lines

It's also great to see a pkg-config file!

I'm not sure what others think, but I believe we need to move away from any requirement for external apps, or even our examples, to have a particular way of being built. Instead, everything should be done through the pkg-config, where possible.

Quoted 5 lines

I haven't gone through the diff yet, but do you think it would be possible, now or later on, to add the option to install architecture- specific headers in a different directory than the arch-independent ones?

I'm sure it's possible, it's just a matter of how awkward it would be. :-)

Quoted 9 lines

This is in the context of multi-arch: on Debian and Ubuntu there's a lot of effort to make sure libraries built on different architectures are co-installable. Which means either the files must be identical, or in arch-specific paths (eg: /usr/include/x86_64-linux-gnu/ and /usr/lib/x86_64-linux-gnu/).

Signature · 2 lines
Kind regards,
Luca Boccassi
#43 lore raw
In reply to Bruce Richardson

Hi Bruce,

Quoted 6 lines · Bruce Richardson

Following on from previous RFC [http://dpdk.org/dev/patchwork/patch/25104/]
here is a second draft implementation for building DPDK with meson and ninja. While still not building all of DPDK, and needing patch cleanup so that patches don't overwrite previous work, it is more complete in many ways than the previous version and includes:

Quoted 16 lines

* dynamic build configuration e.g. building pcap driver only if pcap is found, only build af_packet if the target is linux, and only building QAT and openssl crypto drivers if libcrypto is found
* support for pmdinfo inside the PMDs(for shared builds) and binaries (for static builds)
* generalized/standardized way of building libs and drivers, though the drivers code still needs generalization at the driver, rather than driver-class level.
* support for having a pkgconfig file for DPDK on install, and helloworld and l2fwd can be built using the pkgconfig info (via make, not ninja)
* support for library versions
* an implementation for FreeBSD as well as Linux
* all libraries are included in the build, as well as a number of NIC, crypto, and mempool drivers
* the igb_uio kernel module is build via the kernel Kbuild system as part of a meson/ninja DPDK build

This is really great to see. I do have one suggestion.
Would it be possible to version the libraries built by the build-system following the same version of the DPDK release?

For instance, in DPDK 17.08 we currently have:

# objdump -p librte_pmd_ixgbe.so.1 |grep SONAME
  SONAME               librte_pmd_ixgbe.so.1

Would it make sense to instead have librte_pmd_ixgbe.so.17.08

I think it would help to facilitate the installation of multiple DPDK library versions on the same system.

For example, we could have the following scenario:

1) OpenVSwithc linked with version 17.02 of DPDK
2) VPP linked with version 17.08 of DPDK
3) DPDK 18.xx installed in the system for any cutting-edge application prototyping.

Is this something which could be incorporated as part of this work?

Quoted 10 lines

there is still plenty to do on this, but please review and test it out. I've kept the patches split so that the evolution of the work is a bit clearer than having it all send in a monolithic patch. All feedback welcome. I recommend one uses the latest meson release for this, though the minimum version supported should be v0.4.

I've tested static and dynamic builds with clang and gcc on Fedora 26, and done test builds on FreeBSD 11 with clang too. Build with other compilers and on other OS's may have issues, so YMMV.

I'll give it a try on openSUSE and let you know of any issues I might face.

Cheers,
Marco

Quoted 228 lines

To do a basic build, using gcc and with shared libs, in a folder called "gcc- build":

	user@host:dpdk$ meson gcc-build
	....
	user@host:dpdk$ cd gcc-build
	user@host:gcc-build$ ninja
	user@host:gcc-build$ sudo ninja install

To do a build with clang, using static libs:

	user@host:dpdk$ CC=clang meson --default_library=static clang-build
	....
	user@host:dpdk$ cd clang-build
	user@host:clang-build$ ninja
	user@host:clang-build$ sudo ninja install

Other options can be adjusted by running "mesonconf" in the build directory, i.e. gcc-build or clang-build in the examples above.

Bruce Richardson (40):
  build: initial hooks for using meson with DPDK
  build: create pkg-config file for DPDK
  build: build linuxapp EAL with meson and ninja
  build: add EAL support under BSD
  build: add core libraries to meson build system
  build: add i40e driver to meson build
  build: add pmdinfogen to build
  build: generate list of sources for pmdinfogen
  build: build i40e driver, including pmdinfo
  build: install usertools scripts
  build: simplify generation of pmd.c files
  build: generalize net driver build to higher level
  build: remove hard-coded enablement of vector driver
  build: add ixgbe driver to build
  build: set up standard deps for drivers
  build: add af_packet driver to build
  build: add pcap PMD support
  build: add symbol version map file support to libs
  build: build libraries in a loop for brevity
  build: version library .so files
  eal: add version information to meson build
  build: add mempool drivers to build
  build: add gro library to meson build
  build: tweak naming of pmd dependencies
  build: track driver include directories properly
  metrics: add metrics lib to meson build
  build: track dependencies recursively
  testpmd: compile testpmd with meson and ninja crypto/null: rename the version file to standard crypto/qat: remove dependency on ether library
  build: add cryptodev and some crypto drivers to build
  igb_uio: add igb_uio to meson build
  ip_frag: rename version file to standard name
  build: add most remaining libraries to meson build
  build: add packet framework libs to meson build
  acl: add acl library to meson build
  build: add ark and avp PMDs to build
  build: fix static library builds with base code
  build: fix driver dependencies for static builds
  examples: allow basic sample app build using pkg-config

 app/meson.build                                    |  32 ++++++ app/test-pmd/meson.build                           |  74 +++++++++++++ buildtools/gen-pmdinfo-cfile.sh                    |  41 ++++++++ buildtools/meson.build                             |  34 ++++++ buildtools/pmdinfogen/meson.build                  |  43 ++++++++ config/meson.build                                 |  69 +++++++++++++ config/rte_config.h                                | 114
+++++++++++++++++++++
 config/x86/meson.build                             |  70 +++++++++++++ drivers/crypto/meson.build                         | 108 +++++++++++++++++++ drivers/crypto/null/Makefile                       |   2 +- drivers/crypto/null/meson.build                    |  32 ++++++ ...crypto_version.map => rte_pmd_null_version.map} |   0 drivers/crypto/openssl/meson.build                 |  38 +++++++ drivers/crypto/qat/meson.build                     |  41 ++++++++ drivers/crypto/qat/qat_crypto.c                    |   1 - drivers/mempool/meson.build                        | 108 +++++++++++++++++++ drivers/mempool/ring/meson.build                   |  32 ++++++ drivers/mempool/stack/meson.build                  |  32 ++++++ drivers/meson.build                                |  34 ++++++ drivers/net/af_packet/meson.build                  |  35 +++++++ drivers/net/ark/meson.build                        |  45 ++++++++ drivers/net/avp/meson.build                        |  34 ++++++ drivers/net/i40e/base/meson.build                  |  56 ++++++++++ drivers/net/i40e/meson.build                       |  61 +++++++++++ drivers/net/ixgbe/base/meson.build                 |  60 +++++++++++ drivers/net/ixgbe/meson.build                      |  58 +++++++++++ drivers/net/meson.build                            | 108 +++++++++++++++++++ drivers/net/pcap/meson.build                       |  41 ++++++++ examples/helloworld/Makefile                       |  13 +++ examples/l2fwd/Makefile                            |  13 +++ lib/librte_acl/meson.build                         |  60 +++++++++++ lib/librte_bitratestats/meson.build                |  34 ++++++ lib/librte_cfgfile/meson.build                     |  35 +++++++ lib/librte_cmdline/meson.build                     |  57 +++++++++++ lib/librte_compat/meson.build                      |  36 +++++++ lib/librte_cryptodev/meson.build                   |  40 ++++++++ lib/librte_distributor/meson.build                 |  39 +++++++ lib/librte_eal/bsdapp/eal/meson.build              |  67 ++++++++++++ lib/librte_eal/bsdapp/meson.build                  |  32 ++++++ lib/librte_eal/common/arch/meson.build             |  33 ++++++ lib/librte_eal/common/arch/x86/meson.build         |  32 ++++++ lib/librte_eal/common/include/arch/meson.build     |  33 ++++++ lib/librte_eal/common/include/arch/x86/meson.build |  48 +++++++++ lib/librte_eal/common/include/meson.build          |  71 +++++++++++++ lib/librte_eal/common/meson.build                  |  71 +++++++++++++ lib/librte_eal/linuxapp/eal/meson.build            |  72 +++++++++++++ lib/librte_eal/linuxapp/igb_uio/Kbuild             |   1 + lib/librte_eal/linuxapp/igb_uio/meson.build        |  47 +++++++++ lib/librte_eal/linuxapp/meson.build                |  42 ++++++++ lib/librte_eal/meson.build                         |  44 ++++++++ lib/librte_efd/meson.build                         |  34 ++++++ lib/librte_ether/meson.build                       |  46 +++++++++ lib/librte_eventdev/meson.build                    |  36 +++++++ lib/librte_gro/meson.build                         |  34 ++++++ lib/librte_hash/meson.build                        |  46 +++++++++ lib/librte_ip_frag/Makefile                        |   2 +- lib/librte_ip_frag/meson.build                     |  39 +++++++ ..._ipfrag_version.map => rte_ip_frag_version.map} |   0 lib/librte_jobstats/meson.build                    |  34 ++++++ lib/librte_kni/meson.build                         |  35 +++++++ lib/librte_kvargs/meson.build                      |  35 +++++++ lib/librte_latencystats/meson.build                |  34 ++++++ lib/librte_lpm/meson.build                         |  35 +++++++ lib/librte_mbuf/meson.build                        |  36 +++++++ lib/librte_mempool/meson.build                     |  35 +++++++ lib/librte_meter/meson.build                       |  34 ++++++ lib/librte_metrics/meson.build                     |  34 ++++++ lib/librte_net/meson.build                         |  46 +++++++++ lib/librte_pdump/meson.build                       |  34 ++++++ lib/librte_pipeline/meson.build                    |  35 +++++++ lib/librte_port/meson.build                        |  58 +++++++++++ lib/librte_power/meson.build                       |  35 +++++++ lib/librte_reorder/meson.build                     |  34 ++++++ lib/librte_ring/meson.build                        |  34 ++++++

 lib/librte_sched/meson.build                       |  36 +++++++
 lib/librte_table/meson.build                       |  52 ++++++++++
 lib/librte_timer/meson.build                       |  34 ++++++
 lib/librte_vhost/meson.build                       |  36 +++++++

 lib/meson.build                                    | 105 +++++++++++++++++++ meson.build                                        |  88 ++++++++++++++++ meson_options.txt                                  |   8 ++ usertools/meson.build                              |  32 ++++++

 82 files changed, 3536 insertions(+), 3 deletions(-)

 create mode 100644 app/meson.build
 create mode 100644 app/test-pmd/meson.build
 create mode 100755 buildtools/gen-pmdinfo-cfile.sh
 create mode 100644 buildtools/meson.build
 create mode 100644 buildtools/pmdinfogen/meson.build
 create mode 100644 config/meson.build
 create mode 100644 config/rte_config.h
 create mode 100644 config/x86/meson.build
 create mode 100644 drivers/crypto/meson.build
 create mode 100644 drivers/crypto/null/meson.build
 rename drivers/crypto/null/{rte_pmd_null_crypto_version.map => rte_pmd_null_version.map} (100%)
 create mode 100644 drivers/crypto/openssl/meson.build
 create mode 100644 drivers/crypto/qat/meson.build
 create mode 100644 drivers/mempool/meson.build
 create mode 100644 drivers/mempool/ring/meson.build
 create mode 100644 drivers/mempool/stack/meson.build
 create mode 100644 drivers/meson.build
 create mode 100644 drivers/net/af_packet/meson.build
 create mode 100644 drivers/net/ark/meson.build
 create mode 100644 drivers/net/avp/meson.build
 create mode 100644 drivers/net/i40e/base/meson.build
 create mode 100644 drivers/net/i40e/meson.build
 create mode 100644 drivers/net/ixgbe/base/meson.build
 create mode 100644 drivers/net/ixgbe/meson.build
 create mode 100644 drivers/net/meson.build
 create mode 100644 drivers/net/pcap/meson.build
 create mode 100644 lib/librte_acl/meson.build
 create mode 100644 lib/librte_bitratestats/meson.build
 create mode 100644 lib/librte_cfgfile/meson.build
 create mode 100644 lib/librte_cmdline/meson.build
 create mode 100644 lib/librte_compat/meson.build
 create mode 100644 lib/librte_cryptodev/meson.build
 create mode 100644 lib/librte_distributor/meson.build
 create mode 100644 lib/librte_eal/bsdapp/eal/meson.build
 create mode 100644 lib/librte_eal/bsdapp/meson.build
 create mode 100644 lib/librte_eal/common/arch/meson.build
 create mode 100644 lib/librte_eal/common/arch/x86/meson.build create mode 100644 lib/librte_eal/common/include/arch/meson.build create mode 100644 lib/librte_eal/common/include/arch/x86/meson.build create mode 100644 lib/librte_eal/common/include/meson.build create mode 100644 lib/librte_eal/common/meson.build
 create mode 100644 lib/librte_eal/linuxapp/eal/meson.build create mode 100644 lib/librte_eal/linuxapp/igb_uio/Kbuild
 create mode 100644 lib/librte_eal/linuxapp/igb_uio/meson.build create mode 100644 lib/librte_eal/linuxapp/meson.build
 create mode 100644 lib/librte_eal/meson.build
 create mode 100644 lib/librte_efd/meson.build
 create mode 100644 lib/librte_ether/meson.build
 create mode 100644 lib/librte_eventdev/meson.build
 create mode 100644 lib/librte_gro/meson.build
 create mode 100644 lib/librte_hash/meson.build
 create mode 100644 lib/librte_ip_frag/meson.build
 rename lib/librte_ip_frag/{rte_ipfrag_version.map => rte_ip_frag_version.map} (100%)
 create mode 100644 lib/librte_jobstats/meson.build
 create mode 100644 lib/librte_kni/meson.build
 create mode 100644 lib/librte_kvargs/meson.build
 create mode 100644 lib/librte_latencystats/meson.build
 create mode 100644 lib/librte_lpm/meson.build
 create mode 100644 lib/librte_mbuf/meson.build
 create mode 100644 lib/librte_mempool/meson.build
 create mode 100644 lib/librte_meter/meson.build
 create mode 100644 lib/librte_metrics/meson.build
 create mode 100644 lib/librte_net/meson.build
 create mode 100644 lib/librte_pdump/meson.build
 create mode 100644 lib/librte_pipeline/meson.build
 create mode 100644 lib/librte_port/meson.build
 create mode 100644 lib/librte_power/meson.build
 create mode 100644 lib/librte_reorder/meson.build
 create mode 100644 lib/librte_ring/meson.build
 create mode 100644 lib/librte_sched/meson.build
 create mode 100644 lib/librte_table/meson.build
 create mode 100644 lib/librte_timer/meson.build
 create mode 100644 lib/librte_vhost/meson.build
 create mode 100644 lib/meson.build
 create mode 100644 meson.build
 create mode 100644 meson_options.txt
 create mode 100644 usertools/meson.build

#44 lore raw
Quoted 56 lines · Marco Varlese

Hi Bruce,

Quoted 27 lines · Bruce Richardson

Following on from previous RFC [http://dpdk.org/dev/patchwork/patch
/25104/]
here is a second draft implementation for building DPDK with meson and
ninja. While still not building all of DPDK, and needing patch cleanup so
that patches don't overwrite previous work, it is more complete in many
ways than the previous version and includes:

* dynamic build configuration e.g. building pcap driver only if pcap is
  found, only build af_packet if the target is linux, and only building QAT
  and openssl crypto drivers if libcrypto is found
* support for pmdinfo inside the PMDs(for shared builds) and binaries (for
  static builds)
* generalized/standardized way of building libs and drivers, though the
  drivers code still needs generalization at the driver, rather than
  driver-class level.
* support for having a pkgconfig file for DPDK on install, and helloworld
  and l2fwd can be built using the pkgconfig info (via make, not ninja)

Quoted 8 lines

* support for library versions
* an implementation for FreeBSD as well as Linux
* all libraries are included in the build, as well as a number of NIC,
  crypto, and mempool drivers
* the igb_uio kernel module is build via the kernel Kbuild system as part
  of a meson/ninja DPDK build

This is really great to see. I do have one suggestion. Would it be possible to version the libraries built by the build- system
following the same version of the DPDK release?

For instance, in DPDK 17.08 we currently have:

# objdump -p librte_pmd_ixgbe.so.1 |grep SONAME
  SONAME               librte_pmd_ixgbe.so.1

Would it make sense to instead have librte_pmd_ixgbe.so.17.08

I think it would help to facilitate the installation of multiple DPDK library
versions on the same system.

For example, we could have the following scenario:

Quoted 7 lines

1) OpenVSwithc linked with version 17.02 of DPDK
2) VPP linked with version 17.08 of DPDK
3) DPDK 18.xx installed in the system for any cutting-edge application
prototyping.

Is this something which could be incorporated as part of this work?

Christian sent a patch a while ago, which was merged, to enable this in the current build system, it's the CONFIG_RTE_MAJOR_ABI option, we use it in Debian and Ubuntu for the reasons you mentioned.

And if it's not been translated yet, I agree it's an important one.

Signature · 2 lines
Kind regards,
Luca Boccassi
#45 lore raw
Quoted 63 lines · Luca Boccassi
Quoted 62 lines · Marco Varlese

Hi Bruce,

Quoted 27 lines · Bruce Richardson

Following on from previous RFC [http://dpdk.org/dev/patchwork/patch
/25104/]
here is a second draft implementation for building DPDK with meson and
ninja. While still not building all of DPDK, and needing patch cleanup so
that patches don't overwrite previous work, it is more complete in many
ways than the previous version and includes:

* dynamic build configuration e.g. building pcap driver only if pcap is
  found, only build af_packet if the target is linux, and only building QAT
  and openssl crypto drivers if libcrypto is found
* support for pmdinfo inside the PMDs(for shared builds) and binaries (for
  static builds)
* generalized/standardized way of building libs and drivers, though the
  drivers code still needs generalization at the driver, rather than
  driver-class level.
* support for having a pkgconfig file for DPDK on install, and helloworld
  and l2fwd can be built using the pkgconfig info (via make, not ninja)

Quoted 8 lines

* support for library versions
* an implementation for FreeBSD as well as Linux
* all libraries are included in the build, as well as a number of NIC,
  crypto, and mempool drivers
* the igb_uio kernel module is build via the kernel Kbuild system as part
  of a meson/ninja DPDK build

This is really great to see. I do have one suggestion. Would it be possible to version the libraries built by the build- system
following the same version of the DPDK release?

For instance, in DPDK 17.08 we currently have:

# objdump -p librte_pmd_ixgbe.so.1 |grep SONAME
  SONAME               librte_pmd_ixgbe.so.1

Would it make sense to instead have librte_pmd_ixgbe.so.17.08

I think it would help to facilitate the installation of multiple DPDK library
versions on the same system.

For example, we could have the following scenario:

1) OpenVSwithc linked with version 17.02 of DPDK
2) VPP linked with version 17.08 of DPDK
3) DPDK 18.xx installed in the system for any cutting-edge application
prototyping.

Quoted 8 lines
Quoted 1 line

Is this something which could be incorporated as part of this work?

Christian sent a patch a while ago, which was merged, to enable this in the current build system, it's the CONFIG_RTE_MAJOR_ABI option, we use it in Debian and Ubuntu for the reasons you mentioned.

And if it's not been translated yet, I agree it's an important one.

No, it's not translated yet - mainly for the reasons that I had forgotten it existed, and that there is a lot yet unported.

General question: should this be the default or not? It looks to me that it should probably be, but what do others think?

/Bruce

#46 lore raw
Quoted 73 lines · Bruce Richardson
Quoted 72 lines · Luca Boccassi
Quoted 58 lines · Marco Varlese

Hi Bruce,

Quoted 28 lines · Bruce Richardson

Following on from previous RFC [http://dpdk.org/dev/patchwork/patch
/25104/]
here is a second draft implementation for building DPDK with meson and
ninja. While still not building all of DPDK, and needing patch cleanup so
that patches don't overwrite previous work, it is more complete in many
ways than the previous version and includes:

* dynamic build configuration e.g. building pcap driver only if pcap is
  found, only build af_packet if the target is linux, and only building QAT
  and openssl crypto drivers if libcrypto is found
* support for pmdinfo inside the PMDs(for shared builds) and binaries (for
  static builds)
* generalized/standardized way of building libs and drivers, though the
  drivers code still needs generalization at the driver, rather than
  driver-class level.
* support for having a pkgconfig file for DPDK on install, and helloworld
  and l2fwd can be built using the pkgconfig info (via make, not ninja)

Quoted 8 lines

* support for library versions
* an implementation for FreeBSD as well as Linux
* all libraries are included in the build, as well as a number of NIC,
  crypto, and mempool drivers
* the igb_uio kernel module is build via the kernel Kbuild system as part
  of a meson/ninja DPDK build

This is really great to see. I do have one suggestion. Would it be possible to version the libraries built by the build- system
following the same version of the DPDK release?

For instance, in DPDK 17.08 we currently have:

# objdump -p librte_pmd_ixgbe.so.1 |grep SONAME
  SONAME               librte_pmd_ixgbe.so.1

Would it make sense to instead have librte_pmd_ixgbe.so.17.08

I think it would help to facilitate the installation of multiple DPDK library
versions on the same system.

For example, we could have the following scenario:

Quoted 7 lines

1) OpenVSwithc linked with version 17.02 of DPDK
2) VPP linked with version 17.08 of DPDK
3) DPDK 18.xx installed in the system for any cutting-edge application
prototyping.

Is this something which could be incorporated as part of this work?

Christian sent a patch a while ago, which was merged, to enable this in the current build system, it's the CONFIG_RTE_MAJOR_ABI option, we use it in Debian and Ubuntu for the reasons you mentioned.

Quoted 7 lines
Quoted 2 lines

And if it's not been translated yet, I agree it's an important one.

No, it's not translated yet - mainly for the reasons that I had forgotten it existed, and that there is a lot yet unported.

General question: should this be the default or not? It looks to me that it should probably be, but what do others think?

I do think it should be the default too.

Quoted 3 lines

/Bruce

#47 lore raw
Quoted 78 lines · Marco Varlese
Quoted 77 lines · Bruce Richardson
Quoted 75 lines · Luca Boccassi
Quoted 60 lines · Marco Varlese

Hi Bruce,

Quoted 29 lines · Bruce Richardson

Following on from previous RFC [http://dpdk.org/dev/patchwork/patch
/25104/]
here is a second draft implementation for building DPDK with meson and
ninja. While still not building all of DPDK, and needing patch cleanup so
that patches don't overwrite previous work, it is more complete in many
ways than the previous version and includes:

* dynamic build configuration e.g. building pcap driver only if pcap is
  found, only build af_packet if the target is linux, and only building QAT
  and openssl crypto drivers if libcrypto is found
* support for pmdinfo inside the PMDs(for shared builds) and binaries (for
  static builds)
* generalized/standardized way of building libs and drivers, though the
  drivers code still needs generalization at the driver, rather than
  driver-class level.
* support for having a pkgconfig file for DPDK on install, and helloworld
  and l2fwd can be built using the pkgconfig info (via make, not ninja)

Quoted 8 lines

* support for library versions
* an implementation for FreeBSD as well as Linux
* all libraries are included in the build, as well as a number of NIC,
  crypto, and mempool drivers
* the igb_uio kernel module is build via the kernel Kbuild system as part
  of a meson/ninja DPDK build

This is really great to see. I do have one suggestion. Would it be possible to version the libraries built by the build- system
following the same version of the DPDK release?

For instance, in DPDK 17.08 we currently have:

# objdump -p librte_pmd_ixgbe.so.1 |grep SONAME
  SONAME               librte_pmd_ixgbe.so.1

Would it make sense to instead have librte_pmd_ixgbe.so.17.08

I think it would help to facilitate the installation of multiple DPDK library
versions on the same system.

For example, we could have the following scenario:

Quoted 7 lines

1) OpenVSwithc linked with version 17.02 of DPDK
2) VPP linked with version 17.08 of DPDK
3) DPDK 18.xx installed in the system for any cutting-edge application
prototyping.

Is this something which could be incorporated as part of this work?

Christian sent a patch a while ago, which was merged, to enable this in the current build system, it's the CONFIG_RTE_MAJOR_ABI option, we use it in Debian and Ubuntu for the reasons you mentioned.

Quoted 8 lines
Quoted 7 lines
Quoted 2 lines

And if it's not been translated yet, I agree it's an important one.

No, it's not translated yet - mainly for the reasons that I had forgotten it existed, and that there is a lot yet unported.

General question: should this be the default or not? It looks to me that it should probably be, but what do others think?

I do think it should be the default too.

And - since you're at it - it would be a good idea to add the versioning to the built executables (e.g. test_pmd) similarly to what other software (e.g. gcc) do to make sure you can also have cohexistance of executables. Otherwise, dpdk executables would be overwritten with subsequent installations. Does it make sense?

Quoted 6 lines
Quoted 5 lines

/Bruce

#48 lore raw
In reply to Bruce Richardson
Quoted 88 lines · Bruce Richardson
Quoted 74 lines · Luca Boccassi
Quoted 64 lines · Marco Varlese

Hi Bruce,

Quoted 34 lines · Bruce Richardson

Following on from previous RFC [http://dpdk.org/dev/patchwork/p
atch
/25104/]
here is a second draft implementation for building DPDK with meson
and
ninja. While still not building all of DPDK, and needing patch cleanup so
that patches don't overwrite previous work, it is more complete in
many
ways than the previous version and includes:

* dynamic build configuration e.g. building pcap driver only if pcap is
  found, only build af_packet if the target is linux, and only building QAT
  and openssl crypto drivers if libcrypto is found
* support for pmdinfo inside the PMDs(for shared builds) and binaries (for
  static builds)
* generalized/standardized way of building libs and drivers, though
the
  drivers code still needs generalization at the driver, rather than
  driver-class level.
* support for having a pkgconfig file for DPDK on install, and helloworld
  and l2fwd can be built using the pkgconfig info (via make, not
ninja)
* support for library versions
* an implementation for FreeBSD as well as Linux

Quoted 8 lines

* all libraries are included in the build, as well as a number of
NIC,
  crypto, and mempool drivers
* the igb_uio kernel module is build via the kernel Kbuild system
as part
  of a meson/ninja DPDK build

This is really great to see. I do have one suggestion. Would it be possible to version the libraries built by the build- system
following the same version of the DPDK release?

For instance, in DPDK 17.08 we currently have:

# objdump -p librte_pmd_ixgbe.so.1 |grep SONAME
  SONAME               librte_pmd_ixgbe.so.1

Would it make sense to instead have librte_pmd_ixgbe.so.17.08

I think it would help to facilitate the installation of multiple DPDK
library
versions on the same system.

For example, we could have the following scenario:

Quoted 8 lines

1) OpenVSwithc linked with version 17.02 of DPDK
2) VPP linked with version 17.08 of DPDK
3) DPDK 18.xx installed in the system for any cutting-edge application
prototyping.

Is this something which could be incorporated as part of this work?

Quoted 8 lines

Christian sent a patch a while ago, which was merged, to enable this in
the current build system, it's the CONFIG_RTE_MAJOR_ABI option, we use
it in Debian and Ubuntu for the reasons you mentioned.

And if it's not been translated yet, I agree it's an important one.

No, it's not translated yet - mainly for the reasons that I had forgotten
it existed, and that there is a lot yet unported.

Quoted 5 lines

General question: should this be the default or not? It looks to me that
it should probably be, but what do others think?

/Bruce

Well, to maintain backward compatibility, you might not want to have it on by default - it's the equivalent of declaring all ABIs compatibility broken on all releases, some users might not like that.

For us distro maintainers it's very easy to enable.

But I don't have a strong opinion either way - just thinking about consequences for others.

Signature · 2 lines
Kind regards,
Luca Boccassi

A message that is not in the archive (sent off-list or not yet received): [email protected]

#50 lore raw

Hi Luca,

Quoted 65 lines · Luca Boccassi
Quoted 64 lines · Marco Varlese

Hi Bruce,

Quoted 28 lines · Bruce Richardson

Following on from previous RFC [http://dpdk.org/dev/patchwork/patch
/25104/]
here is a second draft implementation for building DPDK with meson and
ninja. While still not building all of DPDK, and needing patch cleanup so
that patches don't overwrite previous work, it is more complete in many
ways than the previous version and includes:

* dynamic build configuration e.g. building pcap driver only if pcap is
  found, only build af_packet if the target is linux, and only building QAT
  and openssl crypto drivers if libcrypto is found
* support for pmdinfo inside the PMDs(for shared builds) and binaries (for
  static builds)
* generalized/standardized way of building libs and drivers, though the
  drivers code still needs generalization at the driver, rather than
  driver-class level.
* support for having a pkgconfig file for DPDK on install, and helloworld
  and l2fwd can be built using the pkgconfig info (via make, not ninja)

Quoted 8 lines

* support for library versions
* an implementation for FreeBSD as well as Linux
* all libraries are included in the build, as well as a number of NIC,
  crypto, and mempool drivers
* the igb_uio kernel module is build via the kernel Kbuild system as part
  of a meson/ninja DPDK build

This is really great to see. I do have one suggestion. Would it be possible to version the libraries built by the build- system
following the same version of the DPDK release?

For instance, in DPDK 17.08 we currently have:

# objdump -p librte_pmd_ixgbe.so.1 |grep SONAME
  SONAME               librte_pmd_ixgbe.so.1

Would it make sense to instead have librte_pmd_ixgbe.so.17.08

I think it would help to facilitate the installation of multiple DPDK library
versions on the same system.

For example, we could have the following scenario:

1) OpenVSwithc linked with version 17.02 of DPDK
2) VPP linked with version 17.08 of DPDK
3) DPDK 18.xx installed in the system for any cutting-edge application
prototyping.

Quoted 5 lines
Quoted 1 line

Is this something which could be incorporated as part of this work?

Christian sent a patch a while ago, which was merged, to enable this in the current build system, it's the CONFIG_RTE_MAJOR_ABI option, we use it in Debian and Ubuntu for the reasons you mentioned.

Thanks for your input, very much appreciated.
I'll give it a try right away.

Quoted 281 lines

And if it's not been translated yet, I agree it's an important one.

Quoted 277 lines
Quoted 11 lines

there is still plenty to do on this, but please review and test it out.
I've kept the patches split so that the evolution of the work is a bit
clearer than having it all send in a monolithic patch. All feedback welcome. I recommend one uses the latest meson release for this, though the
minimum version supported should be v0.4.

Quoted 5 lines

I've tested static and dynamic builds with clang and gcc on Fedora 26, and
done test builds on FreeBSD 11 with clang too. Build with other compilers
and on other OS's may have issues, so YMMV.

I'll give it a try on openSUSE and let you know of any issues I might face.

Cheers,
Marco

Quoted 253 lines

To do a basic build, using gcc and with shared libs, in a folder called "gcc-
build":

	user@host:dpdk$ meson gcc-build
	....
	user@host:dpdk$ cd gcc-build
	user@host:gcc-build$ ninja
	user@host:gcc-build$ sudo ninja install

To do a build with clang, using static libs:

	user@host:dpdk$ CC=clang meson --default_library=static clang-
build
	....
	user@host:dpdk$ cd clang-build
	user@host:clang-build$ ninja
	user@host:clang-build$ sudo ninja install

Other options can be adjusted by running "mesonconf" in the build directory, i.e. gcc-build or clang-build in the examples above.

Bruce Richardson (40):
  build: initial hooks for using meson with DPDK
  build: create pkg-config file for DPDK
  build: build linuxapp EAL with meson and ninja
  build: add EAL support under BSD
  build: add core libraries to meson build system
  build: add i40e driver to meson build
  build: add pmdinfogen to build
  build: generate list of sources for pmdinfogen
  build: build i40e driver, including pmdinfo
  build: install usertools scripts
  build: simplify generation of pmd.c files
  build: generalize net driver build to higher level
  build: remove hard-coded enablement of vector driver
  build: add ixgbe driver to build
  build: set up standard deps for drivers
  build: add af_packet driver to build
  build: add pcap PMD support
  build: add symbol version map file support to libs
  build: build libraries in a loop for brevity
  build: version library .so files
  eal: add version information to meson build
  build: add mempool drivers to build
  build: add gro library to meson build
  build: tweak naming of pmd dependencies
  build: track driver include directories properly
  metrics: add metrics lib to meson build
  build: track dependencies recursively
  testpmd: compile testpmd with meson and ninja crypto/null: rename the version file to standard crypto/qat: remove dependency on ether library
  build: add cryptodev and some crypto drivers to build
  igb_uio: add igb_uio to meson build
  ip_frag: rename version file to standard name
  build: add most remaining libraries to meson build
  build: add packet framework libs to meson build
  acl: add acl library to meson build
  build: add ark and avp PMDs to build
  build: fix static library builds with base code
  build: fix driver dependencies for static builds
  examples: allow basic sample app build using pkg-config

 app/meson.build                                    |  32 ++++++ app/test-pmd/meson.build                           |  74
+++++++++++++
 buildtools/gen-pmdinfo-cfile.sh                    |  41 ++++++++ buildtools/meson.build                             |  34 ++++++ buildtools/pmdinfogen/meson.build                  |  43 ++++++++ config/meson.build                                 |  69
+++++++++++++
 config/rte_config.h                                | 114
+++++++++++++++++++++
 config/x86/meson.build                             |  70
+++++++++++++
 drivers/crypto/meson.build                         | 108
+++++++++++++++++++
 drivers/crypto/null/Makefile                       |   2 +- drivers/crypto/null/meson.build                    |  32 ++++++ ...crypto_version.map => rte_pmd_null_version.map} |   0 drivers/crypto/openssl/meson.build                 |  38 +++++++ drivers/crypto/qat/meson.build                     |  41 ++++++++ drivers/crypto/qat/qat_crypto.c                    |   1 - drivers/mempool/meson.build                        | 108
+++++++++++++++++++
 drivers/mempool/ring/meson.build                   |  32 ++++++ drivers/mempool/stack/meson.build                  |  32 ++++++ drivers/meson.build                                |  34 ++++++ drivers/net/af_packet/meson.build                  |  35 +++++++ drivers/net/ark/meson.build                        |  45 ++++++++ drivers/net/avp/meson.build                        |  34 ++++++ drivers/net/i40e/base/meson.build                  |  56
++++++++++
 drivers/net/i40e/meson.build                       |  61
+++++++++++
 drivers/net/ixgbe/base/meson.build                 |  60
+++++++++++
 drivers/net/ixgbe/meson.build                      |  58
+++++++++++
 drivers/net/meson.build                            | 108
+++++++++++++++++++
 drivers/net/pcap/meson.build                       |  41 ++++++++ examples/helloworld/Makefile                       |  13 +++ examples/l2fwd/Makefile                            |  13 +++ lib/librte_acl/meson.build                         |  60
+++++++++++
 lib/librte_bitratestats/meson.build                |  34 ++++++ lib/librte_cfgfile/meson.build                     |  35 +++++++ lib/librte_cmdline/meson.build                     |  57
+++++++++++
 lib/librte_compat/meson.build                      |  36 +++++++ lib/librte_cryptodev/meson.build                   |  40 ++++++++ lib/librte_distributor/meson.build                 |  39 +++++++ lib/librte_eal/bsdapp/eal/meson.build              |  67
++++++++++++
 lib/librte_eal/bsdapp/meson.build                  |  32 ++++++ lib/librte_eal/common/arch/meson.build             |  33 ++++++ lib/librte_eal/common/arch/x86/meson.build         |  32 ++++++ lib/librte_eal/common/include/arch/meson.build     |  33 ++++++ lib/librte_eal/common/include/arch/x86/meson.build |  48 +++++++++ lib/librte_eal/common/include/meson.build          |  71
+++++++++++++
 lib/librte_eal/common/meson.build                  |  71
+++++++++++++
 lib/librte_eal/linuxapp/eal/meson.build            |  72
+++++++++++++
 lib/librte_eal/linuxapp/igb_uio/Kbuild             |   1 + lib/librte_eal/linuxapp/igb_uio/meson.build        |  47 +++++++++ lib/librte_eal/linuxapp/meson.build                |  42 ++++++++ lib/librte_eal/meson.build                         |  44 ++++++++ lib/librte_efd/meson.build                         |  34 ++++++ lib/librte_ether/meson.build                       |  46 +++++++++ lib/librte_eventdev/meson.build                    |  36 +++++++ lib/librte_gro/meson.build                         |  34 ++++++ lib/librte_hash/meson.build                        |  46 +++++++++ lib/librte_ip_frag/Makefile                        |   2 +- lib/librte_ip_frag/meson.build                     |  39 +++++++ ..._ipfrag_version.map => rte_ip_frag_version.map} |   0 lib/librte_jobstats/meson.build                    |  34 ++++++ lib/librte_kni/meson.build                         |  35 +++++++ lib/librte_kvargs/meson.build                      |  35 +++++++ lib/librte_latencystats/meson.build                |  34 ++++++ lib/librte_lpm/meson.build                         |  35 +++++++ lib/librte_mbuf/meson.build                        |  36 +++++++ lib/librte_mempool/meson.build                     |  35 +++++++ lib/librte_meter/meson.build                       |  34 ++++++ lib/librte_metrics/meson.build                     |  34 ++++++ lib/librte_net/meson.build                         |  46 +++++++++ lib/librte_pdump/meson.build                       |  34 ++++++ lib/librte_pipeline/meson.build                    |  35 +++++++ lib/librte_port/meson.build                        |  58
+++++++++++
 lib/librte_power/meson.build                       |  35 +++++++ lib/librte_reorder/meson.build                     |  34 ++++++ lib/librte_ring/meson.build                        |  34 ++++++ lib/librte_sched/meson.build                       |  36 +++++++ lib/librte_table/meson.build                       |  52
++++++++++
 lib/librte_timer/meson.build                       |  34 ++++++ lib/librte_vhost/meson.build                       |  36 +++++++ lib/meson.build                                    | 105
+++++++++++++++++++
 meson.build                                        |  88
++++++++++++++++
 meson_options.txt                                  |   8 ++ usertools/meson.build                              |  32 ++++++

 82 files changed, 3536 insertions(+), 3 deletions(-)

 create mode 100644 app/meson.build
 create mode 100644 app/test-pmd/meson.build
 create mode 100755 buildtools/gen-pmdinfo-cfile.sh create mode 100644 buildtools/meson.build
 create mode 100644 buildtools/pmdinfogen/meson.build create mode 100644 config/meson.build
 create mode 100644 config/rte_config.h
 create mode 100644 config/x86/meson.build
 create mode 100644 drivers/crypto/meson.build
 create mode 100644 drivers/crypto/null/meson.build rename drivers/crypto/null/{rte_pmd_null_crypto_version.map => rte_pmd_null_version.map} (100%)
 create mode 100644 drivers/crypto/openssl/meson.build create mode 100644 drivers/crypto/qat/meson.build create mode 100644 drivers/mempool/meson.build
 create mode 100644 drivers/mempool/ring/meson.build create mode 100644 drivers/mempool/stack/meson.build create mode 100644 drivers/meson.build
 create mode 100644 drivers/net/af_packet/meson.build create mode 100644 drivers/net/ark/meson.build
 create mode 100644 drivers/net/avp/meson.build
 create mode 100644 drivers/net/i40e/base/meson.build create mode 100644 drivers/net/i40e/meson.build
 create mode 100644 drivers/net/ixgbe/base/meson.build create mode 100644 drivers/net/ixgbe/meson.build create mode 100644 drivers/net/meson.build
 create mode 100644 drivers/net/pcap/meson.build
 create mode 100644 lib/librte_acl/meson.build
 create mode 100644 lib/librte_bitratestats/meson.build create mode 100644 lib/librte_cfgfile/meson.build create mode 100644 lib/librte_cmdline/meson.build create mode 100644 lib/librte_compat/meson.build create mode 100644 lib/librte_cryptodev/meson.build create mode 100644 lib/librte_distributor/meson.build create mode 100644 lib/librte_eal/bsdapp/eal/meson.build create mode 100644 lib/librte_eal/bsdapp/meson.build create mode 100644 lib/librte_eal/common/arch/meson.build create mode 100644 lib/librte_eal/common/arch/x86/meson.build create mode 100644 lib/librte_eal/common/include/arch/meson.build create mode 100644 lib/librte_eal/common/include/arch/x86/meson.build create mode 100644 lib/librte_eal/common/include/meson.build create mode 100644 lib/librte_eal/common/meson.build create mode 100644 lib/librte_eal/linuxapp/eal/meson.build create mode 100644 lib/librte_eal/linuxapp/igb_uio/Kbuild create mode 100644 lib/librte_eal/linuxapp/igb_uio/meson.build create mode 100644 lib/librte_eal/linuxapp/meson.build create mode 100644 lib/librte_eal/meson.build
 create mode 100644 lib/librte_efd/meson.build
 create mode 100644 lib/librte_ether/meson.build
 create mode 100644 lib/librte_eventdev/meson.build create mode 100644 lib/librte_gro/meson.build
 create mode 100644 lib/librte_hash/meson.build
 create mode 100644 lib/librte_ip_frag/meson.build rename lib/librte_ip_frag/{rte_ipfrag_version.map => rte_ip_frag_version.map}
(100%)
 create mode 100644 lib/librte_jobstats/meson.build create mode 100644 lib/librte_kni/meson.build
 create mode 100644 lib/librte_kvargs/meson.build create mode 100644 lib/librte_latencystats/meson.build create mode 100644 lib/librte_lpm/meson.build
 create mode 100644 lib/librte_mbuf/meson.build
 create mode 100644 lib/librte_mempool/meson.build create mode 100644 lib/librte_meter/meson.build
 create mode 100644 lib/librte_metrics/meson.build create mode 100644 lib/librte_net/meson.build
 create mode 100644 lib/librte_pdump/meson.build
 create mode 100644 lib/librte_pipeline/meson.build create mode 100644 lib/librte_port/meson.build
 create mode 100644 lib/librte_power/meson.build
 create mode 100644 lib/librte_reorder/meson.build create mode 100644 lib/librte_ring/meson.build
 create mode 100644 lib/librte_sched/meson.build
 create mode 100644 lib/librte_table/meson.build
 create mode 100644 lib/librte_timer/meson.build
 create mode 100644 lib/librte_vhost/meson.build
 create mode 100644 lib/meson.build
 create mode 100644 meson.build
 create mode 100644 meson_options.txt
 create mode 100644 usertools/meson.build