All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/17] build DPDK libs and some drivers with meson/ninja
@ 2017-09-01 10:03 Bruce Richardson
  2017-09-01 10:04 ` [PATCH 01/17] build: add initial infrastructure for meson & ninja builds Bruce Richardson
                   ` (18 more replies)
  0 siblings, 19 replies; 107+ messages in thread
From: Bruce Richardson @ 2017-09-01 10:03 UTC (permalink / raw)
  To: dev; +Cc: Bruce Richardson

Following on from the two previous RFCs [1] [2], here is a cleaned up
patchset to serve as a start-point for getting all of DPDK building with
meson and ninja.

What's covered:
* Basic infrastructure for feature detection and DPDK compilation
* Building of all DPDK libraries - as either static or shared
* Compilation of igb_uio driver for Linux
* Building a number of mempool, crypto and net drivers.
* Installation of compiled libraries and headers
* Installation of usertools scripts
* Compilation of testpmd as dpdk-testpmd and install of same
* Generation and installation of pkgconfig file for DPDK
* Contributors guide document addition describing how to add build scripts

What's not implemented:
* Just about everything else :-), including
* Support for non-x86 architectures, including cross-compilation
* Lots of PMDs
* Support for building and running the unit tests

Some key differences from RFC2:
* Removed duplication between the different driver meson files by moving
  the build logic up one level to the driver/meson.build file.
* Added a build option to allow versioning the libraries using the DPDK
  version number, rather than individual .so versions.
* Made EAL a default dependency for libs, to simplify meson.build files for
  a number of them.
* Made the build variables used for libraries and drivers more consistent.
* Moved responsibility for determining if a given driver or library should
  be built to the driver/library's own build file, giving a single place
  where all details about that component are placed, and saving having lots
  of environment detection logic in higher-level build files.
* Begun adding in developer documentation to make it easier for driver
  authors/maintainers to contribute.

Meson 0.41 and ninja are needed, and ideally meson 0.42 is recommended.
Ninja is available in most distributions, and meson - if an updated version
is not available on your distro of choice - can be easily got using 
	"pip3 install meson"

To build and install then use:

	meson build # use default compiler and shared libs
	cd build
	ninja
	sudo ninja install

Thereafter to use DPDK in other build systems one can use:

	pkg-config --cflags DPDK
	pkt-config --libs DPDK

to query the needed DPDK build parameters.

Once reviewed and tested a bit, I hope to apply this set - or a new
revision of it - to the build-next tree, to serve as a baseline for others
to use and to add the missing functionality to.

Regards,
/Bruce

[1] http://dpdk.org/ml/archives/dev/2017-June/067429.html
[2] http://dpdk.org/ml/archives/dev/2017-August/072818.html

Bruce Richardson (17):
  build: add initial infrastructure for meson & ninja builds
  eal: add eal library to meson build
  igb_uio: add igb_uio kmod to meson build
  build: add DPDK libraries to build
  build: add buildtools to meson build
  build: add infrastructure for building PMDs
  drivers/mempool: add SW mempool drivers to meson build
  drivers/crypto: add crypto drv class and null PMD to meson
  crypto/openssl: add driver to meson build
  crypto/qat: add driver to meson build
  drivers/net: add net driver support to meson build
  drivers/net: add set of vdev PMDs to build
  drivers/net: add drivers for Intel NICs to meson build
  app/test-pmd: add test-pmd to meson build
  usertools: add usertools installation to meson build
  build: add option to version libs using DPDK version
  doc: add documentation on how to add new components to DPDK

 app/meson.build                                    |  32 +++
 app/test-pmd/meson.build                           |  73 +++++++
 buildtools/gen-pmdinfo-cfile.sh                    |  41 ++++
 buildtools/meson.build                             |  34 ++++
 buildtools/pmdinfogen/meson.build                  |  43 +++++
 config/meson.build                                 |  69 +++++++
 config/rte_config.h                                | 121 ++++++++++++
 config/x86/meson.build                             |  70 +++++++
 doc/guides/contributing/coding_style.rst           | 214 +++++++++++++++++++++
 drivers/crypto/meson.build                         |  35 ++++
 drivers/crypto/null/meson.build                    |  33 ++++
 drivers/crypto/openssl/meson.build                 |  38 ++++
 drivers/crypto/qat/meson.build                     |  41 ++++
 drivers/mempool/meson.build                        |  35 ++++
 drivers/mempool/ring/meson.build                   |  32 +++
 drivers/mempool/stack/meson.build                  |  32 +++
 drivers/meson.build                                | 128 ++++++++++++
 drivers/net/af_packet/meson.build                  |  35 ++++
 drivers/net/e1000/base/meson.build                 |  65 +++++++
 drivers/net/e1000/meson.build                      |  44 +++++
 drivers/net/fm10k/base/meson.build                 |  55 ++++++
 drivers/net/fm10k/meson.build                      |  44 +++++
 drivers/net/i40e/base/meson.build                  |  56 ++++++
 drivers/net/i40e/meson.build                       |  60 ++++++
 drivers/net/ixgbe/base/meson.build                 |  60 ++++++
 drivers/net/ixgbe/meson.build                      |  58 ++++++
 drivers/net/meson.build                            |  36 ++++
 drivers/net/null/meson.build                       |  32 +++
 drivers/net/pcap/meson.build                       |  41 ++++
 drivers/net/ring/meson.build                       |  33 ++++
 lib/librte_acl/meson.build                         |  59 ++++++
 lib/librte_bitratestats/meson.build                |  34 ++++
 lib/librte_cfgfile/meson.build                     |  34 ++++
 lib/librte_cmdline/meson.build                     |  55 ++++++
 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                       |  45 +++++
 lib/librte_eventdev/meson.build                    |  36 ++++
 lib/librte_gro/meson.build                         |  34 ++++
 lib/librte_hash/meson.build                        |  45 +++++
 lib/librte_ip_frag/meson.build                     |  39 ++++
 lib/librte_jobstats/meson.build                    |  33 ++++
 lib/librte_kni/meson.build                         |  38 ++++
 lib/librte_kvargs/meson.build                      |  34 ++++
 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                       |  33 ++++
 lib/librte_metrics/meson.build                     |  33 ++++
 lib/librte_net/meson.build                         |  45 +++++
 lib/librte_pdump/meson.build                       |  34 ++++
 lib/librte_pipeline/meson.build                    |  35 ++++
 lib/librte_port/meson.build                        |  58 ++++++
 lib/librte_power/meson.build                       |  37 ++++
 lib/librte_reorder/meson.build                     |  34 ++++
 lib/librte_ring/meson.build                        |  33 ++++
 lib/librte_sched/meson.build                       |  36 ++++
 lib/librte_table/meson.build                       |  52 +++++
 lib/librte_timer/meson.build                       |  33 ++++
 lib/librte_vhost/meson.build                       |  39 ++++
 lib/meson.build                                    | 105 ++++++++++
 meson.build                                        |  88 +++++++++
 meson_options.txt                                  |   9 +
 usertools/meson.build                              |  32 +++
 80 files changed, 3794 insertions(+)
 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
 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/e1000/base/meson.build
 create mode 100644 drivers/net/e1000/meson.build
 create mode 100644 drivers/net/fm10k/base/meson.build
 create mode 100644 drivers/net/fm10k/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/null/meson.build
 create mode 100644 drivers/net/pcap/meson.build
 create mode 100644 drivers/net/ring/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
 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

-- 
2.13.5

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

* [PATCH 01/17] build: add initial infrastructure for meson & ninja builds
  2017-09-01 10:03 [PATCH 00/17] build DPDK libs and some drivers with meson/ninja Bruce Richardson
@ 2017-09-01 10:04 ` Bruce Richardson
  2017-09-04 13:36   ` Van Haaren, Harry
                     ` (2 more replies)
  2017-09-01 10:04 ` [PATCH 02/17] eal: add eal library to meson build Bruce Richardson
                   ` (17 subsequent siblings)
  18 siblings, 3 replies; 107+ messages in thread
From: Bruce Richardson @ 2017-09-01 10:04 UTC (permalink / raw)
  To: dev; +Cc: Bruce Richardson

To build with meson and ninja, we need some initial infrastructure in
place. The build files for meson always need to be called "meson.build",
and options get placed in meson_options.txt

This commit adds a top-level meson.build file, which sets up the global
variables for tracking drivers, libraries, etc., and then includes other
build files, before finishing by writing the global build configuration
header file and a DPDK pkgconfig file at the end, using some of those same
globals.

>From the top level build file, the only include file thus far is for the
config folder, which does some other setup of global configuration
parameters, including pulling in architecture specific parameters from an
architectural subdirectory. A number of configuration build options are
provided for the project to tune a number of global variables which will be
used later e.g. max numa nodes, max cores, etc. These settings all make
their way to the global build config header "rte_build_config.h". There is
also a file "rte_config.h", which includes "rte_build_config.h", and this
file is meant to hold other build-time values which are present in our
current static build configuration but are not normally meant for
user-configuration. Ideally, over time, the values placed here should be
moved to the individual libraries or drivers which want those values.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 config/meson.build     | 69 +++++++++++++++++++++++++++++++++++++++++
 config/rte_config.h    | 50 ++++++++++++++++++++++++++++++
 config/x86/meson.build | 70 ++++++++++++++++++++++++++++++++++++++++++
 meson.build            | 83 ++++++++++++++++++++++++++++++++++++++++++++++++++
 meson_options.txt      |  6 ++++
 5 files changed, 278 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

diff --git a/config/meson.build b/config/meson.build
new file mode 100644
index 000000000..3a6bcc58d
--- /dev/null
+++ b/config/meson.build
@@ -0,0 +1,69 @@
+#   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')
+# 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')
+
+# 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')
+	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')
diff --git a/config/rte_config.h b/config/rte_config.h
new file mode 100644
index 000000000..79b0db90f
--- /dev/null
+++ b/config/rte_config.h
@@ -0,0 +1,50 @@
+/*
+ *   BSD LICENSE
+ *
+ *   Copyright(c) 2016 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.
+ */
+
+/**
+ * @file Header file containing DPDK compilation parameters
+ *
+ * Header file containing DPDK compilation parameters. Also include the
+ * meson-generated header file containing the detected parameters that
+ * are variable across builds or build environments.
+ *
+ * NOTE: This file is only used for meson+ninja builds. For builds done
+ * using make/gmake, the rte_config.h file is autogenerated from the
+ * defconfig_* files in the config directory.
+ */
+#ifndef _RTE_CONFIG_H_
+#define _RTE_CONFIG_H_
+
+#include <rte_build_config.h>
+
+#endif /* _RTE_CONFIG_H_ */
diff --git a/config/x86/meson.build b/config/x86/meson.build
new file mode 100644
index 000000000..54f8bcdb6
--- /dev/null
+++ b/config/x86/meson.build
@@ -0,0 +1,70 @@
+#   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.
+
+# for checking defines we need to use the correct compiler flags
+march_opt = '-march=@0@'.format(machine)
+
+# we require SSE4.2 for DPDK
+sse_errormsg = '''SSE4.2 instruction set is required for DPDK.
+Please set the machine type to "nehalem" or "corei7" or higher value'''
+
+if cc.get_define('__SSE4_2__', args: march_opt) == ''
+	error(sse_errormsg)
+endif
+
+dpdk_conf.set('RTE_ARCH_X86', 1)
+if (host_machine.cpu_family() == 'x86_64')
+	dpdk_conf.set('RTE_ARCH_X86_64', 1)
+	dpdk_conf.set('RTE_ARCH', 'x86_64')
+	dpdk_conf.set('RTE_ARCH_64', 1)
+else
+	dpdk_conf.set('RTE_ARCH_I686', 1)
+	dpdk_conf.set('RTE_ARCH', 'i686')
+endif
+
+if cc.get_define('__AES__', args: march_opt) != ''
+	dpdk_conf.set('RTE_MACHINE_CPUFLAG_AES', 1)
+	compile_time_cpuflags += ['RTE_CPUFLAG_AES']
+endif
+if cc.get_define('__PCLMUL__', args: march_opt) != ''
+	dpdk_conf.set('RTE_MACHINE_CPUFLAG_PCLMULQDQ', 1)
+	compile_time_cpuflags += ['RTE_CPUFLAG_PCLMULQDQ']
+endif
+if cc.get_define('__AVX__', args: march_opt) != ''
+	dpdk_conf.set('RTE_MACHINE_CPUFLAG_AVX', 1)
+	compile_time_cpuflags += ['RTE_CPUFLAG_AVX']
+endif
+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)
diff --git a/meson.build b/meson.build
new file mode 100644
index 000000000..42e94fe18
--- /dev/null
+++ b/meson.build
@@ -0,0 +1,83 @@
+#   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.
+
+project('DPDK', 'C',
+	version: '17.08.0',
+	license: 'BSD',
+	default_options: ['buildtype=release'],
+	meson_version: '>= 0.41'
+)
+
+# set up some global vars for compiler, platform, configuration, etc.
+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
+if get_option('default_library') == 'static'
+	driver_install_path = get_option('libdir')
+else
+	driver_install_path = '@0@/dpdk/drivers'.format(get_option('prefix'))
+endif
+
+# configure the build, and make sure configs here and in config folder are
+# 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')
+subdir('config')
+
+# TODO build libs and drivers
+
+# TODO build binaries and installable tools
+
+# write the build config
+build_cfg = 'rte_build_config.h'
+configure_file(output: build_cfg,
+		configuration: dpdk_conf,
+		install_dir: get_option('includedir'))
+
+# 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_drivers = ['-Wl,--whole-archive'] + dpdk_drivers + ['-Wl,--no-whole-archive']
+	dpdk_libraries = dpdk_drivers + dpdk_libraries + dpdk_extra_ldflags
+endif
+
+pkg = import('pkgconfig')
+pkg.generate(name: meson.project_name(),
+	version: meson.project_version(),
+	libraries: dpdk_libraries,
+	description: 'The Data Plane Development Kit (DPDK)',
+	extra_cflags: '-include "rte_config.h"'
+)
diff --git a/meson_options.txt b/meson_options.txt
new file mode 100644
index 000000000..c03b79fbd
--- /dev/null
+++ b/meson_options.txt
@@ -0,0 +1,6 @@
+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')
-- 
2.13.5

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

* [PATCH 02/17] eal: add eal library to meson build
  2017-09-01 10:03 [PATCH 00/17] build DPDK libs and some drivers with meson/ninja Bruce Richardson
  2017-09-01 10:04 ` [PATCH 01/17] build: add initial infrastructure for meson & ninja builds Bruce Richardson
@ 2017-09-01 10:04 ` Bruce Richardson
  2017-09-04 13:53   ` Van Haaren, Harry
  2017-09-07 16:25   ` [dpdk-dev, " Neil Horman
  2017-09-01 10:04 ` [PATCH 03/17] igb_uio: add igb_uio kmod " Bruce Richardson
                   ` (16 subsequent siblings)
  18 siblings, 2 replies; 107+ messages in thread
From: Bruce Richardson @ 2017-09-01 10:04 UTC (permalink / raw)
  To: dev; +Cc: Bruce Richardson

Support building the EAL with meson and ninja. This involves a number of
different meson.build files for iterating through all the different
subdirectories in the EAL. The library itself will be compiled on build but
the header files are only copied from their initial location once "ninja
install" is run. Instead, we use meson dependency tracking to ensure that
other libraries which use the EAL headers can find them in their original
locations.

Note: this does not include building kernel modules on either BSD or Linux

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 config/rte_config.h                                | 11 ++++
 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/meson.build                | 32 ++++++++++
 lib/librte_eal/meson.build                         | 44 +++++++++++++
 lib/meson.build                                    | 32 ++++++++++
 meson.build                                        |  3 +-
 14 files changed, 580 insertions(+), 1 deletion(-)
 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/meson.build
 create mode 100644 lib/librte_eal/meson.build
 create mode 100644 lib/meson.build

diff --git a/config/rte_config.h b/config/rte_config.h
index 79b0db90f..252b087ad 100644
--- a/config/rte_config.h
+++ b/config/rte_config.h
@@ -47,4 +47,15 @@
 
 #include <rte_build_config.h>
 
+/****** library defines ********/
+
+/* 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_ */
diff --git a/lib/librte_eal/bsdapp/eal/meson.build b/lib/librte_eal/bsdapp/eal/meson.build
new file mode 100644
index 000000000..bc9c3f0cb
--- /dev/null
+++ b/lib/librte_eal/bsdapp/eal/meson.build
@@ -0,0 +1,67 @@
+#   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')
+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_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'),
+			include_directories : eal_inc,
+			version: '@0@.1'.format(version),
+			c_args: '-D_GNU_SOURCE',
+			link_depends: version_map,
+			link_args: [eal_extra_link_arg,
+				'-Wl,--version-script=' + version_map],
+			install: true
+)
+
+dpdk_libraries += eal_lib
+dpdk_extra_ldflags += ['-pthread', eal_extra_link_arg]
+
+rte_eal = declare_dependency(link_with: eal_lib,
+		include_directories: eal_inc,
+		dependencies: dependency('threads'))
+set_variable('dep_rte_eal', rte_eal)
diff --git a/lib/librte_eal/bsdapp/meson.build b/lib/librte_eal/bsdapp/meson.build
new file mode 100644
index 000000000..bc9f22175
--- /dev/null
+++ b/lib/librte_eal/bsdapp/meson.build
@@ -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')
diff --git a/lib/librte_eal/common/arch/meson.build b/lib/librte_eal/common/arch/meson.build
new file mode 100644
index 000000000..863d7e4bb
--- /dev/null
+++ b/lib/librte_eal/common/arch/meson.build
@@ -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)
diff --git a/lib/librte_eal/common/arch/x86/meson.build b/lib/librte_eal/common/arch/x86/meson.build
new file mode 100644
index 000000000..8fabad648
--- /dev/null
+++ b/lib/librte_eal/common/arch/x86/meson.build
@@ -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')
diff --git a/lib/librte_eal/common/include/arch/meson.build b/lib/librte_eal/common/include/arch/meson.build
new file mode 100644
index 000000000..863d7e4bb
--- /dev/null
+++ b/lib/librte_eal/common/include/arch/meson.build
@@ -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)
diff --git a/lib/librte_eal/common/include/arch/x86/meson.build b/lib/librte_eal/common/include/arch/x86/meson.build
new file mode 100644
index 000000000..ad0949a92
--- /dev/null
+++ b/lib/librte_eal/common/include/arch/x86/meson.build
@@ -0,0 +1,48 @@
+#   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_atomic_32.h',
+	'rte_atomic_64.h',
+	'rte_atomic.h',
+	'rte_byteorder_32.h',
+	'rte_byteorder_64.h',
+	'rte_byteorder.h',
+	'rte_cpuflags.h',
+	'rte_cycles.h',
+	'rte_io.h',
+	'rte_memcpy.h',
+	'rte_prefetch.h',
+	'rte_pause.h',
+	'rte_rtm.h',
+	'rte_rwlock.h',
+	'rte_spinlock.h',
+	'rte_vect.h')
diff --git a/lib/librte_eal/common/include/meson.build b/lib/librte_eal/common/include/meson.build
new file mode 100644
index 000000000..e92c4eb7c
--- /dev/null
+++ b/lib/librte_eal/common/include/meson.build
@@ -0,0 +1,71 @@
+#   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('.')
+
+common_headers = [
+	'rte_alarm.h',
+	'rte_branch_prediction.h',
+	'rte_bus.h',
+	'rte_common.h',
+	'rte_debug.h',
+	'rte_devargs.h',
+	'rte_dev.h',
+	'rte_eal.h',
+	'rte_eal_memconfig.h',
+	'rte_errno.h',
+	'rte_hexdump.h',
+	'rte_interrupts.h',
+	'rte_keepalive.h',
+	'rte_launch.h',
+	'rte_lcore.h',
+	'rte_log.h',
+	'rte_malloc.h',
+	'rte_malloc_heap.h',
+	'rte_memory.h',
+	'rte_memzone.h',
+	'rte_pci_dev_feature_defs.h',
+	'rte_pci_dev_features.h',
+	'rte_pci.h',
+	'rte_per_lcore.h',
+	'rte_random.h',
+	'rte_service.h',
+	'rte_service_component.h',
+	'rte_string_fns.h',
+	'rte_tailq.h',
+	'rte_time.h',
+	'rte_vdev.h',
+	'rte_version.h']
+
+install_headers(common_headers)
+install_subdir('generic', install_dir : 'include')
+
+subdir('arch')
diff --git a/lib/librte_eal/common/meson.build b/lib/librte_eal/common/meson.build
new file mode 100644
index 000000000..4a3e73f69
--- /dev/null
+++ b/lib/librte_eal/common/meson.build
@@ -0,0 +1,71 @@
+#   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('.')
+
+eal_common_sources = files(
+	'eal_common_bus.c',
+	'eal_common_cpuflags.c',
+	'eal_common_devargs.c',
+	'eal_common_dev.c',
+	'eal_common_errno.c',
+	'eal_common_hexdump.c',
+	'eal_common_launch.c',
+	'eal_common_lcore.c',
+	'eal_common_log.c',
+	'eal_common_memory.c',
+	'eal_common_memzone.c',
+	'eal_common_options.c',
+	'eal_common_pci.c',
+	'eal_common_pci_uio.c',
+	'eal_common_proc.c',
+	'eal_common_string_fns.c',
+	'eal_common_tailqs.c',
+	'eal_common_thread.c',
+	'eal_common_timer.c',
+	'eal_common_vdev.c',
+	'eal_filesystem.h',
+	'eal_hugepages.h',
+	'eal_internal_cfg.h',
+	'eal_options.h',
+	'eal_private.h',
+	'eal_thread.h',
+	'malloc_elem.c',
+	'malloc_elem.h',
+	'malloc_heap.c',
+	'malloc_heap.h',
+	'rte_keepalive.c',
+	'rte_malloc.c',
+	'rte_service.c'
+)
+
+subdir('arch')
+subdir('include')
diff --git a/lib/librte_eal/linuxapp/eal/meson.build b/lib/librte_eal/linuxapp/eal/meson.build
new file mode 100644
index 000000000..886bcbf0e
--- /dev/null
+++ b/lib/librte_eal/linuxapp/eal/meson.build
@@ -0,0 +1,72 @@
+#   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')
+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_log.c',
+		'eal_pci_uio.c',
+		'eal_pci_vfio.c',
+		'eal_thread.c',
+		'eal_timer.c',
+		'eal_vfio.c',
+		'eal_vfio_mp_sync.c',
+		'eal.c',
+		'eal_memory.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'),
+			include_directories : eal_inc,
+			version: '@0@.1'.format(version),
+			c_args: '-D_GNU_SOURCE',
+			link_depends: version_map,
+			link_args: [eal_extra_link_arg,
+				'-Wl,--version-script=' + version_map],
+			install: true
+)
+
+dpdk_libraries += eal_lib
+dpdk_extra_ldflags += ['-pthread', eal_extra_link_arg]
+
+rte_eal = declare_dependency(link_with: eal_lib,
+		include_directories: eal_inc,
+		dependencies: dependency('threads'))
+set_variable('dep_rte_eal', rte_eal)
diff --git a/lib/librte_eal/linuxapp/meson.build b/lib/librte_eal/linuxapp/meson.build
new file mode 100644
index 000000000..bc9f22175
--- /dev/null
+++ b/lib/librte_eal/linuxapp/meson.build
@@ -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')
diff --git a/lib/librte_eal/meson.build b/lib/librte_eal/meson.build
new file mode 100644
index 000000000..1b2556121
--- /dev/null
+++ b/lib/librte_eal/meson.build
@@ -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.
+
+version = 4  # the version of the EAL API
+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()))
+endif
diff --git a/lib/meson.build b/lib/meson.build
new file mode 100644
index 000000000..d478a78c1
--- /dev/null
+++ b/lib/meson.build
@@ -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('librte_eal')
diff --git a/meson.build b/meson.build
index 42e94fe18..f0e5741e3 100644
--- a/meson.build
+++ b/meson.build
@@ -57,7 +57,8 @@ endif
 global_inc = include_directories('.', 'config')
 subdir('config')
 
-# TODO build libs and drivers
+# build libs and (TODO) drivers
+subdir('lib')
 
 # TODO build binaries and installable tools
 
-- 
2.13.5

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

* [PATCH 03/17] igb_uio: add igb_uio kmod to meson build
  2017-09-01 10:03 [PATCH 00/17] build DPDK libs and some drivers with meson/ninja Bruce Richardson
  2017-09-01 10:04 ` [PATCH 01/17] build: add initial infrastructure for meson & ninja builds Bruce Richardson
  2017-09-01 10:04 ` [PATCH 02/17] eal: add eal library to meson build Bruce Richardson
@ 2017-09-01 10:04 ` Bruce Richardson
  2017-09-01 13:32   ` Luca Boccassi
  2017-09-04 13:57   ` Van Haaren, Harry
  2017-09-01 10:04 ` [PATCH 04/17] build: add DPDK libraries to build Bruce Richardson
                   ` (15 subsequent siblings)
  18 siblings, 2 replies; 107+ messages in thread
From: Bruce Richardson @ 2017-09-01 10:04 UTC (permalink / raw)
  To: dev; +Cc: Bruce Richardson

Support building igb_uio using meson and ninja. For this, we still use the
kernel's kbuild system, by calling out to make, since it's safer and easier
than trying to reproduce that in meson. A list of suitable file
dependencies is given so that we have a reasonable chance of a rebuild when
necessary.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 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                           |  2 ++
 4 files changed, 60 insertions(+)
 create mode 100644 lib/librte_eal/linuxapp/igb_uio/Kbuild
 create mode 100644 lib/librte_eal/linuxapp/igb_uio/meson.build

diff --git a/lib/librte_eal/linuxapp/igb_uio/Kbuild b/lib/librte_eal/linuxapp/igb_uio/Kbuild
new file mode 100644
index 000000000..98c98fe52
--- /dev/null
+++ b/lib/librte_eal/linuxapp/igb_uio/Kbuild
@@ -0,0 +1 @@
+obj-m := igb_uio.o
diff --git a/lib/librte_eal/linuxapp/igb_uio/meson.build b/lib/librte_eal/linuxapp/igb_uio/meson.build
new file mode 100644
index 000000000..c046e1d66
--- /dev/null
+++ b/lib/librte_eal/linuxapp/igb_uio/meson.build
@@ -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.
+
+mkfile = custom_target('igb_uio_makefile',
+	output: 'Makefile',
+	command: ['touch', '@OUTPUT@'])
+
+custom_target('igb_uio',
+	input: ['igb_uio.c', 'Kbuild'],
+	output: 'igb_uio.ko',
+	command: ['make', '-C', kernel_dir,
+		'M=' + meson.current_build_dir(),
+		'src=' + meson.current_source_dir(),
+		'EXTRA_CFLAGS=-I' + meson.current_source_dir() +
+			'/../../common/include',
+		'modules'],
+	depends: mkfile,
+	depend_files: [join_paths(kernel_dir, 'Kconfig')],
+	build_by_default: true)
diff --git a/lib/librte_eal/linuxapp/meson.build b/lib/librte_eal/linuxapp/meson.build
index bc9f22175..2383bd368 100644
--- a/lib/librte_eal/linuxapp/meson.build
+++ b/lib/librte_eal/linuxapp/meson.build
@@ -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
diff --git a/meson_options.txt b/meson_options.txt
index c03b79fbd..9c45b8159 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -4,3 +4,5 @@ option('max_numa_nodes', type: 'string', value: '4', description: 'maximum numbe
 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')
+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')
-- 
2.13.5

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

* [PATCH 04/17] build: add DPDK libraries to build
  2017-09-01 10:03 [PATCH 00/17] build DPDK libs and some drivers with meson/ninja Bruce Richardson
                   ` (2 preceding siblings ...)
  2017-09-01 10:04 ` [PATCH 03/17] igb_uio: add igb_uio kmod " Bruce Richardson
@ 2017-09-01 10:04 ` Bruce Richardson
  2017-09-04 14:08   ` Van Haaren, Harry
  2017-09-01 10:04 ` [PATCH 05/17] build: add buildtools to meson build Bruce Richardson
                   ` (14 subsequent siblings)
  18 siblings, 1 reply; 107+ messages in thread
From: Bruce Richardson @ 2017-09-01 10:04 UTC (permalink / raw)
  To: dev; +Cc: Bruce Richardson

Add non-EAL libraries to DPDK build. The compat lib is a special case,
along with the previously-added EAL, but all other libs can be build using
the same set of commands, where the individual meson.build files only need
to specify their dependencies, source files, header files and ABI versions.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 config/rte_config.h                 | 36 ++++++++++++++++++++
 lib/librte_acl/meson.build          | 59 ++++++++++++++++++++++++++++++++
 lib/librte_bitratestats/meson.build | 34 +++++++++++++++++++
 lib/librte_cfgfile/meson.build      | 34 +++++++++++++++++++
 lib/librte_cmdline/meson.build      | 55 ++++++++++++++++++++++++++++++
 lib/librte_compat/meson.build       | 36 ++++++++++++++++++++
 lib/librte_cryptodev/meson.build    | 40 ++++++++++++++++++++++
 lib/librte_distributor/meson.build  | 39 +++++++++++++++++++++
 lib/librte_efd/meson.build          | 34 +++++++++++++++++++
 lib/librte_ether/meson.build        | 45 +++++++++++++++++++++++++
 lib/librte_eventdev/meson.build     | 36 ++++++++++++++++++++
 lib/librte_gro/meson.build          | 34 +++++++++++++++++++
 lib/librte_hash/meson.build         | 45 +++++++++++++++++++++++++
 lib/librte_ip_frag/meson.build      | 39 +++++++++++++++++++++
 lib/librte_jobstats/meson.build     | 33 ++++++++++++++++++
 lib/librte_kni/meson.build          | 38 +++++++++++++++++++++
 lib/librte_kvargs/meson.build       | 34 +++++++++++++++++++
 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        | 33 ++++++++++++++++++
 lib/librte_metrics/meson.build      | 33 ++++++++++++++++++
 lib/librte_net/meson.build          | 45 +++++++++++++++++++++++++
 lib/librte_pdump/meson.build        | 34 +++++++++++++++++++
 lib/librte_pipeline/meson.build     | 35 +++++++++++++++++++
 lib/librte_port/meson.build         | 58 ++++++++++++++++++++++++++++++++
 lib/librte_power/meson.build        | 37 ++++++++++++++++++++
 lib/librte_reorder/meson.build      | 34 +++++++++++++++++++
 lib/librte_ring/meson.build         | 33 ++++++++++++++++++
 lib/librte_sched/meson.build        | 36 ++++++++++++++++++++
 lib/librte_table/meson.build        | 52 ++++++++++++++++++++++++++++
 lib/librte_timer/meson.build        | 33 ++++++++++++++++++
 lib/librte_vhost/meson.build        | 39 +++++++++++++++++++++
 lib/meson.build                     | 67 +++++++++++++++++++++++++++++++++++++
 35 files changed, 1380 insertions(+)
 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_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
 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

diff --git a/config/rte_config.h b/config/rte_config.h
index 252b087ad..7fb6c4cce 100644
--- a/config/rte_config.h
+++ b/config/rte_config.h
@@ -58,4 +58,40 @@
 #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
+
+/* 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
+
 #endif /* _RTE_CONFIG_H_ */
diff --git a/lib/librte_acl/meson.build b/lib/librte_acl/meson.build
new file mode 100644
index 000000000..c217d6ffe
--- /dev/null
+++ b/lib/librte_acl/meson.build
@@ -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.
+
+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')
+
+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
diff --git a/lib/librte_bitratestats/meson.build b/lib/librte_bitratestats/meson.build
new file mode 100644
index 000000000..5adfaf7f3
--- /dev/null
+++ b/lib/librte_bitratestats/meson.build
@@ -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 += ['ethdev', 'metrics']
diff --git a/lib/librte_cfgfile/meson.build b/lib/librte_cfgfile/meson.build
new file mode 100644
index 000000000..540b47c14
--- /dev/null
+++ b/lib/librte_cfgfile/meson.build
@@ -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.
+
+version = 2
+sources = files('rte_cfgfile.c')
+headers = files('rte_cfgfile.h')
diff --git a/lib/librte_cmdline/meson.build b/lib/librte_cmdline/meson.build
new file mode 100644
index 000000000..c5e01ba21
--- /dev/null
+++ b/lib/librte_cmdline/meson.build
@@ -0,0 +1,55 @@
+#   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('cmdline.c',
+	'cmdline_cirbuf.c',
+	'cmdline_parse.c',
+	'cmdline_parse_etheraddr.c',
+	'cmdline_parse_ipaddr.c',
+	'cmdline_parse_num.c',
+	'cmdline_parse_portlist.c',
+	'cmdline_parse_string.c',
+	'cmdline_rdline.c',
+	'cmdline_socket.c',
+	'cmdline_vt100.c')
+
+headers = files('cmdline.h',
+	'cmdline_parse.h',
+	'cmdline_parse_num.h',
+	'cmdline_parse_ipaddr.h',
+	'cmdline_parse_etheraddr.h',
+	'cmdline_parse_string.h',
+	'cmdline_rdline.h',
+	'cmdline_vt100.h',
+	'cmdline_socket.h',
+	'cmdline_cirbuf.h',
+	'cmdline_parse_portlist.h')
diff --git a/lib/librte_compat/meson.build b/lib/librte_compat/meson.build
new file mode 100644
index 000000000..6773e2203
--- /dev/null
+++ b/lib/librte_compat/meson.build
@@ -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.
+
+
+install_headers('rte_compat.h')
+
+set_variable('dep_rte_compat',
+	declare_dependency(include_directories: include_directories('.')))
diff --git a/lib/librte_cryptodev/meson.build b/lib/librte_cryptodev/meson.build
new file mode 100644
index 000000000..9663d8d13
--- /dev/null
+++ b/lib/librte_cryptodev/meson.build
@@ -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.
+
+version = 3
+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 += ['kvargs', 'mbuf']
diff --git a/lib/librte_distributor/meson.build b/lib/librte_distributor/meson.build
new file mode 100644
index 000000000..0851d78aa
--- /dev/null
+++ b/lib/librte_distributor/meson.build
@@ -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 += ['mbuf', 'compat']
diff --git a/lib/librte_efd/meson.build b/lib/librte_efd/meson.build
new file mode 100644
index 000000000..4132d848a
--- /dev/null
+++ b/lib/librte_efd/meson.build
@@ -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 += ['ring', 'hash']
diff --git a/lib/librte_ether/meson.build b/lib/librte_ether/meson.build
new file mode 100644
index 000000000..47f0c0e1b
--- /dev/null
+++ b/lib/librte_ether/meson.build
@@ -0,0 +1,45 @@
+#   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.
+
+name = 'ethdev'
+version = 6
+sources = files('rte_ethdev.c', 'rte_flow.c', 'rte_tm.c')
+
+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_tm.h')
+
+deps += ['net']
diff --git a/lib/librte_eventdev/meson.build b/lib/librte_eventdev/meson.build
new file mode 100644
index 000000000..e7e32cfe2
--- /dev/null
+++ b/lib/librte_eventdev/meson.build
@@ -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 += ['ring']
diff --git a/lib/librte_gro/meson.build b/lib/librte_gro/meson.build
new file mode 100644
index 000000000..2c62900d0
--- /dev/null
+++ b/lib/librte_gro/meson.build
@@ -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 += ['ethdev']
diff --git a/lib/librte_hash/meson.build b/lib/librte_hash/meson.build
new file mode 100644
index 000000000..f8c6f1452
--- /dev/null
+++ b/lib/librte_hash/meson.build
@@ -0,0 +1,45 @@
+#   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
+headers = files('rte_cmp_arm64.h',
+	'rte_cmp_x86.h',
+	'rte_crc_arm64.h',
+	'rte_cuckoo_hash.h',
+	'rte_cuckoo_hash_x86.h',
+	'rte_fbk_hash.h',
+	'rte_hash_crc.h',
+	'rte_hash.h',
+	'rte_jhash.h',
+	'rte_thash.h')
+
+sources = files('rte_cuckoo_hash.c', 'rte_fbk_hash.c')
+deps += ['ring', 'compat']
diff --git a/lib/librte_ip_frag/meson.build b/lib/librte_ip_frag/meson.build
new file mode 100644
index 000000000..4b47664c0
--- /dev/null
+++ b/lib/librte_ip_frag/meson.build
@@ -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 += ['ethdev', 'hash']
diff --git a/lib/librte_jobstats/meson.build b/lib/librte_jobstats/meson.build
new file mode 100644
index 000000000..ae8f715ad
--- /dev/null
+++ b/lib/librte_jobstats/meson.build
@@ -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_jobstats.c')
+headers = files('rte_jobstats.h')
diff --git a/lib/librte_kni/meson.build b/lib/librte_kni/meson.build
new file mode 100644
index 000000000..a922a8692
--- /dev/null
+++ b/lib/librte_kni/meson.build
@@ -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.
+
+if host_machine.system() != 'linux'
+	build = false
+endif
+version = 2
+sources = files('rte_kni.c')
+headers = files('rte_kni.h')
+deps += ['ethdev']
diff --git a/lib/librte_kvargs/meson.build b/lib/librte_kvargs/meson.build
new file mode 100644
index 000000000..25715d1fa
--- /dev/null
+++ b/lib/librte_kvargs/meson.build
@@ -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.
+
+version = 1
+sources = files('rte_kvargs.c')
+headers = files('rte_kvargs.h')
diff --git a/lib/librte_latencystats/meson.build b/lib/librte_latencystats/meson.build
new file mode 100644
index 000000000..05f4c3568
--- /dev/null
+++ b/lib/librte_latencystats/meson.build
@@ -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 += ['metrics', 'ethdev']
diff --git a/lib/librte_lpm/meson.build b/lib/librte_lpm/meson.build
new file mode 100644
index 000000000..a029c2919
--- /dev/null
+++ b/lib/librte_lpm/meson.build
@@ -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 += ['compat']
diff --git a/lib/librte_mbuf/meson.build b/lib/librte_mbuf/meson.build
new file mode 100644
index 000000000..f1724b59e
--- /dev/null
+++ b/lib/librte_mbuf/meson.build
@@ -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 = 3
+sources = files('rte_mbuf.c', 'rte_mbuf_ptype.c')
+headers = files('rte_mbuf.h', 'rte_mbuf_ptype.h')
+deps += ['mempool']
+
diff --git a/lib/librte_mempool/meson.build b/lib/librte_mempool/meson.build
new file mode 100644
index 000000000..6b660002c
--- /dev/null
+++ b/lib/librte_mempool/meson.build
@@ -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_mempool.c', 'rte_mempool_ops.c')
+headers = files('rte_mempool.h')
+deps += ['ring']
diff --git a/lib/librte_meter/meson.build b/lib/librte_meter/meson.build
new file mode 100644
index 000000000..9b477d53e
--- /dev/null
+++ b/lib/librte_meter/meson.build
@@ -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_meter.c')
+headers = files('rte_meter.h')
diff --git a/lib/librte_metrics/meson.build b/lib/librte_metrics/meson.build
new file mode 100644
index 000000000..218aa6974
--- /dev/null
+++ b/lib/librte_metrics/meson.build
@@ -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_metrics.c')
+headers = files('rte_metrics.h')
diff --git a/lib/librte_net/meson.build b/lib/librte_net/meson.build
new file mode 100644
index 000000000..fc9846947
--- /dev/null
+++ b/lib/librte_net/meson.build
@@ -0,0 +1,45 @@
+#   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 = 1
+headers = files('rte_ip.h',
+	'rte_tcp.h',
+	'rte_udp.h',
+	'rte_sctp.h',
+	'rte_icmp.h',
+	'rte_arp.h',
+	'rte_ether.h',
+	'rte_gre.h',
+	'rte_net.h',
+	'rte_net_crc.h')
+
+sources = files('rte_net.c', 'rte_net_crc.c')
+deps += ['mbuf']
diff --git a/lib/librte_pdump/meson.build b/lib/librte_pdump/meson.build
new file mode 100644
index 000000000..bafcb3650
--- /dev/null
+++ b/lib/librte_pdump/meson.build
@@ -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 += ['ethdev']
diff --git a/lib/librte_pipeline/meson.build b/lib/librte_pipeline/meson.build
new file mode 100644
index 000000000..c76fce149
--- /dev/null
+++ b/lib/librte_pipeline/meson.build
@@ -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']
diff --git a/lib/librte_port/meson.build b/lib/librte_port/meson.build
new file mode 100644
index 000000000..4a78da9bf
--- /dev/null
+++ b/lib/librte_port/meson.build
@@ -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.
+
+version = 3
+sources = files(
+	'rte_port_ethdev.c',
+	'rte_port_fd.c',
+	'rte_port_ring.c',
+	'rte_port_sched.c',
+	'rte_port_source_sink.c')
+headers = files(
+	'rte_port_ethdev.h',
+	'rte_port_fd.h',
+	'rte_port.h',
+	'rte_port_ring.h',
+	'rte_port_sched.h',
+	'rte_port_source_sink.h')
+deps += ['ethdev', 'sched']
+
+if dpdk_conf.has('RTE_LIBRTE_IP_FRAG')
+	sources += files('rte_port_frag.c', 'rte_port_ras.c')
+	headers += files('rte_port_frag.h', 'rte_port_ras.h')
+	deps += ['ip_frag']
+endif
+
+if dpdk_conf.has('RTE_LIBRTE_KNI')
+	sources += files('rte_port_kni.c')
+	headers += files('rte_port_kni.h')
+	deps += 'kni'
+endif
diff --git a/lib/librte_power/meson.build b/lib/librte_power/meson.build
new file mode 100644
index 000000000..0b1d74a42
--- /dev/null
+++ b/lib/librte_power/meson.build
@@ -0,0 +1,37 @@
+#   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('rte_power.c', 'rte_power_acpi_cpufreq.c',
+		'rte_power_kvm_vm.c', 'guest_channel.c')
+headers = files('rte_power.h')
diff --git a/lib/librte_reorder/meson.build b/lib/librte_reorder/meson.build
new file mode 100644
index 000000000..f875befd0
--- /dev/null
+++ b/lib/librte_reorder/meson.build
@@ -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 += ['mbuf']
diff --git a/lib/librte_ring/meson.build b/lib/librte_ring/meson.build
new file mode 100644
index 000000000..6f13f4f35
--- /dev/null
+++ b/lib/librte_ring/meson.build
@@ -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_ring.c')
+headers = files('rte_ring.h')
diff --git a/lib/librte_sched/meson.build b/lib/librte_sched/meson.build
new file mode 100644
index 000000000..3e30992c6
--- /dev/null
+++ b/lib/librte_sched/meson.build
@@ -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']
diff --git a/lib/librte_table/meson.build b/lib/librte_table/meson.build
new file mode 100644
index 000000000..a76aad0f2
--- /dev/null
+++ b/lib/librte_table/meson.build
@@ -0,0 +1,52 @@
+#   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_table_lpm.c', 'rte_table_lpm_ipv6.c',
+		'rte_table_hash_cuckoo.c', 'rte_table_hash_key8.c',
+		'rte_table_hash_key16.c', 'rte_table_hash_key32.c',
+		'rte_table_hash_ext.c', 'rte_table_hash_lru.c',
+		'rte_table_array.c', 'rte_table_stub.c')
+headers = files('rte_table.h', 'rte_table_lpm.h',
+		'rte_table_lpm_ipv6.h', 'rte_table_hash.h',
+		'rte_lru.h', 'rte_table_array.h',
+		'rte_table_stub.h')
+deps += ['mbuf', 'port', 'lpm', 'hash']
+
+if arch_subdir == 'x86'
+	headers += files('rte_lru_x86.h')
+endif
+
+if dpdk_conf.has('RTE_LIBRTE_ACL')
+	sources += files('rte_table_acl.c')
+	headers += files('rte_table_acl.h')
+	deps += ['acl']
+endif
diff --git a/lib/librte_timer/meson.build b/lib/librte_timer/meson.build
new file mode 100644
index 000000000..87da309f2
--- /dev/null
+++ b/lib/librte_timer/meson.build
@@ -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_timer.c')
+headers = files('rte_timer.h')
diff --git a/lib/librte_vhost/meson.build b/lib/librte_vhost/meson.build
new file mode 100644
index 000000000..7dfe3fe7a
--- /dev/null
+++ b/lib/librte_vhost/meson.build
@@ -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.
+
+if host_machine.system() != 'linux'
+	build = false
+endif
+version = 4
+sources = files('fd_man.c', 'socket.c', 'vhost.c', 'vhost_user.c',
+		'virtio_net.c')
+headers = files('rte_vhost.h')
+deps += ['ethdev']
diff --git a/lib/meson.build b/lib/meson.build
index d478a78c1..b8c4304de 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -29,4 +29,71 @@
 #   (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, and compat, just a header
 subdir('librte_eal')
+subdir('librte_compat')
+
+# process all libraries equally, as far as possible
+# "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.
+libraries = ['ring', 'mempool', 'mbuf', 'net', 'ether', # core
+	'metrics', # bitrate/latency stats depends on this
+	'hash',    # efd depends on this
+	'kvargs',  # cryptodev depends on this
+	'acl', 'bitratestats', 'cfgfile', 'cmdline', 'cryptodev',
+	'distributor', 'efd', 'eventdev', 'gro', 'ip_frag', 'jobstats',
+	'kni', 'latencystats', 'lpm', 'meter', 'power', 'pdump',
+	'reorder', 'sched', 'timer', 'vhost',
+	# add pkt framework libs which use other libs from above
+	'port', 'table', 'pipeline']
+
+foreach l:libraries
+	build = true
+	name = l
+	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 = ['eal']
+	ext_deps = []
+
+	dir_name = 'librte_' + l
+	subdir(dir_name)
+
+	if build
+		dpdk_conf.set('RTE_LIBRTE_' + name.to_upper(), 1)
+		install_headers(headers)
+
+		dep_objs = ext_deps
+		foreach d:deps
+			dep_objs += [get_variable('dep_rte_' + d)]
+		endforeach
+
+		version_map = '@0@/@1@/rte_@2@_version.map'.format(
+				meson.current_source_dir(), dir_name, name)
+		libname = 'rte_' + name
+		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,
+				link_depends: version_map,
+				version: '@0@.1'.format(version),
+				install: true)
+		dep = declare_dependency(link_with: lib,
+				include_directories: include_directories(dir_name),
+				dependencies: dep_objs)
+		set_variable('dep_' + libname, dep)
+
+		dpdk_libraries = [lib] + dpdk_libraries
+	endif
+endforeach
-- 
2.13.5

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

* [PATCH 05/17] build: add buildtools to meson build
  2017-09-01 10:03 [PATCH 00/17] build DPDK libs and some drivers with meson/ninja Bruce Richardson
                   ` (3 preceding siblings ...)
  2017-09-01 10:04 ` [PATCH 04/17] build: add DPDK libraries to build Bruce Richardson
@ 2017-09-01 10:04 ` Bruce Richardson
  2017-09-04 14:24   ` Van Haaren, Harry
  2017-09-01 10:04 ` [PATCH 06/17] build: add infrastructure for building PMDs Bruce Richardson
                   ` (13 subsequent siblings)
  18 siblings, 1 reply; 107+ messages in thread
From: Bruce Richardson @ 2017-09-01 10:04 UTC (permalink / raw)
  To: dev; +Cc: Bruce Richardson

Add the buildtools folder, and more specifically the pmdinfogen binary to
the meson and ninja build. This will be needed for building the PMDs in the
driver folder later, as the pmd info output from the tool needs to be
included in those libs.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 buildtools/gen-pmdinfo-cfile.sh   | 41 +++++++++++++++++++++++++++++++++++++
 buildtools/meson.build            | 34 +++++++++++++++++++++++++++++++
 buildtools/pmdinfogen/meson.build | 43 +++++++++++++++++++++++++++++++++++++++
 meson.build                       |  1 +
 4 files changed, 119 insertions(+)
 create mode 100755 buildtools/gen-pmdinfo-cfile.sh
 create mode 100644 buildtools/meson.build
 create mode 100644 buildtools/pmdinfogen/meson.build

diff --git a/buildtools/gen-pmdinfo-cfile.sh b/buildtools/gen-pmdinfo-cfile.sh
new file mode 100755
index 000000000..fe88e627e
--- /dev/null
+++ b/buildtools/gen-pmdinfo-cfile.sh
@@ -0,0 +1,41 @@
+#! /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.
+
+
+arfile=$1
+output=$2
+pmdinfogen=$3
+
+tmp_o=${output%.c.pmd.c}.tmp.o
+
+ar p $arfile > $tmp_o && \
+		$pmdinfogen $tmp_o $output
diff --git a/buildtools/meson.build b/buildtools/meson.build
new file mode 100644
index 000000000..a08000be0
--- /dev/null
+++ b/buildtools/meson.build
@@ -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.
+
+subdir('pmdinfogen')
+
+pmdinfo = find_program('gen-pmdinfo-cfile.sh')
diff --git a/buildtools/pmdinfogen/meson.build b/buildtools/pmdinfogen/meson.build
new file mode 100644
index 000000000..6b8a13baa
--- /dev/null
+++ b/buildtools/pmdinfogen/meson.build
@@ -0,0 +1,43 @@
+#   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.
+
+error_cflags = ['-Wno-maybe-uninitialized']
+cflags = []
+foreach arg: error_cflags
+	if cc.has_argument(arg)
+		cflags += arg
+	endif
+endforeach
+
+pmdinfogen = executable('pmdinfogen',
+	'pmdinfogen.c',
+	include_directories: eal_inc,
+	c_args: cflags)
diff --git a/meson.build b/meson.build
index f0e5741e3..d95321022 100644
--- a/meson.build
+++ b/meson.build
@@ -59,6 +59,7 @@ subdir('config')
 
 # build libs and (TODO) drivers
 subdir('lib')
+subdir('buildtools')
 
 # TODO build binaries and installable tools
 
-- 
2.13.5

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

* [PATCH 06/17] build: add infrastructure for building PMDs
  2017-09-01 10:03 [PATCH 00/17] build DPDK libs and some drivers with meson/ninja Bruce Richardson
                   ` (4 preceding siblings ...)
  2017-09-01 10:04 ` [PATCH 05/17] build: add buildtools to meson build Bruce Richardson
@ 2017-09-01 10:04 ` Bruce Richardson
  2017-09-04 14:27   ` Van Haaren, Harry
  2017-09-01 10:04 ` [PATCH 07/17] drivers/mempool: add SW mempool drivers to meson build Bruce Richardson
                   ` (12 subsequent siblings)
  18 siblings, 1 reply; 107+ messages in thread
From: Bruce Richardson @ 2017-09-01 10:04 UTC (permalink / raw)
  To: dev; +Cc: Bruce Richardson

Add in the top-level drivers meson.build file to start adding in building
of PMDs. Since all PMDs are built in pretty much the same way, the logic
for building each PMD, including extracting the pmdinfo, is included in the
top level build file. This means that each individual driver class only
needs to specify its default dependencies and a few naming conventions, and
each driver only needs to specify it's source files, headers, etc.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 drivers/meson.build | 121 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 meson.build         |   3 +-
 2 files changed, 123 insertions(+), 1 deletion(-)
 create mode 100644 drivers/meson.build

diff --git a/drivers/meson.build b/drivers/meson.build
new file mode 100644
index 000000000..35aa568c9
--- /dev/null
+++ b/drivers/meson.build
@@ -0,0 +1,121 @@
+#   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.
+
+driver_classes = []
+
+foreach class:driver_classes
+	drivers = []
+	std_deps = []
+	config_flag_fmt = '' # format string used to set the value in dpdk_conf
+	driver_name_fmt = '' # format string for driver name, used to name
+	                     # the library, the dependency and to find the
+	                     # version file for linking
+
+	subdir(class)
+
+	foreach drv:drivers
+		drv_path = join_paths(class, drv)
+
+		# 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_path)]
+		# 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 = []
+		pkgconfig_extra_libs = []
+
+		# pull in driver directory which should assign to each of the above
+		subdir(drv_path)
+
+		if build
+			dpdk_conf.set(config_flag_fmt.format(drv.to_upper()),1)
+
+			# get dependency objs from strings
+			dep_objs = []
+			foreach d:deps
+				dep_objs += [get_variable('dep_rte_' + d)]
+			endforeach
+			dep_objs += ext_deps
+			dpdk_extra_ldflags += pkgconfig_extra_libs
+
+			# generate pmdinfo sources
+			pmdinfogen_srcs = run_command('grep', '--files-with-matches',
+				'RTE_PMD_REGISTER_.*(.*)', sources).stdout().strip().split()
+			foreach src: pmdinfogen_srcs
+				out_filename = '@0@.pmd.c'.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 = driver_name_fmt.format(drv)
+			version_map = '@0@/@1@/@2@_version.map'.format(
+					meson.current_source_dir(),
+					drv_path, drv_name)
+			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: '@0@.1'.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_@0@'.format(drv_name),
+					declare_dependency(link_with: lib,
+					include_directories: includes,
+					dependencies: dep_objs))
+		endif # build
+	endforeach
+endforeach
diff --git a/meson.build b/meson.build
index d95321022..da27604bf 100644
--- a/meson.build
+++ b/meson.build
@@ -57,9 +57,10 @@ endif
 global_inc = include_directories('.', 'config')
 subdir('config')
 
-# build libs and (TODO) drivers
+# build libs and drivers
 subdir('lib')
 subdir('buildtools')
+subdir('drivers')
 
 # TODO build binaries and installable tools
 
-- 
2.13.5

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

* [PATCH 07/17] drivers/mempool: add SW mempool drivers to meson build
  2017-09-01 10:03 [PATCH 00/17] build DPDK libs and some drivers with meson/ninja Bruce Richardson
                   ` (5 preceding siblings ...)
  2017-09-01 10:04 ` [PATCH 06/17] build: add infrastructure for building PMDs Bruce Richardson
@ 2017-09-01 10:04 ` Bruce Richardson
  2017-09-04 14:28   ` Van Haaren, Harry
  2017-09-04 14:29   ` Van Haaren, Harry
  2017-09-01 10:04 ` [PATCH 08/17] drivers/crypto: add crypto drv class and null PMD to meson Bruce Richardson
                   ` (11 subsequent siblings)
  18 siblings, 2 replies; 107+ messages in thread
From: Bruce Richardson @ 2017-09-01 10:04 UTC (permalink / raw)
  To: dev; +Cc: Bruce Richardson

With build infrastructure in place, add in mempool drivers to the build.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 drivers/mempool/meson.build       | 35 +++++++++++++++++++++++++++++++++++
 drivers/mempool/ring/meson.build  | 32 ++++++++++++++++++++++++++++++++
 drivers/mempool/stack/meson.build | 32 ++++++++++++++++++++++++++++++++
 drivers/meson.build               |  2 +-
 4 files changed, 100 insertions(+), 1 deletion(-)
 create mode 100644 drivers/mempool/meson.build
 create mode 100644 drivers/mempool/ring/meson.build
 create mode 100644 drivers/mempool/stack/meson.build

diff --git a/drivers/mempool/meson.build b/drivers/mempool/meson.build
new file mode 100644
index 000000000..5b5acc0a6
--- /dev/null
+++ b/drivers/mempool/meson.build
@@ -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.
+
+drivers = ['ring', 'stack']
+std_deps = ['mempool']
+config_flag_fmt = 'RTE_LIBRTE_@0@_MEMPOOL'
+driver_name_fmt = 'rte_mempool_@0@'
diff --git a/drivers/mempool/ring/meson.build b/drivers/mempool/ring/meson.build
new file mode 100644
index 000000000..72e104315
--- /dev/null
+++ b/drivers/mempool/ring/meson.build
@@ -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')
diff --git a/drivers/mempool/stack/meson.build b/drivers/mempool/stack/meson.build
new file mode 100644
index 000000000..84856a387
--- /dev/null
+++ b/drivers/mempool/stack/meson.build
@@ -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')
diff --git a/drivers/meson.build b/drivers/meson.build
index 35aa568c9..f7d4119aa 100644
--- a/drivers/meson.build
+++ b/drivers/meson.build
@@ -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.
 
-driver_classes = []
+driver_classes = ['mempool']
 
 foreach class:driver_classes
 	drivers = []
-- 
2.13.5

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

* [PATCH 08/17] drivers/crypto: add crypto drv class and null PMD to meson
  2017-09-01 10:03 [PATCH 00/17] build DPDK libs and some drivers with meson/ninja Bruce Richardson
                   ` (6 preceding siblings ...)
  2017-09-01 10:04 ` [PATCH 07/17] drivers/mempool: add SW mempool drivers to meson build Bruce Richardson
@ 2017-09-01 10:04 ` Bruce Richardson
  2017-09-04 14:30   ` Van Haaren, Harry
  2017-09-01 10:04 ` [PATCH 09/17] crypto/openssl: add driver to meson build Bruce Richardson
                   ` (10 subsequent siblings)
  18 siblings, 1 reply; 107+ messages in thread
From: Bruce Richardson @ 2017-09-01 10:04 UTC (permalink / raw)
  To: dev; +Cc: Bruce Richardson

Add in a crypto driver class, and implement compiling the null crypto
instance.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 drivers/crypto/meson.build      | 35 +++++++++++++++++++++++++++++++++++
 drivers/crypto/null/meson.build | 33 +++++++++++++++++++++++++++++++++
 drivers/meson.build             | 13 +++++++------
 3 files changed, 75 insertions(+), 6 deletions(-)
 create mode 100644 drivers/crypto/meson.build
 create mode 100644 drivers/crypto/null/meson.build

diff --git a/drivers/crypto/meson.build b/drivers/crypto/meson.build
new file mode 100644
index 000000000..d8fbc0f71
--- /dev/null
+++ b/drivers/crypto/meson.build
@@ -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.
+
+drivers = ['null']
+std_deps = ['cryptodev'] # cryptodev pulls in all other needed deps
+config_flag_fmt = 'RTE_LIBRTE_@0@_PMD'
+driver_name_fmt = 'rte_pmd_@0@'
diff --git a/drivers/crypto/null/meson.build b/drivers/crypto/null/meson.build
new file mode 100644
index 000000000..563764b08
--- /dev/null
+++ b/drivers/crypto/null/meson.build
@@ -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.
+
+name = 'null_crypto'
+sources = files('null_crypto_pmd.c', 'null_crypto_pmd_ops.c')
diff --git a/drivers/meson.build b/drivers/meson.build
index f7d4119aa..515e3cbb6 100644
--- a/drivers/meson.build
+++ b/drivers/meson.build
@@ -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.
 
-driver_classes = ['mempool']
+driver_classes = ['crypto', 'mempool']
 
 foreach class:driver_classes
 	drivers = []
@@ -46,6 +46,7 @@ foreach class:driver_classes
 
 		# set up empty variables used for build
 		build = true # set to false to disable, e.g. missing deps
+		name = drv
 		version = 1
 		sources = []
 		objs = []
@@ -65,7 +66,7 @@ foreach class:driver_classes
 		subdir(drv_path)
 
 		if build
-			dpdk_conf.set(config_flag_fmt.format(drv.to_upper()),1)
+			dpdk_conf.set(config_flag_fmt.format(name.to_upper()),1)
 
 			# get dependency objs from strings
 			dep_objs = []
@@ -92,11 +93,11 @@ foreach class:driver_classes
 			endforeach
 
 			# now build the driver itself, and add to the drivers list
-			drv_name = driver_name_fmt.format(drv)
+			lib_name = driver_name_fmt.format(name)
 			version_map = '@0@/@1@/@2@_version.map'.format(
 					meson.current_source_dir(),
-					drv_path, drv_name)
-			lib = library(drv_name,
+					drv_path, lib_name)
+			lib = library(lib_name,
 				sources,
 				objects: objs,
 				include_directories: includes,
@@ -112,7 +113,7 @@ foreach class:driver_classes
 
 			# 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_@0@'.format(drv_name),
+			set_variable('dep_@0@'.format(lib_name),
 					declare_dependency(link_with: lib,
 					include_directories: includes,
 					dependencies: dep_objs))
-- 
2.13.5

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

* [PATCH 09/17] crypto/openssl: add driver to meson build
  2017-09-01 10:03 [PATCH 00/17] build DPDK libs and some drivers with meson/ninja Bruce Richardson
                   ` (7 preceding siblings ...)
  2017-09-01 10:04 ` [PATCH 08/17] drivers/crypto: add crypto drv class and null PMD to meson Bruce Richardson
@ 2017-09-01 10:04 ` Bruce Richardson
  2017-09-04 14:30   ` Van Haaren, Harry
  2017-09-04 14:31   ` Van Haaren, Harry
  2017-09-01 10:04 ` [PATCH 10/17] crypto/qat: " Bruce Richardson
                   ` (9 subsequent siblings)
  18 siblings, 2 replies; 107+ messages in thread
From: Bruce Richardson @ 2017-09-01 10:04 UTC (permalink / raw)
  To: dev; +Cc: Bruce Richardson

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 drivers/crypto/meson.build         |  2 +-
 drivers/crypto/openssl/meson.build | 38 ++++++++++++++++++++++++++++++++++++++
 2 files changed, 39 insertions(+), 1 deletion(-)
 create mode 100644 drivers/crypto/openssl/meson.build

diff --git a/drivers/crypto/meson.build b/drivers/crypto/meson.build
index d8fbc0f71..4aeda71a2 100644
--- a/drivers/crypto/meson.build
+++ b/drivers/crypto/meson.build
@@ -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 = ['null']
+drivers = ['null', 'openssl']
 std_deps = ['cryptodev'] # cryptodev pulls in all other needed deps
 config_flag_fmt = 'RTE_LIBRTE_@0@_PMD'
 driver_name_fmt = 'rte_pmd_@0@'
diff --git a/drivers/crypto/openssl/meson.build b/drivers/crypto/openssl/meson.build
new file mode 100644
index 000000000..eb7f10226
--- /dev/null
+++ b/drivers/crypto/openssl/meson.build
@@ -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.
+
+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 += dep
+pkgconfig_extra_libs += '-lcrypto'
-- 
2.13.5

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

* [PATCH 10/17] crypto/qat: add driver to meson build
  2017-09-01 10:03 [PATCH 00/17] build DPDK libs and some drivers with meson/ninja Bruce Richardson
                   ` (8 preceding siblings ...)
  2017-09-01 10:04 ` [PATCH 09/17] crypto/openssl: add driver to meson build Bruce Richardson
@ 2017-09-01 10:04 ` Bruce Richardson
  2017-09-04 14:32   ` Van Haaren, Harry
  2017-09-01 10:04 ` [PATCH 11/17] drivers/net: add net driver support " Bruce Richardson
                   ` (8 subsequent siblings)
  18 siblings, 1 reply; 107+ messages in thread
From: Bruce Richardson @ 2017-09-01 10:04 UTC (permalink / raw)
  To: dev; +Cc: Bruce Richardson

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 config/rte_config.h            |  8 ++++++++
 drivers/crypto/meson.build     |  2 +-
 drivers/crypto/qat/meson.build | 41 +++++++++++++++++++++++++++++++++++++++++
 3 files changed, 50 insertions(+), 1 deletion(-)
 create mode 100644 drivers/crypto/qat/meson.build

diff --git a/config/rte_config.h b/config/rte_config.h
index 7fb6c4cce..49af312d2 100644
--- a/config/rte_config.h
+++ b/config/rte_config.h
@@ -94,4 +94,12 @@
 #define RTE_SCHED_PORT_N_GRINDERS 8
 #undef RTE_SCHED_VECTOR
 
+/****** driver defines ********/
+
+/*
+ * 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_ */
diff --git a/drivers/crypto/meson.build b/drivers/crypto/meson.build
index 4aeda71a2..fd07c29a7 100644
--- a/drivers/crypto/meson.build
+++ b/drivers/crypto/meson.build
@@ -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 = ['null', 'openssl']
+drivers = ['qat', 'null', 'openssl']
 std_deps = ['cryptodev'] # cryptodev pulls in all other needed deps
 config_flag_fmt = 'RTE_LIBRTE_@0@_PMD'
 driver_name_fmt = 'rte_pmd_@0@'
diff --git a/drivers/crypto/qat/meson.build b/drivers/crypto/qat/meson.build
new file mode 100644
index 000000000..7d959e7f5
--- /dev/null
+++ b/drivers/crypto/qat/meson.build
@@ -0,0 +1,41 @@
+#   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.
+
+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 += dep
+pkgconfig_extra_libs += '-lcrypto'
-- 
2.13.5

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

* [PATCH 11/17] drivers/net: add net driver support to meson build
  2017-09-01 10:03 [PATCH 00/17] build DPDK libs and some drivers with meson/ninja Bruce Richardson
                   ` (9 preceding siblings ...)
  2017-09-01 10:04 ` [PATCH 10/17] crypto/qat: " Bruce Richardson
@ 2017-09-01 10:04 ` Bruce Richardson
  2017-09-04 14:32   ` Van Haaren, Harry
  2017-09-01 10:04 ` [PATCH 12/17] drivers/net: add set of vdev PMDs to build Bruce Richardson
                   ` (7 subsequent siblings)
  18 siblings, 1 reply; 107+ messages in thread
From: Bruce Richardson @ 2017-09-01 10:04 UTC (permalink / raw)
  To: dev; +Cc: Bruce Richardson

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 drivers/meson.build     |  2 +-
 drivers/net/meson.build | 35 +++++++++++++++++++++++++++++++++++
 2 files changed, 36 insertions(+), 1 deletion(-)
 create mode 100644 drivers/net/meson.build

diff --git a/drivers/meson.build b/drivers/meson.build
index 515e3cbb6..d7a614f83 100644
--- a/drivers/meson.build
+++ b/drivers/meson.build
@@ -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.
 
-driver_classes = ['crypto', 'mempool']
+driver_classes = ['crypto', 'mempool', 'net']
 
 foreach class:driver_classes
 	drivers = []
diff --git a/drivers/net/meson.build b/drivers/net/meson.build
new file mode 100644
index 000000000..63b85d51c
--- /dev/null
+++ b/drivers/net/meson.build
@@ -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.
+
+drivers = []
+std_deps = ['ethdev', 'kvargs'] # 'ethdev' also pulls in mbuf, net, eal etc
+config_flag_fmt = 'RTE_LIBRTE_@0@_PMD'
+driver_name_fmt = 'rte_pmd_@0@'
-- 
2.13.5

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

* [PATCH 12/17] drivers/net: add set of vdev PMDs to build
  2017-09-01 10:03 [PATCH 00/17] build DPDK libs and some drivers with meson/ninja Bruce Richardson
                   ` (10 preceding siblings ...)
  2017-09-01 10:04 ` [PATCH 11/17] drivers/net: add net driver support " Bruce Richardson
@ 2017-09-01 10:04 ` Bruce Richardson
  2017-09-04 14:34   ` Van Haaren, Harry
  2017-09-01 10:04 ` [PATCH 13/17] drivers/net: add drivers for Intel NICs to meson build Bruce Richardson
                   ` (6 subsequent siblings)
  18 siblings, 1 reply; 107+ messages in thread
From: Bruce Richardson @ 2017-09-01 10:04 UTC (permalink / raw)
  To: dev; +Cc: Bruce Richardson

Add the af_packet, null, pcap and ring PMDs to the meson build.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 config/rte_config.h               |  4 ++++
 drivers/net/af_packet/meson.build | 35 +++++++++++++++++++++++++++++++++
 drivers/net/meson.build           |  2 +-
 drivers/net/null/meson.build      | 32 ++++++++++++++++++++++++++++++
 drivers/net/pcap/meson.build      | 41 +++++++++++++++++++++++++++++++++++++++
 drivers/net/ring/meson.build      | 33 +++++++++++++++++++++++++++++++
 6 files changed, 146 insertions(+), 1 deletion(-)
 create mode 100644 drivers/net/af_packet/meson.build
 create mode 100644 drivers/net/null/meson.build
 create mode 100644 drivers/net/pcap/meson.build
 create mode 100644 drivers/net/ring/meson.build

diff --git a/config/rte_config.h b/config/rte_config.h
index 49af312d2..e60d1934c 100644
--- a/config/rte_config.h
+++ b/config/rte_config.h
@@ -102,4 +102,8 @@
  */
 #define RTE_QAT_PMD_MAX_NB_SESSIONS 2048
 
+/* Ring net PMD settings */
+#define RTE_PMD_RING_MAX_RX_RINGS 16
+#define RTE_PMD_RING_MAX_TX_RINGS 16
+
 #endif /* _RTE_CONFIG_H_ */
diff --git a/drivers/net/af_packet/meson.build b/drivers/net/af_packet/meson.build
new file mode 100644
index 000000000..c0dcc9b1f
--- /dev/null
+++ b/drivers/net/af_packet/meson.build
@@ -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.
+
+if host_machine.system() != 'linux'
+	build = false
+endif
+sources = files('rte_eth_af_packet.c')
diff --git a/drivers/net/meson.build b/drivers/net/meson.build
index 63b85d51c..82c734511 100644
--- a/drivers/net/meson.build
+++ b/drivers/net/meson.build
@@ -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 = []
+drivers = ['af_packet', 'null', 'pcap', 'ring']
 std_deps = ['ethdev', 'kvargs'] # 'ethdev' also pulls in mbuf, net, eal etc
 config_flag_fmt = 'RTE_LIBRTE_@0@_PMD'
 driver_name_fmt = 'rte_pmd_@0@'
diff --git a/drivers/net/null/meson.build b/drivers/net/null/meson.build
new file mode 100644
index 000000000..36a42170a
--- /dev/null
+++ b/drivers/net/null/meson.build
@@ -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_null.c')
diff --git a/drivers/net/pcap/meson.build b/drivers/net/pcap/meson.build
new file mode 100644
index 000000000..2cfe76410
--- /dev/null
+++ b/drivers/net/pcap/meson.build
@@ -0,0 +1,41 @@
+#   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.
+
+pcap_dep = dependency('pcap', required: false)
+if pcap_dep.found() == true
+	ext_deps += pcap_dep
+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'
diff --git a/drivers/net/ring/meson.build b/drivers/net/ring/meson.build
new file mode 100644
index 000000000..d26645a45
--- /dev/null
+++ b/drivers/net/ring/meson.build
@@ -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_eth_ring.c')
+install_headers('rte_eth_ring.h')
-- 
2.13.5

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

* [PATCH 13/17] drivers/net: add drivers for Intel NICs to meson build
  2017-09-01 10:03 [PATCH 00/17] build DPDK libs and some drivers with meson/ninja Bruce Richardson
                   ` (11 preceding siblings ...)
  2017-09-01 10:04 ` [PATCH 12/17] drivers/net: add set of vdev PMDs to build Bruce Richardson
@ 2017-09-01 10:04 ` Bruce Richardson
  2017-09-01 10:04 ` [PATCH 14/17] app/test-pmd: add test-pmd " Bruce Richardson
                   ` (5 subsequent siblings)
  18 siblings, 0 replies; 107+ messages in thread
From: Bruce Richardson @ 2017-09-01 10:04 UTC (permalink / raw)
  To: dev; +Cc: Bruce Richardson

Add the e1000, fm10k, i40e and ixgbe drivers to the meson & ninja build.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 config/rte_config.h                | 12 +++++++
 drivers/net/e1000/base/meson.build | 65 ++++++++++++++++++++++++++++++++++++++
 drivers/net/e1000/meson.build      | 44 ++++++++++++++++++++++++++
 drivers/net/fm10k/base/meson.build | 55 ++++++++++++++++++++++++++++++++
 drivers/net/fm10k/meson.build      | 44 ++++++++++++++++++++++++++
 drivers/net/i40e/base/meson.build  | 56 ++++++++++++++++++++++++++++++++
 drivers/net/i40e/meson.build       | 60 +++++++++++++++++++++++++++++++++++
 drivers/net/ixgbe/base/meson.build | 60 +++++++++++++++++++++++++++++++++++
 drivers/net/ixgbe/meson.build      | 58 ++++++++++++++++++++++++++++++++++
 drivers/net/meson.build            |  3 +-
 10 files changed, 456 insertions(+), 1 deletion(-)
 create mode 100644 drivers/net/e1000/base/meson.build
 create mode 100644 drivers/net/e1000/meson.build
 create mode 100644 drivers/net/fm10k/base/meson.build
 create mode 100644 drivers/net/fm10k/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

diff --git a/config/rte_config.h b/config/rte_config.h
index e60d1934c..54a71c14e 100644
--- a/config/rte_config.h
+++ b/config/rte_config.h
@@ -102,6 +102,18 @@
  */
 #define RTE_QAT_PMD_MAX_NB_SESSIONS 2048
 
+/* fm10k defines */
+#define RTE_LIBRTE_FM10K_RX_OLFLAGS_ENABLE 1
+
+/* i40e defines */
+#define RTE_LIBRTE_I40E_RX_ALLOW_BULK_ALLOC 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
+
 /* Ring net PMD settings */
 #define RTE_PMD_RING_MAX_RX_RINGS 16
 #define RTE_PMD_RING_MAX_TX_RINGS 16
diff --git a/drivers/net/e1000/base/meson.build b/drivers/net/e1000/base/meson.build
new file mode 100644
index 000000000..d3c700013
--- /dev/null
+++ b/drivers/net/e1000/base/meson.build
@@ -0,0 +1,65 @@
+#   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 = [
+	'e1000_80003es2lan.c',
+	'e1000_82540.c',
+	'e1000_82541.c',
+	'e1000_82542.c',
+	'e1000_82543.c',
+	'e1000_82571.c',
+	'e1000_82575.c',
+	'e1000_api.c',
+	'e1000_i210.c',
+	'e1000_ich8lan.c',
+	'e1000_mac.c',
+	'e1000_manage.c',
+	'e1000_mbx.c',
+	'e1000_nvm.c',
+	'e1000_osdep.c',
+	'e1000_phy.c',
+	'e1000_vf.c'
+]
+
+error_cflags = ['-Wno-uninitialized', '-Wno-unused-parameter',
+	'-Wno-unused-variable', '-Wno-misleading-indentation',
+	'-Wno-implicit-fallthrough']
+c_args = cflags
+foreach flag: error_cflags
+	if cc.has_argument(flag)
+		c_args += flag
+	endif
+endforeach
+
+base_lib = static_library('e1000_base', sources,
+	dependencies: rte_eal,
+	c_args: c_args)
+base_objs = base_lib.extract_all_objects()
diff --git a/drivers/net/e1000/meson.build b/drivers/net/e1000/meson.build
new file mode 100644
index 000000000..0ec01154e
--- /dev/null
+++ b/drivers/net/e1000/meson.build
@@ -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.
+
+subdir('base')
+objs = [base_objs]
+
+sources = files(
+	'em_ethdev.c',
+	'em_rxtx.c',
+	'igb_ethdev.c',
+	'igb_flow.c',
+	'igb_pf.c',
+	'igb_rxtx.c'
+)
+
+includes += include_directories('base')
diff --git a/drivers/net/fm10k/base/meson.build b/drivers/net/fm10k/base/meson.build
new file mode 100644
index 000000000..6d4678afa
--- /dev/null
+++ b/drivers/net/fm10k/base/meson.build
@@ -0,0 +1,55 @@
+#   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 = [
+	'fm10k_api.c',
+	'fm10k_common.c',
+	'fm10k_mbx.c',
+	'fm10k_pf.c',
+	'fm10k_tlv.c',
+	'fm10k_vf.c'
+]
+
+error_cflags = ['-Wno-unused-parameter', '-Wno-unused-value',
+	'-Wno-strict-aliasing', '-Wno-format-extra-args',
+	'-Wno-unused-variable', '-Wno-missing-field-initializers'
+]
+c_args = cflags
+foreach flag: error_cflags
+	if cc.has_argument(flag)
+		c_args += flag
+	endif
+endforeach
+
+base_lib = static_library('fm10k_base', sources,
+	dependencies: rte_eal,
+	c_args: c_args)
+base_objs = base_lib.extract_all_objects()
diff --git a/drivers/net/fm10k/meson.build b/drivers/net/fm10k/meson.build
new file mode 100644
index 000000000..f08e55ed1
--- /dev/null
+++ b/drivers/net/fm10k/meson.build
@@ -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.
+
+subdir('base')
+objs = [base_objs]
+
+sources = files(
+	'fm10k_ethdev.c',
+	'fm10k_rxtx.c',
+)
+if arch_subdir == 'x86'
+	dpdk_conf.set('RTE_LIBRTE_FM10K_INC_VECTOR', 1)
+	sources += files('fm10k_rxtx_vec.c')
+endif
+
+includes += include_directories('base')
diff --git a/drivers/net/i40e/base/meson.build b/drivers/net/i40e/base/meson.build
new file mode 100644
index 000000000..a7d5f6bbb
--- /dev/null
+++ b/drivers/net/i40e/base/meson.build
@@ -0,0 +1,56 @@
+#   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 = [
+	'i40e_adminq.c',
+	'i40e_common.c',
+	'i40e_dcb.c',
+	'i40e_diag.c',
+	'i40e_hmc.c',
+	'i40e_lan_hmc.c',
+	'i40e_nvm.c'
+]
+
+error_cflags = ['-Wno-sign-compare', '-Wno-unused-value',
+		'-Wno-format', '-Wno-unused-but-set-variable',
+		'-Wno-strict-aliasing'
+]
+c_args = cflags
+foreach flag: error_cflags
+	if cc.has_argument(flag)
+		c_args += flag
+	endif
+endforeach
+
+base_lib = static_library('i40e_base', sources,
+	dependencies: rte_eal,
+	c_args: c_args)
+base_objs = base_lib.extract_all_objects()
diff --git a/drivers/net/i40e/meson.build b/drivers/net/i40e/meson.build
new file mode 100644
index 000000000..84d700cad
--- /dev/null
+++ b/drivers/net/i40e/meson.build
@@ -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.
+
+cflags = ['-DPF_DRIVER',
+	'-DVF_DRIVER',
+	'-DINTEGRATED_VF',
+	'-DX722_A0_SUPPORT']
+
+subdir('base')
+objs = [base_objs]
+
+sources = files(
+	'i40e_ethdev.c',
+	'i40e_rxtx.c',
+	'i40e_ethdev_vf.c',
+	'i40e_pf.c',
+	'i40e_fdir.c',
+	'i40e_flow.c',
+	'i40e_tm.c',
+	'rte_pmd_i40e.c'
+	)
+
+deps += ['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')
+
+install_headers('rte_pmd_i40e.h')
diff --git a/drivers/net/ixgbe/base/meson.build b/drivers/net/ixgbe/base/meson.build
new file mode 100644
index 000000000..2f3fe0491
--- /dev/null
+++ b/drivers/net/ixgbe/base/meson.build
@@ -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.
+
+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)
+base_objs = base_lib.extract_all_objects()
diff --git a/drivers/net/ixgbe/meson.build b/drivers/net/ixgbe/meson.build
new file mode 100644
index 000000000..32c10a5e2
--- /dev/null
+++ b/drivers/net/ixgbe/meson.build
@@ -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.
+
+cflags = ['-DRTE_LIBRTE_IXGBE_BYPASS']
+
+subdir('base')
+objs = [base_objs]
+
+sources = files(
+	'ixgbe_82599_bypass.c',
+	'ixgbe_bypass.c',
+	'ixgbe_ethdev.c',
+	'ixgbe_fdir.c',
+	'ixgbe_flow.c',
+	'ixgbe_pf.c',
+	'ixgbe_rxtx.c',
+	'ixgbe_tm.c',
+	'rte_pmd_ixgbe.c'
+)
+
+deps += ['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')
+
+install_headers('rte_pmd_ixgbe.h')
diff --git a/drivers/net/meson.build b/drivers/net/meson.build
index 82c734511..cc8a03800 100644
--- a/drivers/net/meson.build
+++ b/drivers/net/meson.build
@@ -29,7 +29,8 @@
 #   (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 = ['af_packet', 'null', 'pcap', 'ring']
+drivers = ['af_packet', 'e1000', 'fm10k', 'i40e', 'ixgbe',
+	'null', 'pcap', 'ring']
 std_deps = ['ethdev', 'kvargs'] # 'ethdev' also pulls in mbuf, net, eal etc
 config_flag_fmt = 'RTE_LIBRTE_@0@_PMD'
 driver_name_fmt = 'rte_pmd_@0@'
-- 
2.13.5

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

* [PATCH 14/17] app/test-pmd: add test-pmd to meson build
  2017-09-01 10:03 [PATCH 00/17] build DPDK libs and some drivers with meson/ninja Bruce Richardson
                   ` (12 preceding siblings ...)
  2017-09-01 10:04 ` [PATCH 13/17] drivers/net: add drivers for Intel NICs to meson build Bruce Richardson
@ 2017-09-01 10:04 ` Bruce Richardson
  2017-09-04 15:01   ` Van Haaren, Harry
  2017-09-01 10:04 ` [PATCH 15/17] usertools: add usertools installation " Bruce Richardson
                   ` (4 subsequent siblings)
  18 siblings, 1 reply; 107+ messages in thread
From: Bruce Richardson @ 2017-09-01 10:04 UTC (permalink / raw)
  To: dev; +Cc: Bruce Richardson

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 app/meson.build          | 32 +++++++++++++++++++++
 app/test-pmd/meson.build | 74 ++++++++++++++++++++++++++++++++++++++++++++++++
 meson.build              |  3 +-
 3 files changed, 108 insertions(+), 1 deletion(-)
 create mode 100644 app/meson.build
 create mode 100644 app/test-pmd/meson.build

diff --git a/app/meson.build b/app/meson.build
new file mode 100644
index 000000000..bdf043ead
--- /dev/null
+++ b/app/meson.build
@@ -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')
diff --git a/app/test-pmd/meson.build b/app/test-pmd/meson.build
new file mode 100644
index 000000000..a0f959fb9
--- /dev/null
+++ b/app/test-pmd/meson.build
@@ -0,0 +1,74 @@
+#   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('cmdline.c',
+	'cmdline_flow.c',
+	'config.c',
+	'csumonly.c',
+	'flowgen.c',
+	'icmpecho.c',
+	'ieee1588fwd.c',
+	'iofwd.c',
+	'macfwd.c',
+	'macswap.c',
+	'parameters.c',
+	'rxonly.c',
+	'testpmd.c',
+	'txonly.c')
+
+deps = ['ethdev', 'gro', 'cmdline', 'metrics']
+if dpdk_conf.has('RTE_LIBRTE_PDUMP')
+	deps += 'pdump'
+endif
+if dpdk_conf.has('RTE_LIBRTE_I40E_PMD')
+	deps += 'pmd_i40e'
+endif
+if dpdk_conf.has('RTE_LIBRTE_IXGBE_PMD')
+	deps += 'pmd_ixgbe'
+endif
+
+dep_objs = []
+foreach d:deps
+	dep_objs += get_variable('dep_rte_' + d)
+endforeach
+
+link_libs = []
+if get_option('default_library') == 'static'
+	link_libs = dpdk_drivers
+endif
+
+executable('dpdk-testpmd',
+	sources,
+	link_whole: link_libs,
+	dependencies: dep_objs,
+	link_args: eal_extra_link_arg, # add -ldl for linux, -lexecinfo for BSD
+	install_rpath: driver_install_path,
+	install: true)
diff --git a/meson.build b/meson.build
index da27604bf..51acfead8 100644
--- a/meson.build
+++ b/meson.build
@@ -62,7 +62,8 @@ subdir('lib')
 subdir('buildtools')
 subdir('drivers')
 
-# TODO build binaries and installable tools
+# build binaries and (TODO) installable tools
+subdir('app')
 
 # write the build config
 build_cfg = 'rte_build_config.h'
-- 
2.13.5

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

* [PATCH 15/17] usertools: add usertools installation to meson build
  2017-09-01 10:03 [PATCH 00/17] build DPDK libs and some drivers with meson/ninja Bruce Richardson
                   ` (13 preceding siblings ...)
  2017-09-01 10:04 ` [PATCH 14/17] app/test-pmd: add test-pmd " Bruce Richardson
@ 2017-09-01 10:04 ` Bruce Richardson
  2017-09-04 15:00   ` Van Haaren, Harry
  2017-09-01 10:04 ` [PATCH 16/17] build: add option to version libs using DPDK version Bruce Richardson
                   ` (3 subsequent siblings)
  18 siblings, 1 reply; 107+ messages in thread
From: Bruce Richardson @ 2017-09-01 10:04 UTC (permalink / raw)
  To: dev; +Cc: Bruce Richardson

Have the "usertools" scripts installed when doing a DPDK install using
ninja. They will be copies to $prefix/bin, generally /usr/local/bin,
alongside testpmd.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 meson.build           |  3 ++-
 usertools/meson.build | 32 ++++++++++++++++++++++++++++++++
 2 files changed, 34 insertions(+), 1 deletion(-)
 create mode 100644 usertools/meson.build

diff --git a/meson.build b/meson.build
index 51acfead8..06f606671 100644
--- a/meson.build
+++ b/meson.build
@@ -62,7 +62,8 @@ subdir('lib')
 subdir('buildtools')
 subdir('drivers')
 
-# build binaries and (TODO) installable tools
+# build binaries and installable tools
+subdir('usertools')
 subdir('app')
 
 # write the build config
diff --git a/usertools/meson.build b/usertools/meson.build
new file mode 100644
index 000000000..977cd8b58
--- /dev/null
+++ b/usertools/meson.build
@@ -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')
-- 
2.13.5

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

* [PATCH 16/17] build: add option to version libs using DPDK version
  2017-09-01 10:03 [PATCH 00/17] build DPDK libs and some drivers with meson/ninja Bruce Richardson
                   ` (14 preceding siblings ...)
  2017-09-01 10:04 ` [PATCH 15/17] usertools: add usertools installation " Bruce Richardson
@ 2017-09-01 10:04 ` Bruce Richardson
  2017-09-07 17:07   ` [dpdk-dev, " Neil Horman
  2017-09-01 10:04 ` [PATCH 17/17] doc: add documentation on how to add new components to DPDK Bruce Richardson
                   ` (2 subsequent siblings)
  18 siblings, 1 reply; 107+ messages in thread
From: Bruce Richardson @ 2017-09-01 10:04 UTC (permalink / raw)
  To: dev; +Cc: Bruce Richardson

Normally, each library has it's own version number based on the ABI.
Add an option to have all libs just use the DPDK version number as the
.so version.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 drivers/meson.build | 8 +++++++-
 lib/meson.build     | 8 +++++++-
 meson_options.txt   | 1 +
 3 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/drivers/meson.build b/drivers/meson.build
index d7a614f83..76d610a5b 100644
--- a/drivers/meson.build
+++ b/drivers/meson.build
@@ -92,6 +92,12 @@ foreach class:driver_classes
 						depends: [pmdinfogen, tmp_lib])
 			endforeach
 
+			if get_option('per_library_versions')
+				so_version = '@0@.1'.format(version)
+			else
+				so_version = meson.project_version()
+			endif
+
 			# now build the driver itself, and add to the drivers list
 			lib_name = driver_name_fmt.format(name)
 			version_map = '@0@/@1@/@2@_version.map'.format(
@@ -105,7 +111,7 @@ foreach class:driver_classes
 				c_args: cflags,
 				link_args: '-Wl,--version-script=' + version_map,
 				link_depends: version_map,
-				version: '@0@.1'.format(version),
+				version: so_version,
 				install: true,
 				install_dir: driver_install_path)
 
diff --git a/lib/meson.build b/lib/meson.build
index b8c4304de..e20a9ab59 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -76,6 +76,12 @@ foreach l:libraries
 			dep_objs += [get_variable('dep_rte_' + d)]
 		endforeach
 
+		if get_option('per_library_versions')
+			so_version = '@0@.1'.format(version)
+		else
+			so_version = meson.project_version()
+		endif
+
 		version_map = '@0@/@1@/rte_@2@_version.map'.format(
 				meson.current_source_dir(), dir_name, name)
 		libname = 'rte_' + name
@@ -87,7 +93,7 @@ foreach l:libraries
 				include_directories: include_directories(dir_name),
 				link_args: '-Wl,--version-script=' + version_map,
 				link_depends: version_map,
-				version: '@0@.1'.format(version),
+				version: so_version,
 				install: true)
 		dep = declare_dependency(link_with: lib,
 				include_directories: include_directories(dir_name),
diff --git a/meson_options.txt b/meson_options.txt
index 9c45b8159..636226ce8 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -6,3 +6,4 @@ 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')
 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')
+option('per_library_versions', type: 'boolean', value: true, description: 'true: each lib gets its own version number, false: DPDK version used for each lib')
-- 
2.13.5

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

* [PATCH 17/17] doc: add documentation on how to add new components to DPDK
  2017-09-01 10:03 [PATCH 00/17] build DPDK libs and some drivers with meson/ninja Bruce Richardson
                   ` (15 preceding siblings ...)
  2017-09-01 10:04 ` [PATCH 16/17] build: add option to version libs using DPDK version Bruce Richardson
@ 2017-09-01 10:04 ` Bruce Richardson
  2017-09-01 10:38 ` [PATCH 00/17] build DPDK libs and some drivers with meson/ninja Bruce Richardson
  2017-09-12 10:37 ` [PATCH v2 " Bruce Richardson
  18 siblings, 0 replies; 107+ messages in thread
From: Bruce Richardson @ 2017-09-01 10:04 UTC (permalink / raw)
  To: dev; +Cc: Bruce Richardson

Add to the contributors guide details on how to add libraries and drivers
and integrate them with the DPDK build system(s).

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 doc/guides/contributing/coding_style.rst | 214 +++++++++++++++++++++++++++++++
 1 file changed, 214 insertions(+)

diff --git a/doc/guides/contributing/coding_style.rst b/doc/guides/contributing/coding_style.rst
index d8e4a0f9c..3c59cbca5 100644
--- a/doc/guides/contributing/coding_style.rst
+++ b/doc/guides/contributing/coding_style.rst
@@ -702,3 +702,217 @@ All Python code should work with Python 2.7+ and 3.2+ and be compliant with
 `PEP8 (Style Guide for Python Code) <https://www.python.org/dev/peps/pep-0008/>`_.
 
 The ``pep8`` tool can be used for testing compliance with the guidelines.
+
+Integrating with the Build System
+---------------------------------
+
+DPDK supports being built in two different ways:
+
+* using ``make`` - or more specifically "GNU make", i.e. ``gmake`` on FreeBSD
+* using the tools ``meson`` and ``ninja``
+
+Any new library or driver to be integrated into DPDK should support being
+built with both systems. While building using ``make`` is a legacy approach, and
+most build-system enhancements are being done using ``meson`` and ``ninja``
+there are no plans at this time to deprecate the legacy ``make`` build system.
+
+Therefore all new component additions should include both a ``Makefile`` and a
+``meson.build`` file, and should be added to the component lists in both the
+``Makefile`` and ``meson.build`` files in the relevant top-level directory:
+either ``lib`` directory or a ``driver`` subdirectory.
+
+Makefile Contents
+~~~~~~~~~~~~~~~~~
+
+The ``Makefile`` for the component should be of the following format, where
+``<name>`` corresponds to the name of the library in question, e.g. hash,
+lpm, etc. For drivers, the same format of Makefile is used.
+
+.. code-block:: makefile
+
+	# pull in basic DPDK definitions, including whether library is to be
+	# built or not
+	include $(RTE_SDK)/mk/rte.vars.mk
+
+	# library name
+	LIB = librte_<name>.a
+
+	# any library cflags needed. Generally add "-O3 $(WERROR_FLAGS)"
+	CFLAGS += -O3
+	CFLAGS += $(WERROR_FLAGS)
+
+	# the symbol version information for the library, and .so version
+	EXPORT_MAP := rte_<name>_version.map
+	LIBABIVER := 1
+
+	# all source filenames are stored in SRCS-y
+	SRCS-$(CONFIG_RTE_LIBRTE_<NAME>) += rte_<name>.c
+
+	# install includes
+	SYMLINK-$(CONFIG_RTE_LIBRTE_<NAME>)-include += rte_<name>.h
+
+	# pull in rules to build the library
+	include $(RTE_SDK)/mk/rte.lib.mk
+
+Meson Build File Contents - Libraries
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+The ``meson.build`` file for a new DPDK library should be of the following basic
+format.
+
+.. code-block:: python
+
+	sources = files('file1.c', ...)
+	headers = files('file1.c', ...)
+
+
+The will build based on a number of conventions and assumptions within the DPDK
+itself, for example, that the library name is the same as the directory name in
+which the files are stored.
+
+For a library ``meson.build`` file, there are number of variables which can be
+set, some mandatory, others optional. The mandatory fields are:
+
+sources
+	**Default Value = []**.
+	This variable should list out the files to be compiled up to create the
+	library. Files must be specified using the meson ``files()`` function.
+
+
+The optional fields are:
+
+build
+	**Default Value = true.**
+	Used to optionally compile a library, based on its dependencies or
+	environment. A simple example of use would be:
+
+.. code-block:: python
+
+	if host_machine.system() != 'linux'
+	        build = false
+	endif
+
+
+cflags
+	**Default Value = []**.
+	Used to specify any additional cflags that need to be passed to compile
+	the sources in the library.
+
+deps
+	**Default Value = ['eal']**.
+	Used to list the internal library dependencies of the library. It should
+	be assigned to using ``+=`` rather than overwriting using ``=``.  The
+	dependencies should be specified as strings, each one giving the name of
+	a DPDK library, without the ``librte_`` prefix. Dependencies are handled
+	recursively, so specifying e.g. ``mempool``, will automatically also
+	make the library depend upon the mempool library's dependencies too -
+	``ring`` and ``eal``. For libraries that only depend upon EAL, this
+	variable may be omitted from the ``meson.build`` file.  For example:
+
+.. code-block:: python
+
+	deps += ['ethdev']
+
+
+ext_deps
+	**Default Value = []**.
+	Used to specify external dependencies of this library. They should be
+	returned as dependency objects, as returned from the meson
+	``dependency()`` or ``find_library()`` functions. Before returning
+	these, they should be checked to ensure the dependencies have been
+	found, and, if not, the ``build`` variable should be set to ``false``.
+	For example:
+
+.. code-block:: python
+
+	my_dep = dependency('libX', required: 'false')
+	if my_dep.found()
+		ext_deps += my_dep
+	else
+		build = false
+	endif
+
+
+headers
+	**Default Value = []**.
+	Used to return the list of header files for the library that should be
+	installed to $PREFIX/include when ``ninja install`` is run. As with
+	source files, these should be specified using the meson ``files()``
+	function.
+
+name
+	**Default Value = library name derived from the directory name**.
+	If a library's .so or .a file differs from that given in the directory
+	name, the name should be specified using this variable. In practice,
+	since the convention is that for a library called ``librte_xyz.so``, the
+	sources are stored in a directory ``lib/librte_xyz``, this value should
+	never be needed for new libraries.
+
+.. note::
+
+	The name value also provides the name used to find the function version
+	map file, as part of the build process, so if the directory name and
+	library names differ, the ``version.map`` file should be named
+	consistently with the library, not the directory
+
+objs
+	**Default Value = []**.
+	This variable can be used to pass to the library build some pre-built
+	objects that were compiled up as part of another target given in the
+	included library ``meson.build`` file.
+
+version
+	**Default Value = 1**.
+	Specifies the ABI version of the library, and is used as the major
+	version number of the resulting ``.so`` library.
+
+Meson Build File Contents - Drivers
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+For drivers, the values are largely the same as for libraries. The variables
+supported are:
+
+build
+	As above.
+
+cflags
+	As above.
+
+deps
+	As above.
+
+ext_deps
+	As above.
+
+includes
+	**Default Value = <driver directory>** Some drivers include a base
+	directory for additional source files and headers, so we have this
+	variable to allow the headers from that base directory to be found when
+	compiling driver sources. Should be appended to using ``+=`` rather than
+	overwritten using ``=``.  The values appended should be meson include
+	objects got using the ``include_directories()`` function. For example:
+
+.. code-block:: python
+
+	includes += include_directories('base')
+
+name
+	As above, though note that each driver class can define it's own naming
+	scheme for the resulting ``.so`` files.
+
+objs
+	As above, generally used for the contents of the ``base`` directory.
+
+pkgconfig_extra_libs
+	**Default Value = []**
+	This variable is used to pass additional library link flags through to
+	the DPDK pkgconfig file generated, for example, to track any additional
+	libraries that may need to be linked into the build - especially when
+	using static libraries. Anything added here will be appended to the end
+	of the ``pkgconfig --libs`` output.
+
+sources [mandatory]
+	As above
+
+version
+	As above
-- 
2.13.5

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

* Re: [PATCH 00/17] build DPDK libs and some drivers with meson/ninja
  2017-09-01 10:03 [PATCH 00/17] build DPDK libs and some drivers with meson/ninja Bruce Richardson
                   ` (16 preceding siblings ...)
  2017-09-01 10:04 ` [PATCH 17/17] doc: add documentation on how to add new components to DPDK Bruce Richardson
@ 2017-09-01 10:38 ` Bruce Richardson
  2017-09-12 10:37 ` [PATCH v2 " Bruce Richardson
  18 siblings, 0 replies; 107+ messages in thread
From: Bruce Richardson @ 2017-09-01 10:38 UTC (permalink / raw)
  To: dev

On Fri, Sep 01, 2017 at 11:03:59AM +0100, Bruce Richardson wrote:
> Following on from the two previous RFCs [1] [2], here is a cleaned up
> patchset to serve as a start-point for getting all of DPDK building with
> meson and ninja.
> 

Just for reference, I've test-compiled this on, Fedora 26 with clang and
gcc for both static and shared builds, and similarly on FreeBSD 10 for
clang and gcc with static and shared builds. Some basic compile testing
also done on BSD 11.

/Bruce

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

* Re: [PATCH 03/17] igb_uio: add igb_uio kmod to meson build
  2017-09-01 10:04 ` [PATCH 03/17] igb_uio: add igb_uio kmod " Bruce Richardson
@ 2017-09-01 13:32   ` Luca Boccassi
  2017-09-01 13:55     ` Bruce Richardson
  2017-09-04 13:57   ` Van Haaren, Harry
  1 sibling, 1 reply; 107+ messages in thread
From: Luca Boccassi @ 2017-09-01 13:32 UTC (permalink / raw)
  To: Bruce Richardson, dev

On Fri, 2017-09-01 at 11:04 +0100, Bruce Richardson wrote:
> Support building igb_uio using meson and ninja. For this, we still
> use the
> kernel's kbuild system, by calling out to make, since it's safer and
> easier
> than trying to reproduce that in meson. A list of suitable file
> dependencies is given so that we have a reasonable chance of a
> rebuild when
> necessary.
> 
> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> ---
>  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                           |  2 ++
>  4 files changed, 60 insertions(+)
>  create mode 100644 lib/librte_eal/linuxapp/igb_uio/Kbuild
>  create mode 100644 lib/librte_eal/linuxapp/igb_uio/meson.build
> 
> diff --git a/lib/librte_eal/linuxapp/igb_uio/Kbuild
> b/lib/librte_eal/linuxapp/igb_uio/Kbuild
> new file mode 100644
> index 000000000..98c98fe52
> --- /dev/null
> +++ b/lib/librte_eal/linuxapp/igb_uio/Kbuild
> @@ -0,0 +1 @@
> +obj-m := igb_uio.o
> diff --git a/lib/librte_eal/linuxapp/igb_uio/meson.build
> b/lib/librte_eal/linuxapp/igb_uio/meson.build
> new file mode 100644
> index 000000000..c046e1d66
> --- /dev/null
> +++ b/lib/librte_eal/linuxapp/igb_uio/meson.build
> @@ -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.
> +
> +mkfile = custom_target('igb_uio_makefile',
> +	output: 'Makefile',
> +	command: ['touch', '@OUTPUT@'])
> +
> +custom_target('igb_uio',
> +	input: ['igb_uio.c', 'Kbuild'],
> +	output: 'igb_uio.ko',
> +	command: ['make', '-C', kernel_dir,
> +		'M=' + meson.current_build_dir(),
> +		'src=' + meson.current_source_dir(),
> +		'EXTRA_CFLAGS=-I' + meson.current_source_dir() +
> +			'/../../common/include',
> +		'modules'],
> +	depends: mkfile,
> +	depend_files: [join_paths(kernel_dir, 'Kconfig')],

Can this be made optional somehow?

There's no build/Kconfig on Debian:

$ ls /lib/modules/4.9.0-3-amd64/build
arch  include  Makefile  Module.symvers  scripts

But the build works fine without that depend_files line.

> +	build_by_default: true)
> diff --git a/lib/librte_eal/linuxapp/meson.build
> b/lib/librte_eal/linuxapp/meson.build
> index bc9f22175..2383bd368 100644
> --- a/lib/librte_eal/linuxapp/meson.build
> +++ b/lib/librte_eal/linuxapp/meson.build
> @@ -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
> diff --git a/meson_options.txt b/meson_options.txt
> index c03b79fbd..9c45b8159 100644
> --- a/meson_options.txt
> +++ b/meson_options.txt
> @@ -4,3 +4,5 @@ option('max_numa_nodes', type: 'string', value: '4',
> description: 'maximum numbe
>  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')
> +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')

-- 
Kind regards,
Luca Boccassi

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

* Re: [PATCH 03/17] igb_uio: add igb_uio kmod to meson build
  2017-09-01 13:32   ` Luca Boccassi
@ 2017-09-01 13:55     ` Bruce Richardson
  2017-09-01 14:27       ` Luca Boccassi
  0 siblings, 1 reply; 107+ messages in thread
From: Bruce Richardson @ 2017-09-01 13:55 UTC (permalink / raw)
  To: Luca Boccassi; +Cc: dev

On Fri, Sep 01, 2017 at 02:32:52PM +0100, Luca Boccassi wrote:
> On Fri, 2017-09-01 at 11:04 +0100, Bruce Richardson wrote:
> > Support building igb_uio using meson and ninja. For this, we still
> > use the
> > kernel's kbuild system, by calling out to make, since it's safer and
> > easier
> > than trying to reproduce that in meson. A list of suitable file
> > dependencies is given so that we have a reasonable chance of a
> > rebuild when
> > necessary.
> > 
> > Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> > ---
> >  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                           |  2 ++
> >  4 files changed, 60 insertions(+)
> >  create mode 100644 lib/librte_eal/linuxapp/igb_uio/Kbuild
> >  create mode 100644 lib/librte_eal/linuxapp/igb_uio/meson.build
> > 
> > diff --git a/lib/librte_eal/linuxapp/igb_uio/Kbuild
> > b/lib/librte_eal/linuxapp/igb_uio/Kbuild
> > new file mode 100644
> > index 000000000..98c98fe52
> > --- /dev/null
> > +++ b/lib/librte_eal/linuxapp/igb_uio/Kbuild
> > @@ -0,0 +1 @@
> > +obj-m := igb_uio.o
> > diff --git a/lib/librte_eal/linuxapp/igb_uio/meson.build
> > b/lib/librte_eal/linuxapp/igb_uio/meson.build
> > new file mode 100644
> > index 000000000..c046e1d66
> > --- /dev/null
> > +++ b/lib/librte_eal/linuxapp/igb_uio/meson.build
> > @@ -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.
> > +
> > +mkfile = custom_target('igb_uio_makefile',
> > +	output: 'Makefile',
> > +	command: ['touch', '@OUTPUT@'])
> > +
> > +custom_target('igb_uio',
> > +	input: ['igb_uio.c', 'Kbuild'],
> > +	output: 'igb_uio.ko',
> > +	command: ['make', '-C', kernel_dir,
> > +		'M=' + meson.current_build_dir(),
> > +		'src=' + meson.current_source_dir(),
> > +		'EXTRA_CFLAGS=-I' + meson.current_source_dir() +
> > +			'/../../common/include',
> > +		'modules'],
> > +	depends: mkfile,
> > +	depend_files: [join_paths(kernel_dir, 'Kconfig')],
> 
> Can this be made optional somehow?
> 
> There's no build/Kconfig on Debian:
> 
> $ ls /lib/modules/4.9.0-3-amd64/build
> arch  include  Makefile  Module.symvers  scripts
> 
> But the build works fine without that depend_files line.
> 
Yep, definitely can be removed. I was just looking for some way to give
meson the smarts to know when the kmod needed to be recompiled, and it
seemed a likely candidate to watch for changes.

/Bruce

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

* Re: [PATCH 03/17] igb_uio: add igb_uio kmod to meson build
  2017-09-01 13:55     ` Bruce Richardson
@ 2017-09-01 14:27       ` Luca Boccassi
  0 siblings, 0 replies; 107+ messages in thread
From: Luca Boccassi @ 2017-09-01 14:27 UTC (permalink / raw)
  To: Bruce Richardson; +Cc: dev

On Fri, 2017-09-01 at 14:55 +0100, Bruce Richardson wrote:
> On Fri, Sep 01, 2017 at 02:32:52PM +0100, Luca Boccassi wrote:
> > On Fri, 2017-09-01 at 11:04 +0100, Bruce Richardson wrote:
> > > Support building igb_uio using meson and ninja. For this, we
> > > still
> > > use the
> > > kernel's kbuild system, by calling out to make, since it's safer
> > > and
> > > easier
> > > than trying to reproduce that in meson. A list of suitable file
> > > dependencies is given so that we have a reasonable chance of a
> > > rebuild when
> > > necessary.
> > > 
> > > Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> > > ---
> > >  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                           |  2 ++
> > >  4 files changed, 60 insertions(+)
> > >  create mode 100644 lib/librte_eal/linuxapp/igb_uio/Kbuild
> > >  create mode 100644 lib/librte_eal/linuxapp/igb_uio/meson.build
> > > 
> > > diff --git a/lib/librte_eal/linuxapp/igb_uio/Kbuild
> > > b/lib/librte_eal/linuxapp/igb_uio/Kbuild
> > > new file mode 100644
> > > index 000000000..98c98fe52
> > > --- /dev/null
> > > +++ b/lib/librte_eal/linuxapp/igb_uio/Kbuild
> > > @@ -0,0 +1 @@
> > > +obj-m := igb_uio.o
> > > diff --git a/lib/librte_eal/linuxapp/igb_uio/meson.build
> > > b/lib/librte_eal/linuxapp/igb_uio/meson.build
> > > new file mode 100644
> > > index 000000000..c046e1d66
> > > --- /dev/null
> > > +++ b/lib/librte_eal/linuxapp/igb_uio/meson.build
> > > @@ -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.
> > > +
> > > +mkfile = custom_target('igb_uio_makefile',
> > > +	output: 'Makefile',
> > > +	command: ['touch', '@OUTPUT@'])
> > > +
> > > +custom_target('igb_uio',
> > > +	input: ['igb_uio.c', 'Kbuild'],
> > > +	output: 'igb_uio.ko',
> > > +	command: ['make', '-C', kernel_dir,
> > > +		'M=' + meson.current_build_dir(),
> > > +		'src=' + meson.current_source_dir(),
> > > +		'EXTRA_CFLAGS=-I' + meson.current_source_dir() +
> > > +			'/../../common/include',
> > > +		'modules'],
> > > +	depends: mkfile,
> > > +	depend_files: [join_paths(kernel_dir, 'Kconfig')],
> > 
> > Can this be made optional somehow?
> > 
> > There's no build/Kconfig on Debian:
> > 
> > $ ls /lib/modules/4.9.0-3-amd64/build
> > arch  include  Makefile  Module.symvers  scripts
> > 
> > But the build works fine without that depend_files line.
> > 
> 
> Yep, definitely can be removed. I was just looking for some way to
> give
> meson the smarts to know when the kmod needed to be recompiled, and
> it
> seemed a likely candidate to watch for changes.
> 
> /Bruce

Thanks. This is the content of build/ and the parent directory in
Debian, in case you want to try and find some common ground:

$ ls -la /lib/modules/4.9.0-3-amd64/
total 4120
drwxr-xr-x  4 root root    4096 Aug 15 11:13 .
drwxr-xr-x  4 root root    4096 Aug 25 17:55 ..
lrwxrwxrwx  1 root root      36 May  2 16:21 build -> /usr/src/linux-
headers-4.9.0-3-amd64
drwxr-xr-x 12 root root    4096 May 17 18:58 kernel
-rw-r--r--  1 root root 1009588 Aug 15 11:13 modules.alias
-rw-r--r--  1 root root  968576 Aug 15 11:13 modules.alias.bin
-rw-r--r--  1 root root    4018 Aug  6 05:24 modules.builtin
-rw-r--r--  1 root root    5327 Aug 15 11:13 modules.builtin.bin
-rw-r--r--  1 root root  400037 Aug 15 11:13 modules.dep
-rw-r--r--  1 root root  551081 Aug 15 11:13 modules.dep.bin
-rw-r--r--  1 root root     402 Aug 15 11:13 modules.devname
-rw-r--r--  1 root root  133512 Aug  6 05:24 modules.order
-rw-r--r--  1 root root     523 Aug 15 11:13 modules.softdep
-rw-r--r--  1 root root  495231 Aug 15 11:13 modules.symbols
-rw-r--r--  1 root root  610575 Aug 15 11:13 modules.symbols.bin
lrwxrwxrwx  1 root root      37 May  2 16:21 source -> /usr/src/linux-
headers-4.9.0-3-common
drwxr-xr-x  3 root root    4096 May 17 18:58 updates

$ ls -la /lib/modules/4.9.0-3-amd64/build/
total 1460
drwxr-xr-x 4 root root    4096 Aug  7 10:27 .
drwxr-xr-x 9 root root    4096 Aug 25 17:55 ..
drwxr-xr-x 3 root root    4096 May 17 18:58 arch
-rw-r--r-- 1 root root  186386 Aug  6 05:24 .config
drwxr-xr-x 4 root root    4096 May 17 18:58 include
-rw-r--r-- 1 root root     242 Aug  6 05:24 .kernelvariables
-rw-r--r-- 1 root root     304 Aug  6 05:24 Makefile
-rw-r--r-- 1 root root 1278637 Aug  6 05:24 Module.symvers
lrwxrwxrwx 1 root root      34 May  2 16:21 scripts -> ../../lib/linux-
kbuild-4.9/scripts

-- 
Kind regards,
Luca Boccassi

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

* Re: [PATCH 01/17] build: add initial infrastructure for meson & ninja builds
  2017-09-01 10:04 ` [PATCH 01/17] build: add initial infrastructure for meson & ninja builds Bruce Richardson
@ 2017-09-04 13:36   ` Van Haaren, Harry
  2017-09-04 13:51     ` Bruce Richardson
  2017-09-07 16:21   ` [dpdk-dev, " Neil Horman
  2017-09-08 16:03   ` [PATCH " Van Haaren, Harry
  2 siblings, 1 reply; 107+ messages in thread
From: Van Haaren, Harry @ 2017-09-04 13:36 UTC (permalink / raw)
  To: Richardson, Bruce, dev; +Cc: Richardson, Bruce

> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Bruce Richardson
> Sent: Friday, September 1, 2017 11:04 AM
> To: dev@dpdk.org
> Cc: Richardson, Bruce <bruce.richardson@intel.com>
> Subject: [dpdk-dev] [PATCH 01/17] build: add initial infrastructure for meson & ninja builds
> 
> To build with meson and ninja, we need some initial infrastructure in
> place. The build files for meson always need to be called "meson.build",
> and options get placed in meson_options.txt
> 
> This commit adds a top-level meson.build file, which sets up the global
> variables for tracking drivers, libraries, etc., and then includes other
> build files, before finishing by writing the global build configuration
> header file and a DPDK pkgconfig file at the end, using some of those same
> globals.
> 
> From the top level build file, the only include file thus far is for the
> config folder, which does some other setup of global configuration
> parameters, including pulling in architecture specific parameters from an
> architectural subdirectory. A number of configuration build options are
> provided for the project to tune a number of global variables which will be
> used later e.g. max numa nodes, max cores, etc. These settings all make
> their way to the global build config header "rte_build_config.h". There is
> also a file "rte_config.h", which includes "rte_build_config.h", and this
> file is meant to hold other build-time values which are present in our
> current static build configuration but are not normally meant for
> user-configuration. Ideally, over time, the values placed here should be
> moved to the individual libraries or drivers which want those values.
> 
> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>

Comments inline below;

<snip>

> diff --git a/config/meson.build b/config/meson.build
<snip>
> +# 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

I can't fault the code here, or Meson, just noting that the disabling of these warnings causes prints on GCC 4.8.5 and GCC 5.4.0, GCC 7 only prints on -Wno-address-of-packed-member. Clang handles it correctly - and no out-of-the-ordinary prints occur. No code changes required here.


> diff --git a/config/rte_config.h b/config/rte_config.h
> new file mode 100644
> index 000000000..79b0db90f
> --- /dev/null
> +++ b/config/rte_config.h
> @@ -0,0 +1,50 @@
> +/*
> + *   BSD LICENSE
> + *
> + *   Copyright(c) 2016 Intel Corporation. All rights reserved.
> + *   All rights reserved.

2017 for license year

<snip>

Reviewed-by: Harry van Haaren <harry.van.haaren@intel.com>

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

* Re: [PATCH 01/17] build: add initial infrastructure for meson & ninja builds
  2017-09-04 13:36   ` Van Haaren, Harry
@ 2017-09-04 13:51     ` Bruce Richardson
  2017-09-06 16:18       ` Bruce Richardson
  0 siblings, 1 reply; 107+ messages in thread
From: Bruce Richardson @ 2017-09-04 13:51 UTC (permalink / raw)
  To: Van Haaren, Harry; +Cc: dev

On Mon, Sep 04, 2017 at 02:36:42PM +0100, Van Haaren, Harry wrote:
> > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Bruce Richardson
> > Sent: Friday, September 1, 2017 11:04 AM
> > To: dev@dpdk.org
> > Cc: Richardson, Bruce <bruce.richardson@intel.com>
> > Subject: [dpdk-dev] [PATCH 01/17] build: add initial infrastructure for meson & ninja builds
> > 
> > To build with meson and ninja, we need some initial infrastructure in
> > place. The build files for meson always need to be called "meson.build",
> > and options get placed in meson_options.txt
> > 
> > This commit adds a top-level meson.build file, which sets up the global
> > variables for tracking drivers, libraries, etc., and then includes other
> > build files, before finishing by writing the global build configuration
> > header file and a DPDK pkgconfig file at the end, using some of those same
> > globals.
> > 
> > From the top level build file, the only include file thus far is for the
> > config folder, which does some other setup of global configuration
> > parameters, including pulling in architecture specific parameters from an
> > architectural subdirectory. A number of configuration build options are
> > provided for the project to tune a number of global variables which will be
> > used later e.g. max numa nodes, max cores, etc. These settings all make
> > their way to the global build config header "rte_build_config.h". There is
> > also a file "rte_config.h", which includes "rte_build_config.h", and this
> > file is meant to hold other build-time values which are present in our
> > current static build configuration but are not normally meant for
> > user-configuration. Ideally, over time, the values placed here should be
> > moved to the individual libraries or drivers which want those values.
> > 
> > Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> 
> Comments inline below;
> 
> <snip>
> 
> > diff --git a/config/meson.build b/config/meson.build
> <snip>
> > +# 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
> 
> I can't fault the code here, or Meson, just noting that the disabling of these warnings causes prints on GCC 4.8.5 and GCC 5.4.0, GCC 7 only prints on -Wno-address-of-packed-member. Clang handles it correctly - and no out-of-the-ordinary prints occur. No code changes required here.
>

Strange. Just tested with gcc 4.8.5 and gcc 5.4, and everything worked as
expected, no errors or warnings.

> 
> > diff --git a/config/rte_config.h b/config/rte_config.h
> > new file mode 100644
> > index 000000000..79b0db90f
> > --- /dev/null
> > +++ b/config/rte_config.h
> > @@ -0,0 +1,50 @@
> > +/*
> > + *   BSD LICENSE
> > + *
> > + *   Copyright(c) 2016 Intel Corporation. All rights reserved.
> > + *   All rights reserved.
> 
> 2017 for license year

Good catch, will fix in V2.

> 
> <snip>
> 
> Reviewed-by: Harry van Haaren <harry.van.haaren@intel.com>

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

* Re: [PATCH 02/17] eal: add eal library to meson build
  2017-09-01 10:04 ` [PATCH 02/17] eal: add eal library to meson build Bruce Richardson
@ 2017-09-04 13:53   ` Van Haaren, Harry
  2017-09-07 16:25   ` [dpdk-dev, " Neil Horman
  1 sibling, 0 replies; 107+ messages in thread
From: Van Haaren, Harry @ 2017-09-04 13:53 UTC (permalink / raw)
  To: Richardson, Bruce, dev; +Cc: Richardson, Bruce

> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Bruce Richardson
> Sent: Friday, September 1, 2017 11:04 AM
> To: dev@dpdk.org
> Cc: Richardson, Bruce <bruce.richardson@intel.com>
> Subject: [dpdk-dev] [PATCH 02/17] eal: add eal library to meson build
> 
> Support building the EAL with meson and ninja. This involves a number of
> different meson.build files for iterating through all the different
> subdirectories in the EAL. The library itself will be compiled on build but
> the header files are only copied from their initial location once "ninja
> install" is run. Instead, we use meson dependency tracking to ensure that
> other libraries which use the EAL headers can find them in their original
> locations.
> 
> Note: this does not include building kernel modules on either BSD or Linux
> 
> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>

Reviewed-by: Harry van Haaren <harry.van.haaren@intel.com>

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

* Re: [PATCH 03/17] igb_uio: add igb_uio kmod to meson build
  2017-09-01 10:04 ` [PATCH 03/17] igb_uio: add igb_uio kmod " Bruce Richardson
  2017-09-01 13:32   ` Luca Boccassi
@ 2017-09-04 13:57   ` Van Haaren, Harry
  1 sibling, 0 replies; 107+ messages in thread
From: Van Haaren, Harry @ 2017-09-04 13:57 UTC (permalink / raw)
  To: Richardson, Bruce, dev; +Cc: Richardson, Bruce

> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Bruce Richardson
> Sent: Friday, September 1, 2017 11:04 AM
> To: dev@dpdk.org
> Cc: Richardson, Bruce <bruce.richardson@intel.com>
> Subject: [dpdk-dev] [PATCH 03/17] igb_uio: add igb_uio kmod to meson build
> 
> Support building igb_uio using meson and ninja. For this, we still use the
> kernel's kbuild system, by calling out to make, since it's safer and easier
> than trying to reproduce that in meson. A list of suitable file
> dependencies is given so that we have a reasonable chance of a rebuild when
> necessary.
> 
> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>

Reviewed-by: Harry van Haaren <harry.van.haaren@intel.com>

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

* Re: [PATCH 04/17] build: add DPDK libraries to build
  2017-09-01 10:04 ` [PATCH 04/17] build: add DPDK libraries to build Bruce Richardson
@ 2017-09-04 14:08   ` Van Haaren, Harry
  2017-09-04 14:55     ` Bruce Richardson
  0 siblings, 1 reply; 107+ messages in thread
From: Van Haaren, Harry @ 2017-09-04 14:08 UTC (permalink / raw)
  To: Richardson, Bruce, dev; +Cc: Richardson, Bruce

> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Bruce Richardson
> Sent: Friday, September 1, 2017 11:04 AM
> To: dev@dpdk.org
> Cc: Richardson, Bruce <bruce.richardson@intel.com>
> Subject: [dpdk-dev] [PATCH 04/17] build: add DPDK libraries to build
> 
> Add non-EAL libraries to DPDK build. The compat lib is a special case,
> along with the previously-added EAL, but all other libs can be build using
> the same set of commands, where the individual meson.build files only need
> to specify their dependencies, source files, header files and ABI versions.
> 
> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>

<snip>

In librte_acl/meson.build:

> +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')
> +
> +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

In future this could be split out to some sort of AVX helper, to avoid it
becoming copy/paste prone to detect AVX features from libraries.


<huge snip of almost all libraries meson.build files>

> --- a/lib/meson.build
> +++ b/lib/meson.build
> @@ -29,4 +29,71 @@
>  #   (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, and compat, just a header
>  subdir('librte_eal')
> +subdir('librte_compat')
> +
> +# process all libraries equally, as far as possible
> +# "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.
> +libraries = ['ring', 'mempool', 'mbuf', 'net', 'ether', # core
> +	'metrics', # bitrate/latency stats depends on this
> +	'hash',    # efd depends on this
> +	'kvargs',  # cryptodev depends on this
> +	'acl', 'bitratestats', 'cfgfile', 'cmdline', 'cryptodev',
> +	'distributor', 'efd', 'eventdev', 'gro', 'ip_frag', 'jobstats',
> +	'kni', 'latencystats', 'lpm', 'meter', 'power', 'pdump',
> +	'reorder', 'sched', 'timer', 'vhost',
> +	# add pkt framework libs which use other libs from above
> +	'port', 'table', 'pipeline']
> +
> +foreach l:libraries
> +	build = true
> +	name = l
> +	version = 1
> +	sources = []
> +	headers = []
> +	cflags = []
> +	objs = [] # other object files to link against, used e.g. for instruction-
> +	          # optimized versions of code

Nitpick: comment above could be moved to be before the objs[] line, consistent like below.
I'll send a patch once this stuff is in next-build :D

> +	# use "deps" for internal DPDK dependencies, and "ext_deps" for
> +	# external package/library requirements
> +	deps = ['eal']
> +	ext_deps = []
> +
> +	dir_name = 'librte_' + l
> +	subdir(dir_name)
> +
> +	if build
> +		dpdk_conf.set('RTE_LIBRTE_' + name.to_upper(), 1)
> +		install_headers(headers)
> +
> +		dep_objs = ext_deps
> +		foreach d:deps
> +			dep_objs += [get_variable('dep_rte_' + d)]
> +		endforeach
> +
> +		version_map = '@0@/@1@/rte_@2@_version.map'.format(
> +				meson.current_source_dir(), dir_name, name)
> +		libname = 'rte_' + name
> +		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,
> +				link_depends: version_map,
> +				version: '@0@.1'.format(version),
> +				install: true)
> +		dep = declare_dependency(link_with: lib,
> +				include_directories: include_directories(dir_name),
> +				dependencies: dep_objs)
> +		set_variable('dep_' + libname, dep)
> +
> +		dpdk_libraries = [lib] + dpdk_libraries
> +	endif
> +endforeach
> --
> 2.13.5


Reviewed-by: Harry van Haaren <harry.van.haaren@intel.com>

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

* Re: [PATCH 05/17] build: add buildtools to meson build
  2017-09-01 10:04 ` [PATCH 05/17] build: add buildtools to meson build Bruce Richardson
@ 2017-09-04 14:24   ` Van Haaren, Harry
  0 siblings, 0 replies; 107+ messages in thread
From: Van Haaren, Harry @ 2017-09-04 14:24 UTC (permalink / raw)
  To: Richardson, Bruce, dev; +Cc: Richardson, Bruce

> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Bruce Richardson
> Sent: Friday, September 1, 2017 11:04 AM
> To: dev@dpdk.org
> Cc: Richardson, Bruce <bruce.richardson@intel.com>
> Subject: [dpdk-dev] [PATCH 05/17] build: add buildtools to meson build
> 
> Add the buildtools folder, and more specifically the pmdinfogen binary to
> the meson and ninja build. This will be needed for building the PMDs in the
> driver folder later, as the pmd info output from the tool needs to be
> included in those libs.
> 
> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>

<snip>

> +error_cflags = ['-Wno-maybe-uninitialized']
> +cflags = []
> +foreach arg: error_cflags
> +	if cc.has_argument(arg)
> +		cflags += arg
> +	endif
> +endforeach

Removing the '-Wno-maybe-uninitialized' still compiles fine here with Clang.
GCC prints a warning... this could probably be fixed in "pmdinfogen.c" in future,
but this should not be done in the build-next branch, but patched in mainline and
then updated in the meson build.

> +
> +pmdinfogen = executable('pmdinfogen',
> +	'pmdinfogen.c',
> +	include_directories: eal_inc,
> +	c_args: cflags)
> diff --git a/meson.build b/meson.build
> index f0e5741e3..d95321022 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -59,6 +59,7 @@ subdir('config')
> 
>  # build libs and (TODO) drivers
>  subdir('lib')
> +subdir('buildtools')
> 
>  # TODO build binaries and installable tools
> 
> --
> 2.13.5

Reviewed-by: Harry van Haaren <harry.van.haaren@intel.com>

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

* Re: [PATCH 06/17] build: add infrastructure for building PMDs
  2017-09-01 10:04 ` [PATCH 06/17] build: add infrastructure for building PMDs Bruce Richardson
@ 2017-09-04 14:27   ` Van Haaren, Harry
  0 siblings, 0 replies; 107+ messages in thread
From: Van Haaren, Harry @ 2017-09-04 14:27 UTC (permalink / raw)
  To: Richardson, Bruce, dev; +Cc: Richardson, Bruce

> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Bruce Richardson
> Sent: Friday, September 1, 2017 11:04 AM
> To: dev@dpdk.org
> Cc: Richardson, Bruce <bruce.richardson@intel.com>
> Subject: [dpdk-dev] [PATCH 06/17] build: add infrastructure for building PMDs
> 
> Add in the top-level drivers meson.build file to start adding in building
> of PMDs. Since all PMDs are built in pretty much the same way, the logic
> for building each PMD, including extracting the pmdinfo, is included in the
> top level build file. This means that each individual driver class only
> needs to specify its default dependencies and a few naming conventions, and
> each driver only needs to specify it's source files, headers, etc.
> 
> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>

Reviewed-by: Harry van Haaren <harry.van.haaren@intel.com>

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

* Re: [PATCH 07/17] drivers/mempool: add SW mempool drivers to meson build
  2017-09-01 10:04 ` [PATCH 07/17] drivers/mempool: add SW mempool drivers to meson build Bruce Richardson
@ 2017-09-04 14:28   ` Van Haaren, Harry
  2017-09-04 14:29   ` Van Haaren, Harry
  1 sibling, 0 replies; 107+ messages in thread
From: Van Haaren, Harry @ 2017-09-04 14:28 UTC (permalink / raw)
  To: Richardson, Bruce, dev; +Cc: Richardson, Bruce

> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Bruce Richardson
> Sent: Friday, September 1, 2017 11:04 AM
> To: dev@dpdk.org
> Cc: Richardson, Bruce <bruce.richardson@intel.com>
> Subject: [dpdk-dev] [PATCH 07/17] drivers/mempool: add SW mempool drivers to meson build
> 
> With build infrastructure in place, add in mempool drivers to the build.
> 
> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>

Reviewed-by: Harry van Haaren <harry.van.haaren@intel.com>

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

* Re: [PATCH 07/17] drivers/mempool: add SW mempool drivers to meson build
  2017-09-01 10:04 ` [PATCH 07/17] drivers/mempool: add SW mempool drivers to meson build Bruce Richardson
  2017-09-04 14:28   ` Van Haaren, Harry
@ 2017-09-04 14:29   ` Van Haaren, Harry
  1 sibling, 0 replies; 107+ messages in thread
From: Van Haaren, Harry @ 2017-09-04 14:29 UTC (permalink / raw)
  To: Richardson, Bruce, dev; +Cc: Richardson, Bruce

> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Bruce Richardson
> Sent: Friday, September 1, 2017 11:04 AM
> To: dev@dpdk.org
> Cc: Richardson, Bruce <bruce.richardson@intel.com>
> Subject: [dpdk-dev] [PATCH 07/17] drivers/mempool: add SW mempool drivers to meson build
> 
> With build infrastructure in place, add in mempool drivers to the build.
> 
> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>

Reviewed-by: Harry van Haaren <harry.van.haaren@intel.com>

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

* Re: [PATCH 08/17] drivers/crypto: add crypto drv class and null PMD to meson
  2017-09-01 10:04 ` [PATCH 08/17] drivers/crypto: add crypto drv class and null PMD to meson Bruce Richardson
@ 2017-09-04 14:30   ` Van Haaren, Harry
  0 siblings, 0 replies; 107+ messages in thread
From: Van Haaren, Harry @ 2017-09-04 14:30 UTC (permalink / raw)
  To: Richardson, Bruce, dev; +Cc: Richardson, Bruce

> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Bruce Richardson
> Sent: Friday, September 1, 2017 11:04 AM
> To: dev@dpdk.org
> Cc: Richardson, Bruce <bruce.richardson@intel.com>
> Subject: [dpdk-dev] [PATCH 08/17] drivers/crypto: add crypto drv class and null PMD to meson
> 
> Add in a crypto driver class, and implement compiling the null crypto
> instance.
> 
> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>

Reviewed-by: Harry van Haaren <harry.van.haaren@intel.com>

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

* Re: [PATCH 09/17] crypto/openssl: add driver to meson build
  2017-09-01 10:04 ` [PATCH 09/17] crypto/openssl: add driver to meson build Bruce Richardson
@ 2017-09-04 14:30   ` Van Haaren, Harry
  2017-09-04 14:31   ` Van Haaren, Harry
  1 sibling, 0 replies; 107+ messages in thread
From: Van Haaren, Harry @ 2017-09-04 14:30 UTC (permalink / raw)
  To: Richardson, Bruce, dev; +Cc: Richardson, Bruce

> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Bruce Richardson
> Sent: Friday, September 1, 2017 11:04 AM
> To: dev@dpdk.org
> Cc: Richardson, Bruce <bruce.richardson@intel.com>
> Subject: [dpdk-dev] [PATCH 09/17] crypto/openssl: add driver to meson build
> 
> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>

Reviewed-by: Harry van Haaren <harry.van.haaren@intel.com>

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

* Re: [PATCH 09/17] crypto/openssl: add driver to meson build
  2017-09-01 10:04 ` [PATCH 09/17] crypto/openssl: add driver to meson build Bruce Richardson
  2017-09-04 14:30   ` Van Haaren, Harry
@ 2017-09-04 14:31   ` Van Haaren, Harry
  1 sibling, 0 replies; 107+ messages in thread
From: Van Haaren, Harry @ 2017-09-04 14:31 UTC (permalink / raw)
  To: Richardson, Bruce, dev; +Cc: Richardson, Bruce

> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Bruce Richardson
> Sent: Friday, September 1, 2017 11:04 AM
> To: dev@dpdk.org
> Cc: Richardson, Bruce <bruce.richardson@intel.com>
> Subject: [dpdk-dev] [PATCH 09/17] crypto/openssl: add driver to meson build
> 
> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>

Reviewed-by: Harry van Haaren <harry.van.haaren@intel.com>

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

* Re: [PATCH 10/17] crypto/qat: add driver to meson build
  2017-09-01 10:04 ` [PATCH 10/17] crypto/qat: " Bruce Richardson
@ 2017-09-04 14:32   ` Van Haaren, Harry
  0 siblings, 0 replies; 107+ messages in thread
From: Van Haaren, Harry @ 2017-09-04 14:32 UTC (permalink / raw)
  To: Richardson, Bruce, dev; +Cc: Richardson, Bruce

> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Bruce Richardson
> Sent: Friday, September 1, 2017 11:04 AM
> To: dev@dpdk.org
> Cc: Richardson, Bruce <bruce.richardson@intel.com>
> Subject: [dpdk-dev] [PATCH 10/17] crypto/qat: add driver to meson build
> 
> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>

Reviewed-by: Harry van Haaren <harry.van.haaren@intel.com>

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

* Re: [PATCH 11/17] drivers/net: add net driver support to meson build
  2017-09-01 10:04 ` [PATCH 11/17] drivers/net: add net driver support " Bruce Richardson
@ 2017-09-04 14:32   ` Van Haaren, Harry
  0 siblings, 0 replies; 107+ messages in thread
From: Van Haaren, Harry @ 2017-09-04 14:32 UTC (permalink / raw)
  To: Richardson, Bruce, dev; +Cc: Richardson, Bruce

> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Bruce Richardson
> Sent: Friday, September 1, 2017 11:04 AM
> To: dev@dpdk.org
> Cc: Richardson, Bruce <bruce.richardson@intel.com>
> Subject: [dpdk-dev] [PATCH 11/17] drivers/net: add net driver support to meson build
> 
> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>

Reviewed-by: Harry van Haaren <harry.van.haaren@intel.com>

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

* Re: [PATCH 12/17] drivers/net: add set of vdev PMDs to build
  2017-09-01 10:04 ` [PATCH 12/17] drivers/net: add set of vdev PMDs to build Bruce Richardson
@ 2017-09-04 14:34   ` Van Haaren, Harry
  0 siblings, 0 replies; 107+ messages in thread
From: Van Haaren, Harry @ 2017-09-04 14:34 UTC (permalink / raw)
  To: Richardson, Bruce, dev; +Cc: Richardson, Bruce

> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Bruce Richardson
> Sent: Friday, September 1, 2017 11:04 AM
> To: dev@dpdk.org
> Cc: Richardson, Bruce <bruce.richardson@intel.com>
> Subject: [dpdk-dev] [PATCH 12/17] drivers/net: add set of vdev PMDs to build
> 
> Add the af_packet, null, pcap and ring PMDs to the meson build.
> 
> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>

Reviewed-by: Harry van Haaren <harry.van.haaren@intel.com>

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

* Re: [PATCH 04/17] build: add DPDK libraries to build
  2017-09-04 14:08   ` Van Haaren, Harry
@ 2017-09-04 14:55     ` Bruce Richardson
  0 siblings, 0 replies; 107+ messages in thread
From: Bruce Richardson @ 2017-09-04 14:55 UTC (permalink / raw)
  To: Van Haaren, Harry; +Cc: dev

On Mon, Sep 04, 2017 at 03:08:50PM +0100, Van Haaren, Harry wrote:
> > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Bruce Richardson
> > Sent: Friday, September 1, 2017 11:04 AM
> > To: dev@dpdk.org
> > Cc: Richardson, Bruce <bruce.richardson@intel.com>
> > Subject: [dpdk-dev] [PATCH 04/17] build: add DPDK libraries to build
> > 
> > Add non-EAL libraries to DPDK build. The compat lib is a special case,
> > along with the previously-added EAL, but all other libs can be build using
> > the same set of commands, where the individual meson.build files only need
> > to specify their dependencies, source files, header files and ABI versions.
> > 
> > Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> 
> <snip>
> 
> In librte_acl/meson.build:
> 
> > +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')
> > +
> > +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
> 
> In future this could be split out to some sort of AVX helper, to avoid it
> becoming copy/paste prone to detect AVX features from libraries.
> 
We can indeed look at that in future, using native meson support I hope,
from the SIMD module: http://mesonbuild.com/Simd-module.html

Right now, though, I think this is the only place we need this, so it's
not an issue.

/Bruce

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

* Re: [PATCH 15/17] usertools: add usertools installation to meson build
  2017-09-01 10:04 ` [PATCH 15/17] usertools: add usertools installation " Bruce Richardson
@ 2017-09-04 15:00   ` Van Haaren, Harry
  0 siblings, 0 replies; 107+ messages in thread
From: Van Haaren, Harry @ 2017-09-04 15:00 UTC (permalink / raw)
  To: Richardson, Bruce, dev; +Cc: Richardson, Bruce

> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Bruce Richardson
> Sent: Friday, September 1, 2017 11:04 AM
> To: dev@dpdk.org
> Cc: Richardson, Bruce <bruce.richardson@intel.com>
> Subject: [dpdk-dev] [PATCH 15/17] usertools: add usertools installation to meson build
> 
> Have the "usertools" scripts installed when doing a DPDK install using
> ninja. They will be copies to $prefix/bin, generally /usr/local/bin,
> alongside testpmd.
> 
> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>

Reviewed-by: Harry van Haaren <harry.van.haaren@intel.com>

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

* Re: [PATCH 14/17] app/test-pmd: add test-pmd to meson build
  2017-09-01 10:04 ` [PATCH 14/17] app/test-pmd: add test-pmd " Bruce Richardson
@ 2017-09-04 15:01   ` Van Haaren, Harry
  0 siblings, 0 replies; 107+ messages in thread
From: Van Haaren, Harry @ 2017-09-04 15:01 UTC (permalink / raw)
  To: Richardson, Bruce, dev; +Cc: Richardson, Bruce

> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Bruce Richardson
> Sent: Friday, September 1, 2017 11:04 AM
> To: dev@dpdk.org
> Cc: Richardson, Bruce <bruce.richardson@intel.com>
> Subject: [dpdk-dev] [PATCH 14/17] app/test-pmd: add test-pmd to meson build
> 
> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>

Reviewed-by: Harry van Haaren <harry.van.haaren@intel.com>

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

* Re: [PATCH 01/17] build: add initial infrastructure for meson & ninja builds
  2017-09-04 13:51     ` Bruce Richardson
@ 2017-09-06 16:18       ` Bruce Richardson
  2017-09-07 13:52         ` Bruce Richardson
  0 siblings, 1 reply; 107+ messages in thread
From: Bruce Richardson @ 2017-09-06 16:18 UTC (permalink / raw)
  To: Van Haaren, Harry; +Cc: dev

On Mon, Sep 04, 2017 at 02:51:01PM +0100, Bruce Richardson wrote:
> On Mon, Sep 04, 2017 at 02:36:42PM +0100, Van Haaren, Harry wrote:
> > > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Bruce
> > > Richardson Sent: Friday, September 1, 2017 11:04 AM To:
> > > dev@dpdk.org Cc: Richardson, Bruce <bruce.richardson@intel.com>
> > > Subject: [dpdk-dev] [PATCH 01/17] build: add initial
> > > infrastructure for meson & ninja builds
> > > 
> > > To build with meson and ninja, we need some initial infrastructure
> > > in place. The build files for meson always need to be called
> > > "meson.build", and options get placed in meson_options.txt
> > > 
> > > This commit adds a top-level meson.build file, which sets up the
> > > global variables for tracking drivers, libraries, etc., and then
> > > includes other build files, before finishing by writing the global
> > > build configuration header file and a DPDK pkgconfig file at the
> > > end, using some of those same globals.
> > > 
> > > From the top level build file, the only include file thus far is
> > > for the config folder, which does some other setup of global
> > > configuration parameters, including pulling in architecture
> > > specific parameters from an architectural subdirectory. A number
> > > of configuration build options are provided for the project to
> > > tune a number of global variables which will be used later e.g.
> > > max numa nodes, max cores, etc. These settings all make their way
> > > to the global build config header "rte_build_config.h". There is
> > > also a file "rte_config.h", which includes "rte_build_config.h",
> > > and this file is meant to hold other build-time values which are
> > > present in our current static build configuration but are not
> > > normally meant for user-configuration. Ideally, over time, the
> > > values placed here should be moved to the individual libraries or
> > > drivers which want those values.
> > > 
> > > Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> > 
> > Comments inline below;
> > 
> > <snip>
> > 
> > > diff --git a/config/meson.build b/config/meson.build
> > <snip>
> > > +# 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
> > 
> > I can't fault the code here, or Meson, just noting that the
> > disabling of these warnings causes prints on GCC 4.8.5 and GCC
> > 5.4.0, GCC 7 only prints on -Wno-address-of-packed-member. Clang
> > handles it correctly - and no out-of-the-ordinary prints occur. No
> > code changes required here.
> >
> 
> Strange. Just tested with gcc 4.8.5 and gcc 5.4, and everything worked
> as expected, no errors or warnings.
> 
Dug into the invalid flag warnings a bit more and found a number of
items in the root cause.

First is that gcc only complains about invalid -Wno-* parameters in the
case where there is another error or warning being printed. This
explains why the warnings are only seen for some files, rather than
others.
Second is that, because of this meson, is not correctly identifying the
relevant flags as unsupported by the compiler. I'm looking to upstream
to meson a fix for this.
Third is that there are more warnings that need to be disabled for some
files when compiled with gcc 5.4. So long as there are no other problems
with the code, gcc will never print the errors about the invalid warning
disable flags.

So, for V2 of this, I hope to fix point 3.

/Bruce

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

* Re: [PATCH 01/17] build: add initial infrastructure for meson & ninja builds
  2017-09-06 16:18       ` Bruce Richardson
@ 2017-09-07 13:52         ` Bruce Richardson
  0 siblings, 0 replies; 107+ messages in thread
From: Bruce Richardson @ 2017-09-07 13:52 UTC (permalink / raw)
  To: Van Haaren, Harry; +Cc: dev

On Wed, Sep 06, 2017 at 05:18:46PM +0100, Bruce Richardson wrote:
> On Mon, Sep 04, 2017 at 02:51:01PM +0100, Bruce Richardson wrote:
> > On Mon, Sep 04, 2017 at 02:36:42PM +0100, Van Haaren, Harry wrote:
> > > > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Bruce
> > > > Richardson Sent: Friday, September 1, 2017 11:04 AM To:
> > > > dev@dpdk.org Cc: Richardson, Bruce <bruce.richardson@intel.com>
> > > > Subject: [dpdk-dev] [PATCH 01/17] build: add initial
> > > > infrastructure for meson & ninja builds
> > > > 
> > > > To build with meson and ninja, we need some initial
> > > > infrastructure in place. The build files for meson always need
> > > > to be called "meson.build", and options get placed in
> > > > meson_options.txt
> > > > 
> > > > This commit adds a top-level meson.build file, which sets up the
> > > > global variables for tracking drivers, libraries, etc., and then
> > > > includes other build files, before finishing by writing the
> > > > global build configuration header file and a DPDK pkgconfig file
> > > > at the end, using some of those same globals.
> > > > 
> > > > From the top level build file, the only include file thus far is
> > > > for the config folder, which does some other setup of global
> > > > configuration parameters, including pulling in architecture
> > > > specific parameters from an architectural subdirectory. A number
> > > > of configuration build options are provided for the project to
> > > > tune a number of global variables which will be used later e.g.
> > > > max numa nodes, max cores, etc. These settings all make their
> > > > way to the global build config header "rte_build_config.h".
> > > > There is also a file "rte_config.h", which includes
> > > > "rte_build_config.h", and this file is meant to hold other
> > > > build-time values which are present in our current static build
> > > > configuration but are not normally meant for user-configuration.
> > > > Ideally, over time, the values placed here should be moved to
> > > > the individual libraries or drivers which want those values.
> > > > 
> > > > Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> > > 
> > > Comments inline below;
> > > 
> > > <snip>
> > > 
> > > > diff --git a/config/meson.build b/config/meson.build
> > > <snip>
> > > > +# 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
> > > 
> > > I can't fault the code here, or Meson, just noting that the
> > > disabling of these warnings causes prints on GCC 4.8.5 and GCC
> > > 5.4.0, GCC 7 only prints on -Wno-address-of-packed-member. Clang
> > > handles it correctly - and no out-of-the-ordinary prints occur. No
> > > code changes required here.
> > >
> > 
> > Strange. Just tested with gcc 4.8.5 and gcc 5.4, and everything
> > worked as expected, no errors or warnings.
> > 
> Dug into the invalid flag warnings a bit more and found a number of
> items in the root cause.
> 
> First is that gcc only complains about invalid -Wno-* parameters in
> the case where there is another error or warning being printed. This
> explains why the warnings are only seen for some files, rather than
> others.  Second is that, because of this meson, is not correctly
> identifying the relevant flags as unsupported by the compiler. I'm
> looking to upstream to meson a fix for this.  Third is that there are
> more warnings that need to be disabled for some files when compiled
> with gcc 5.4. So long as there are no other problems with the code,
> gcc will never print the errors about the invalid warning disable
> flags.
> 
> So, for V2 of this, I hope to fix point 3.
> 
[Hopefully] Final update here. It appears that this is an issue that
only appears on Ubuntu, as I can't reproduce it on Fedora with any of a
number of gcc version when I turn on -Wunused-result flag. I believe
that this may be due to extra hardening in the standard headers that is
done on Ubuntu to mark the functions as requiring the extra checking. To
fix these, rather than disable the warnings - something that may hide
other problems, I've sent two small patches [1] [2] to add return value
checks to the code as applicable.

/Bruce

[1] http://dpdk.org/dev/patchwork/patch/28457/
[2] http://dpdk.org/dev/patchwork/patch/28458/

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

* Re: [dpdk-dev, 01/17] build: add initial infrastructure for meson & ninja builds
  2017-09-01 10:04 ` [PATCH 01/17] build: add initial infrastructure for meson & ninja builds Bruce Richardson
  2017-09-04 13:36   ` Van Haaren, Harry
@ 2017-09-07 16:21   ` Neil Horman
  2017-09-07 16:47     ` Wiles, Keith
  2017-09-08  8:50     ` Bruce Richardson
  2017-09-08 16:03   ` [PATCH " Van Haaren, Harry
  2 siblings, 2 replies; 107+ messages in thread
From: Neil Horman @ 2017-09-07 16:21 UTC (permalink / raw)
  To: Bruce Richardson; +Cc: dev

On Fri, Sep 01, 2017 at 11:04:00AM +0100, Bruce Richardson wrote:
> To build with meson and ninja, we need some initial infrastructure in
> place. The build files for meson always need to be called "meson.build",
> and options get placed in meson_options.txt
> 
> This commit adds a top-level meson.build file, which sets up the global
> variables for tracking drivers, libraries, etc., and then includes other
> build files, before finishing by writing the global build configuration
> header file and a DPDK pkgconfig file at the end, using some of those same
> globals.
> 
> >From the top level build file, the only include file thus far is for the
> config folder, which does some other setup of global configuration
> parameters, including pulling in architecture specific parameters from an
> architectural subdirectory. A number of configuration build options are
> provided for the project to tune a number of global variables which will be
> used later e.g. max numa nodes, max cores, etc. These settings all make
> their way to the global build config header "rte_build_config.h". There is
> also a file "rte_config.h", which includes "rte_build_config.h", and this
> file is meant to hold other build-time values which are present in our
> current static build configuration but are not normally meant for
> user-configuration. Ideally, over time, the values placed here should be
> moved to the individual libraries or drivers which want those values.
> 
> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> Reviewed-by: Harry van Haaren <harry.van.haaren@intel.com>

I feel like I need to underscore my previous concern here.  While I'm not
opposed per-se to a new build system, I am very concerned about the burden that
switching places on downstream consumers, in particular distributions (since I
represent one of them).  Moving to a new build system with new tools means those
tools need to be packaged, tested and shipped, which is a significant work
effort.  While it might be a net gain long term, its something you need to keep
in mind when making these changes.

I know you've said that we will be keepting the existing build system, I just
need to be sure everyone understands just how important that is.

Though perhaps the time frame for keeping the current build system as priarmy is
less concerning, as feature parity is even more critical.  That is to say, the
new build system must be able to produce the same configurations that the
current build system does.  Without it I don't think anyone will be able to use
it consistently, and that will leave a great number of users in a very poor
position.  I think getting a little closer to parity with the current system is
warranted.  I'd suggest as a gating factor:

1) Building on all supported arches
2) Cross building on all supported arches
3) Proper identification of targeted machine (i.e. equivalent of the machine
component of the current build system)

Specific notes inline

> ---
>  config/meson.build     | 69 +++++++++++++++++++++++++++++++++++++++++
>  config/rte_config.h    | 50 ++++++++++++++++++++++++++++++
>  config/x86/meson.build | 70 ++++++++++++++++++++++++++++++++++++++++++
>  meson.build            | 83 ++++++++++++++++++++++++++++++++++++++++++++++++++
>  meson_options.txt      |  6 ++++
>  5 files changed, 278 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
> 
> diff --git a/config/meson.build b/config/meson.build
> new file mode 100644
> index 000000000..3a6bcc58d
> --- /dev/null
> +++ b/config/meson.build
> @@ -0,0 +1,69 @@
> +#   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')
So, in the current build system, arch defined the process architecture, while
'machine' defined the specific processor family (nhm, ivb, etc).  This seems
like you are merging those two concepts together.  While that seems reasonable,
is that going to be workable with non-x86 architectures?

Have you considered using the cross-script option in meson to define a per arch
build file? That I think would eliminate some of this top level parsing of arch
options

> +# 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')
> +
> +# 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')
> +	arch_subdir = 'x86'
> +	subdir(arch_subdir)
> +endif
> +dpdk_conf.set('RTE_COMPILE_TIME_CPUFLAGS', ','.join(compile_time_cpuflags))
> +
Likewise, I think if you use the --cross-script approach, this logic gets
eliminated in favor of a file pointer from the command line

<snip>


> +
> +# set up some global vars for compiler, platform, configuration, etc.
> +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
> +if get_option('default_library') == 'static'
> +	driver_install_path = get_option('libdir')
> +else
> +	driver_install_path = '@0@/dpdk/drivers'.format(get_option('prefix'))
> +endif
> +
So, I like this, as it appears to default to shared library builds, which is
great.  Unfortunately, it doesn't seem to work for me when using this command:

meson -Ddefault_library=static -Dlibdir=./build/lib . build

If I do that and then run ninja in my build directory, I still get DSO's not
static libraries.  I am assuming that I'm doing something subtly wrong in my
build, but I can't seem to see what it is.

On the other hand, if static builds don't work yet, thats going to be an issue.

<snip>

> +# configure the build, and make sure configs here and in config folder are
> +# 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')
> +subdir('config')
> +
> +# TODO build libs and drivers
> +
> +# TODO build binaries and installable tools
> +
This seems outdated, but I think you remove it in a later patch

Neil

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

* Re: [dpdk-dev, 02/17] eal: add eal library to meson build
  2017-09-01 10:04 ` [PATCH 02/17] eal: add eal library to meson build Bruce Richardson
  2017-09-04 13:53   ` Van Haaren, Harry
@ 2017-09-07 16:25   ` Neil Horman
  2017-09-08  8:51     ` Bruce Richardson
  1 sibling, 1 reply; 107+ messages in thread
From: Neil Horman @ 2017-09-07 16:25 UTC (permalink / raw)
  To: Bruce Richardson; +Cc: dev

On Fri, Sep 01, 2017 at 11:04:01AM +0100, Bruce Richardson wrote:
> Support building the EAL with meson and ninja. This involves a number of
> different meson.build files for iterating through all the different
> subdirectories in the EAL. The library itself will be compiled on build but
> the header files are only copied from their initial location once "ninja
> install" is run. Instead, we use meson dependency tracking to ensure that
> other libraries which use the EAL headers can find them in their original
> locations.
> 
> Note: this does not include building kernel modules on either BSD or Linux
> 
> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> Reviewed-by: Harry van Haaren <harry.van.haaren@intel.com>
> ---
>  config/rte_config.h                                | 11 ++++
>  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/meson.build                | 32 ++++++++++
>  lib/librte_eal/meson.build                         | 44 +++++++++++++
>  lib/meson.build                                    | 32 ++++++++++
>  meson.build                                        |  3 +-
>  14 files changed, 580 insertions(+), 1 deletion(-)
>  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/meson.build
>  create mode 100644 lib/librte_eal/meson.build
>  create mode 100644 lib/meson.build
> 
> diff --git a/config/rte_config.h b/config/rte_config.h
> index 79b0db90f..252b087ad 100644
> --- a/config/rte_config.h
> +++ b/config/rte_config.h
> @@ -47,4 +47,15 @@
>  
>  #include <rte_build_config.h>
>  
> +/****** library defines ********/
> +
> +/* 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_ */
> diff --git a/lib/librte_eal/bsdapp/eal/meson.build b/lib/librte_eal/bsdapp/eal/meson.build
> new file mode 100644
> index 000000000..bc9c3f0cb
> --- /dev/null
> +++ b/lib/librte_eal/bsdapp/eal/meson.build
> @@ -0,0 +1,67 @@
> +#   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')
> +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_extra_link_arg = '-lexecinfo'
> +
> +version_map = join_paths(meson.current_source_dir(), 'rte_eal_version.map')
Odd quesion, only for my own education.  Does the version map get treated as a
dependency here?  That is to say, if I update it, does the assocated library get
rebuilt?  The current build system missed this, and it would be nice if it got
included in the new one.

> +eal_lib = library('rte_eal', sources, eal_common_sources, eal_common_arch_sources,
> +			dependencies: dependency('threads'),
> +			include_directories : eal_inc,
> +			version: '@0@.1'.format(version),
> +			c_args: '-D_GNU_SOURCE',
> +			link_depends: version_map,
> +			link_args: [eal_extra_link_arg,
> +				'-Wl,--version-script=' + version_map],
> +			install: true
> +)
> +


Neil

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

* Re: [dpdk-dev, 01/17] build: add initial infrastructure for meson & ninja builds
  2017-09-07 16:21   ` [dpdk-dev, " Neil Horman
@ 2017-09-07 16:47     ` Wiles, Keith
  2017-09-07 17:12       ` Neil Horman
  2017-09-08  8:50     ` Bruce Richardson
  1 sibling, 1 reply; 107+ messages in thread
From: Wiles, Keith @ 2017-09-07 16:47 UTC (permalink / raw)
  To: Neil Horman; +Cc: Richardson, Bruce, dev


> On Sep 7, 2017, at 9:21 AM, Neil Horman <nhorman@tuxdriver.com> wrote:
> 
> On Fri, Sep 01, 2017 at 11:04:00AM +0100, Bruce Richardson wrote:
>> To build with meson and ninja, we need some initial infrastructure in
>> place. The build files for meson always need to be called "meson.build",
>> and options get placed in meson_options.txt
>> 
>> This commit adds a top-level meson.build file, which sets up the global
>> variables for tracking drivers, libraries, etc., and then includes other
>> build files, before finishing by writing the global build configuration
>> header file and a DPDK pkgconfig file at the end, using some of those same
>> globals.
>> 
>>> From the top level build file, the only include file thus far is for the
>> config folder, which does some other setup of global configuration
>> parameters, including pulling in architecture specific parameters from an
>> architectural subdirectory. A number of configuration build options are
>> provided for the project to tune a number of global variables which will be
>> used later e.g. max numa nodes, max cores, etc. These settings all make
>> their way to the global build config header "rte_build_config.h". There is
>> also a file "rte_config.h", which includes "rte_build_config.h", and this
>> file is meant to hold other build-time values which are present in our
>> current static build configuration but are not normally meant for
>> user-configuration. Ideally, over time, the values placed here should be
>> moved to the individual libraries or drivers which want those values.
>> 
>> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
>> Reviewed-by: Harry van Haaren <harry.van.haaren@intel.com>
> 
> I feel like I need to underscore my previous concern here.  While I'm not
> opposed per-se to a new build system, I am very concerned about the burden that
> switching places on downstream consumers, in particular distributions (since I
> represent one of them).  Moving to a new build system with new tools means those
> tools need to be packaged, tested and shipped, which is a significant work
> effort.  While it might be a net gain long term, its something you need to keep
> in mind when making these changes.
> 
> I know you've said that we will be keepting the existing build system, I just
> need to be sure everyone understands just how important that is.
> 
> Though perhaps the time frame for keeping the current build system as priarmy is
> less concerning, as feature parity is even more critical.  That is to say, the
> new build system must be able to produce the same configurations that the
> current build system does.  Without it I don't think anyone will be able to use
> it consistently, and that will leave a great number of users in a very poor
> position.  I think getting a little closer to parity with the current system is
> warranted.  I'd suggest as a gating factor:
> 
> 1) Building on all supported arches
> 2) Cross building on all supported arches
> 3) Proper identification of targeted machine (i.e. equivalent of the machine
> component of the current build system)

I think your concerns are important and we have to keep the current build system even after the new build system is at parity with the current one. We most likely will have to keep the current build system around for a while like year or more as it will be hard for all distros to convert and add the needed tools to build with DPDK. The problem will be making sure changes in one are reflected in the other build system.

The new build system has a lot of advantages and Bruce is doing a good job, but we need to open it up into a project for more to contribute, which I assume is the goal here.

> 
> Specific notes inline
> 
>> ---
>> config/meson.build     | 69 +++++++++++++++++++++++++++++++++++++++++
>> config/rte_config.h    | 50 ++++++++++++++++++++++++++++++
>> config/x86/meson.build | 70 ++++++++++++++++++++++++++++++++++++++++++
>> meson.build            | 83 ++++++++++++++++++++++++++++++++++++++++++++++++++
>> meson_options.txt      |  6 ++++
>> 5 files changed, 278 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
>> 
>> diff --git a/config/meson.build b/config/meson.build
>> new file mode 100644
>> index 000000000..3a6bcc58d
>> --- /dev/null
>> +++ b/config/meson.build
>> @@ -0,0 +1,69 @@
>> +#   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')
> So, in the current build system, arch defined the process architecture, while
> 'machine' defined the specific processor family (nhm, ivb, etc).  This seems
> like you are merging those two concepts together.  While that seems reasonable,
> is that going to be workable with non-x86 architectures?
> 
> Have you considered using the cross-script option in meson to define a per arch
> build file? That I think would eliminate some of this top level parsing of arch
> options
> 
>> +# 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')
>> +
>> +# 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')
>> +	arch_subdir = 'x86'
>> +	subdir(arch_subdir)
>> +endif
>> +dpdk_conf.set('RTE_COMPILE_TIME_CPUFLAGS', ','.join(compile_time_cpuflags))
>> +
> Likewise, I think if you use the --cross-script approach, this logic gets
> eliminated in favor of a file pointer from the command line
> 
> <snip>
> 
> 
>> +
>> +# set up some global vars for compiler, platform, configuration, etc.
>> +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
>> +if get_option('default_library') == 'static'
>> +	driver_install_path = get_option('libdir')
>> +else
>> +	driver_install_path = '@0@/dpdk/drivers'.format(get_option('prefix'))
>> +endif
>> +
> So, I like this, as it appears to default to shared library builds, which is
> great.  Unfortunately, it doesn't seem to work for me when using this command:
> 
> meson -Ddefault_library=static -Dlibdir=./build/lib . build

In a previous version of the build system I just edited the meson_option.txt file can changed it to static and that worked. The command line should work, but have not tried that option.

> 
> If I do that and then run ninja in my build directory, I still get DSO's not
> static libraries.  I am assuming that I'm doing something subtly wrong in my
> build, but I can't seem to see what it is.
> 
> On the other hand, if static builds don't work yet, thats going to be an issue.
> 
> <snip>
> 
>> +# configure the build, and make sure configs here and in config folder are
>> +# 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')
>> +subdir('config')
>> +
>> +# TODO build libs and drivers
>> +
>> +# TODO build binaries and installable tools
>> +
> This seems outdated, but I think you remove it in a later patch
> 
> Neil

Regards,
Keith

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

* Re: [dpdk-dev, 16/17] build: add option to version libs using DPDK version
  2017-09-01 10:04 ` [PATCH 16/17] build: add option to version libs using DPDK version Bruce Richardson
@ 2017-09-07 17:07   ` Neil Horman
  2017-09-08  8:58     ` Bruce Richardson
  0 siblings, 1 reply; 107+ messages in thread
From: Neil Horman @ 2017-09-07 17:07 UTC (permalink / raw)
  To: Bruce Richardson; +Cc: dev

On Fri, Sep 01, 2017 at 11:04:15AM +0100, Bruce Richardson wrote:
> Normally, each library has it's own version number based on the ABI.
> Add an option to have all libs just use the DPDK version number as the
> .so version.
> 
> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> ---
>  drivers/meson.build | 8 +++++++-
>  lib/meson.build     | 8 +++++++-
>  meson_options.txt   | 1 +
>  3 files changed, 15 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/meson.build b/drivers/meson.build
> index d7a614f83..76d610a5b 100644
> --- a/drivers/meson.build
> +++ b/drivers/meson.build
> @@ -92,6 +92,12 @@ foreach class:driver_classes
>  						depends: [pmdinfogen, tmp_lib])
>  			endforeach
>  
> +			if get_option('per_library_versions')
> +				so_version = '@0@.1'.format(version)
> +			else
> +				so_version = meson.project_version()
> +			endif
> +

I'm not sure this is a good idea.  If we default to using the defined project
version number, we commit to, by default incrementing the library version number
on each release, even if the ABI hasn't changed, which means that the purpose of
versioning (creating compatibility between library releases), is rendered
useless.

Neil

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

* Re: [dpdk-dev, 01/17] build: add initial infrastructure for meson & ninja builds
  2017-09-07 16:47     ` Wiles, Keith
@ 2017-09-07 17:12       ` Neil Horman
  0 siblings, 0 replies; 107+ messages in thread
From: Neil Horman @ 2017-09-07 17:12 UTC (permalink / raw)
  To: Wiles, Keith; +Cc: Richardson, Bruce, dev

On Thu, Sep 07, 2017 at 04:47:00PM +0000, Wiles, Keith wrote:
> 
> > On Sep 7, 2017, at 9:21 AM, Neil Horman <nhorman@tuxdriver.com> wrote:
> > 
> > On Fri, Sep 01, 2017 at 11:04:00AM +0100, Bruce Richardson wrote:
> >> To build with meson and ninja, we need some initial infrastructure in
> >> place. The build files for meson always need to be called "meson.build",
> >> and options get placed in meson_options.txt
> >> 
> >> This commit adds a top-level meson.build file, which sets up the global
> >> variables for tracking drivers, libraries, etc., and then includes other
> >> build files, before finishing by writing the global build configuration
> >> header file and a DPDK pkgconfig file at the end, using some of those same
> >> globals.
> >> 
> >>> From the top level build file, the only include file thus far is for the
> >> config folder, which does some other setup of global configuration
> >> parameters, including pulling in architecture specific parameters from an
> >> architectural subdirectory. A number of configuration build options are
> >> provided for the project to tune a number of global variables which will be
> >> used later e.g. max numa nodes, max cores, etc. These settings all make
> >> their way to the global build config header "rte_build_config.h". There is
> >> also a file "rte_config.h", which includes "rte_build_config.h", and this
> >> file is meant to hold other build-time values which are present in our
> >> current static build configuration but are not normally meant for
> >> user-configuration. Ideally, over time, the values placed here should be
> >> moved to the individual libraries or drivers which want those values.
> >> 
> >> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> >> Reviewed-by: Harry van Haaren <harry.van.haaren@intel.com>
> > 
> > I feel like I need to underscore my previous concern here.  While I'm not
> > opposed per-se to a new build system, I am very concerned about the burden that
> > switching places on downstream consumers, in particular distributions (since I
> > represent one of them).  Moving to a new build system with new tools means those
> > tools need to be packaged, tested and shipped, which is a significant work
> > effort.  While it might be a net gain long term, its something you need to keep
> > in mind when making these changes.
> > 
> > I know you've said that we will be keepting the existing build system, I just
> > need to be sure everyone understands just how important that is.
> > 
> > Though perhaps the time frame for keeping the current build system as priarmy is
> > less concerning, as feature parity is even more critical.  That is to say, the
> > new build system must be able to produce the same configurations that the
> > current build system does.  Without it I don't think anyone will be able to use
> > it consistently, and that will leave a great number of users in a very poor
> > position.  I think getting a little closer to parity with the current system is
> > warranted.  I'd suggest as a gating factor:
> > 
> > 1) Building on all supported arches
> > 2) Cross building on all supported arches
> > 3) Proper identification of targeted machine (i.e. equivalent of the machine
> > component of the current build system)
> 
> I think your concerns are important and we have to keep the current build system even after the new build system is at parity with the current one. We most likely will have to keep the current build system around for a while like year or more as it will be hard for all distros to convert and add the needed tools to build with DPDK. The problem will be making sure changes in one are reflected in the other build system.
> 
> The new build system has a lot of advantages and Bruce is doing a good job, but we need to open it up into a project for more to contribute, which I assume is the goal here.
> 
No argument, Bruce is doing a fine job here, and while I don't really agree with
the choice of tools, I have to admit its fast and somewhat slick.  But I do feel
strongly about being very careful with how we procede in its introduction.  

Neil

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

* Re: [dpdk-dev, 01/17] build: add initial infrastructure for meson & ninja builds
  2017-09-07 16:21   ` [dpdk-dev, " Neil Horman
  2017-09-07 16:47     ` Wiles, Keith
@ 2017-09-08  8:50     ` Bruce Richardson
  2017-09-08 11:57       ` Neil Horman
  1 sibling, 1 reply; 107+ messages in thread
From: Bruce Richardson @ 2017-09-08  8:50 UTC (permalink / raw)
  To: Neil Horman; +Cc: dev

On Thu, Sep 07, 2017 at 12:21:57PM -0400, Neil Horman wrote:
> On Fri, Sep 01, 2017 at 11:04:00AM +0100, Bruce Richardson wrote:
> > To build with meson and ninja, we need some initial infrastructure in
> > place. The build files for meson always need to be called "meson.build",
> > and options get placed in meson_options.txt
> > 
> > This commit adds a top-level meson.build file, which sets up the global
> > variables for tracking drivers, libraries, etc., and then includes other
> > build files, before finishing by writing the global build configuration
> > header file and a DPDK pkgconfig file at the end, using some of those same
> > globals.
> > 
> > >From the top level build file, the only include file thus far is for the
> > config folder, which does some other setup of global configuration
> > parameters, including pulling in architecture specific parameters from an
> > architectural subdirectory. A number of configuration build options are
> > provided for the project to tune a number of global variables which will be
> > used later e.g. max numa nodes, max cores, etc. These settings all make
> > their way to the global build config header "rte_build_config.h". There is
> > also a file "rte_config.h", which includes "rte_build_config.h", and this
> > file is meant to hold other build-time values which are present in our
> > current static build configuration but are not normally meant for
> > user-configuration. Ideally, over time, the values placed here should be
> > moved to the individual libraries or drivers which want those values.
> > 
> > Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> > Reviewed-by: Harry van Haaren <harry.van.haaren@intel.com>
> 
> I feel like I need to underscore my previous concern here.  While I'm not
> opposed per-se to a new build system, I am very concerned about the burden that
> switching places on downstream consumers, in particular distributions (since I
> represent one of them).  Moving to a new build system with new tools means those
> tools need to be packaged, tested and shipped, which is a significant work
> effort.  While it might be a net gain long term, its something you need to keep
> in mind when making these changes.
> 
Understood. If there is anything we/I can do to make this transition
easier, please flag it for consideration.

> I know you've said that we will be keepting the existing build system,
> I just need to be sure everyone understands just how important that
> is.
> 
What is your feeling here, in terms of timescale. After any new system
reaches feature parity, how long would you estimate that we would need
to support the existing makefile system before it would be safe to
deprecate it? Should we start a deprecation plan, or is it best just to
commit to support both until we get all - or almost all - downstream
consumers switched over? While I wouldn't push for deprecating the old
system any time soon, and I wouldn't consider maintaining the two
unduly burdensome, it's not something we want to do in the long term.

> Though perhaps the time frame for keeping the current build system as priarmy is
> less concerning, as feature parity is even more critical.  That is to say, the
> new build system must be able to produce the same configurations that the
> current build system does.  Without it I don't think anyone will be able to use
> it consistently, and that will leave a great number of users in a very poor
> position.  I think getting a little closer to parity with the current system is
> warranted.  I'd suggest as a gating factor:
> 
> 1) Building on all supported arches
> 2) Cross building on all supported arches
> 3) Proper identification of targeted machine (i.e. equivalent of the machine
> component of the current build system)
> 
The question there is gating factor for what? Presumably not for merging
into the staging tree. But for merging into the main tree for releases?
I'd push back a little on that, as the new system does not interfere in
any way with the old, and by keeping it in a staging tree until it
reaches full feature parity will make the job considerably harder. For
example, it means that anyone submitting a new driver or library has to
submit the code and makefiles in one set and the meson patches in a
separate one for a separate build tree. It also makes it less likely
that people will try out the new system and find the issues with it, and
help fill in the gaps. While I can understand us not recommending the
new build system until it reaches feature parity, I think there are a
lot of benefits to be got by making it widely available, even if it's
incomplete. 

On a semi-related note, some folks here are chomping at the bit for it
to get mainlined, as they want the improved build time for recompiles
for speed up their development process. They can work off the posted
patches, but it's more painful than having it locked in.

> Specific notes inline
> 
> > ---
> >  config/meson.build     | 69 +++++++++++++++++++++++++++++++++++++++++
> >  config/rte_config.h    | 50 ++++++++++++++++++++++++++++++
> >  config/x86/meson.build | 70 ++++++++++++++++++++++++++++++++++++++++++
> >  meson.build            | 83 ++++++++++++++++++++++++++++++++++++++++++++++++++
> >  meson_options.txt      |  6 ++++
> >  5 files changed, 278 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
> > 
> > diff --git a/config/meson.build b/config/meson.build
> > new file mode 100644
> > index 000000000..3a6bcc58d
> > --- /dev/null
> > +++ b/config/meson.build
> > @@ -0,0 +1,69 @@
> > +#   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')
> So, in the current build system, arch defined the process architecture, while
> 'machine' defined the specific processor family (nhm, ivb, etc).  This seems
> like you are merging those two concepts together.  While that seems reasonable,
> is that going to be workable with non-x86 architectures?
> 
I'm not sure I am, but I'm not familiar enough with other architectures
to be sure. I'd appreciate some feedback from those more familiar with
ARM/PPC to help support the effort to be sure.

For now, in this set, the machine value is being used as now on IA, a
tuning flag to be passed to the compiler. The actual architecture is
pulled from host_machine.cpu_family() - which is the final target
machine the case of a cross build.

> Have you considered using the cross-script option in meson to define a per arch
> build file? That I think would eliminate some of this top level parsing of arch
> options
> 

No, I haven't looked into that yet, but I will do so shortly. I'd still
look to get this in as a starting baseline and then modify it as
necessary.

> > +# 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')
> > +
> > +# 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')
> > +	arch_subdir = 'x86'
> > +	subdir(arch_subdir)
> > +endif
> > +dpdk_conf.set('RTE_COMPILE_TIME_CPUFLAGS', ','.join(compile_time_cpuflags))
> > +
> Likewise, I think if you use the --cross-script approach, this logic gets
> eliminated in favor of a file pointer from the command line
> 
> <snip>
> 
I'd rather not force the use of a cross-script if not cross-compiling.

> 
> > +
> > +# set up some global vars for compiler, platform, configuration, etc.
> > +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
> > +if get_option('default_library') == 'static'
> > +	driver_install_path = get_option('libdir')
> > +else
> > +	driver_install_path = '@0@/dpdk/drivers'.format(get_option('prefix'))
> > +endif
> > +
> So, I like this, as it appears to default to shared library builds, which is
> great.  Unfortunately, it doesn't seem to work for me when using this command:
> 
> meson -Ddefault_library=static -Dlibdir=./build/lib . build
> 

meson --default-library=static ...

> If I do that and then run ninja in my build directory, I still get DSO's not
> static libraries.  I am assuming that I'm doing something subtly wrong in my
> build, but I can't seem to see what it is.
> 
> On the other hand, if static builds don't work yet, thats going to be an issue.
> 
> <snip>
> 
> > +# configure the build, and make sure configs here and in config folder are
> > +# 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')
> > +subdir('config')
> > +
> > +# TODO build libs and drivers
> > +
> > +# TODO build binaries and installable tools
> > +
> This seems outdated, but I think you remove it in a later patch
> 
Yep. I put them in as comment placeholders in the early patches to show
where things would go in later ones to try and make the flow clearer
i.e. they were deliberately put in, even though removed later.

Thanks for the feedback.

/Bruce

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

* Re: [dpdk-dev, 02/17] eal: add eal library to meson build
  2017-09-07 16:25   ` [dpdk-dev, " Neil Horman
@ 2017-09-08  8:51     ` Bruce Richardson
  0 siblings, 0 replies; 107+ messages in thread
From: Bruce Richardson @ 2017-09-08  8:51 UTC (permalink / raw)
  To: Neil Horman; +Cc: dev

On Thu, Sep 07, 2017 at 12:25:29PM -0400, Neil Horman wrote:
> On Fri, Sep 01, 2017 at 11:04:01AM +0100, Bruce Richardson wrote:
> > Support building the EAL with meson and ninja. This involves a number of
> > different meson.build files for iterating through all the different
> > subdirectories in the EAL. The library itself will be compiled on build but
> > the header files are only copied from their initial location once "ninja
> > install" is run. Instead, we use meson dependency tracking to ensure that
> > other libraries which use the EAL headers can find them in their original
> > locations.
> > 
> > Note: this does not include building kernel modules on either BSD or Linux
> > 
> > Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> > Reviewed-by: Harry van Haaren <harry.van.haaren@intel.com>
> > ---
> >  config/rte_config.h                                | 11 ++++
> >  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/meson.build                | 32 ++++++++++
> >  lib/librte_eal/meson.build                         | 44 +++++++++++++
> >  lib/meson.build                                    | 32 ++++++++++
> >  meson.build                                        |  3 +-
> >  14 files changed, 580 insertions(+), 1 deletion(-)
> >  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/meson.build
> >  create mode 100644 lib/librte_eal/meson.build
> >  create mode 100644 lib/meson.build
> > 
> > diff --git a/config/rte_config.h b/config/rte_config.h
> > index 79b0db90f..252b087ad 100644
> > --- a/config/rte_config.h
> > +++ b/config/rte_config.h
> > @@ -47,4 +47,15 @@
> >  
> >  #include <rte_build_config.h>
> >  
> > +/****** library defines ********/
> > +
> > +/* 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_ */
> > diff --git a/lib/librte_eal/bsdapp/eal/meson.build b/lib/librte_eal/bsdapp/eal/meson.build
> > new file mode 100644
> > index 000000000..bc9c3f0cb
> > --- /dev/null
> > +++ b/lib/librte_eal/bsdapp/eal/meson.build
> > @@ -0,0 +1,67 @@
> > +#   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')
> > +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_extra_link_arg = '-lexecinfo'
> > +
> > +version_map = join_paths(meson.current_source_dir(), 'rte_eal_version.map')
> Odd quesion, only for my own education.  Does the version map get treated as a
> dependency here?  That is to say, if I update it, does the assocated library get
> rebuilt?  The current build system missed this, and it would be nice if it got
> included in the new one.
> 
That should be the case, as it explicitly called out as link dependency in
the library call below.

> > +eal_lib = library('rte_eal', sources, eal_common_sources, eal_common_arch_sources,
> > +			dependencies: dependency('threads'),
> > +			include_directories : eal_inc,
> > +			version: '@0@.1'.format(version),
> > +			c_args: '-D_GNU_SOURCE',
> > +			link_depends: version_map,
> > +			link_args: [eal_extra_link_arg,
> > +				'-Wl,--version-script=' + version_map],
> > +			install: true
> > +)
> > +
> 
> 
> Neil
> 

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

* Re: [dpdk-dev, 16/17] build: add option to version libs using DPDK version
  2017-09-07 17:07   ` [dpdk-dev, " Neil Horman
@ 2017-09-08  8:58     ` Bruce Richardson
  0 siblings, 0 replies; 107+ messages in thread
From: Bruce Richardson @ 2017-09-08  8:58 UTC (permalink / raw)
  To: Neil Horman; +Cc: dev

On Thu, Sep 07, 2017 at 01:07:19PM -0400, Neil Horman wrote:
> On Fri, Sep 01, 2017 at 11:04:15AM +0100, Bruce Richardson wrote:
> > Normally, each library has it's own version number based on the ABI.
> > Add an option to have all libs just use the DPDK version number as
> > the .so version.
> > 
> > Signed-off-by: Bruce Richardson <bruce.richardson@intel.com> ---
> > drivers/meson.build | 8 +++++++- lib/meson.build     | 8 +++++++-
> > meson_options.txt   | 1 + 3 files changed, 15 insertions(+), 2
> > deletions(-)
> > 
> > diff --git a/drivers/meson.build b/drivers/meson.build index
> > d7a614f83..76d610a5b 100644 --- a/drivers/meson.build +++
> > b/drivers/meson.build @@ -92,6 +92,12 @@ foreach
> > class:driver_classes depends: [pmdinfogen, tmp_lib]) endforeach
> >  
> > +			if get_option('per_library_versions') +
> > so_version = '@0@.1'.format(version) +			else +
> > so_version = meson.project_version() +			endif +
> 
> I'm not sure this is a good idea.  If we default to using the defined
> project version number, we commit to, by default incrementing the
> library version number on each release, even if the ABI hasn't
> changed, which means that the purpose of versioning (creating
> compatibility between library releases), is rendered useless.
>
Yes, I agree on the compatibility, so the default for this option is to
have individual .so versions, as right now. This option itself was added
at the request of some distros [1][2], who wanted to just use a single
version number across all DPDK.

/Bruce

[1] http://dpdk.org/ml/archives/dev/2017-August/072969.html
[2] http://dpdk.org/ml/archives/dev/2017-August/072976.html

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

* Re: [dpdk-dev, 01/17] build: add initial infrastructure for meson & ninja builds
  2017-09-08  8:50     ` Bruce Richardson
@ 2017-09-08 11:57       ` Neil Horman
  2017-09-08 13:55         ` Bruce Richardson
  0 siblings, 1 reply; 107+ messages in thread
From: Neil Horman @ 2017-09-08 11:57 UTC (permalink / raw)
  To: Bruce Richardson; +Cc: dev

On Fri, Sep 08, 2017 at 09:50:26AM +0100, Bruce Richardson wrote:
> On Thu, Sep 07, 2017 at 12:21:57PM -0400, Neil Horman wrote:
> > On Fri, Sep 01, 2017 at 11:04:00AM +0100, Bruce Richardson wrote:
> > > To build with meson and ninja, we need some initial infrastructure in
> > > place. The build files for meson always need to be called "meson.build",
> > > and options get placed in meson_options.txt
> > > 
> > > This commit adds a top-level meson.build file, which sets up the global
> > > variables for tracking drivers, libraries, etc., and then includes other
> > > build files, before finishing by writing the global build configuration
> > > header file and a DPDK pkgconfig file at the end, using some of those same
> > > globals.
> > > 
> > > >From the top level build file, the only include file thus far is for the
> > > config folder, which does some other setup of global configuration
> > > parameters, including pulling in architecture specific parameters from an
> > > architectural subdirectory. A number of configuration build options are
> > > provided for the project to tune a number of global variables which will be
> > > used later e.g. max numa nodes, max cores, etc. These settings all make
> > > their way to the global build config header "rte_build_config.h". There is
> > > also a file "rte_config.h", which includes "rte_build_config.h", and this
> > > file is meant to hold other build-time values which are present in our
> > > current static build configuration but are not normally meant for
> > > user-configuration. Ideally, over time, the values placed here should be
> > > moved to the individual libraries or drivers which want those values.
> > > 
> > > Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> > > Reviewed-by: Harry van Haaren <harry.van.haaren@intel.com>
> > 
> > I feel like I need to underscore my previous concern here.  While I'm not
> > opposed per-se to a new build system, I am very concerned about the burden that
> > switching places on downstream consumers, in particular distributions (since I
> > represent one of them).  Moving to a new build system with new tools means those
> > tools need to be packaged, tested and shipped, which is a significant work
> > effort.  While it might be a net gain long term, its something you need to keep
> > in mind when making these changes.
> > 
> Understood. If there is anything we/I can do to make this transition
> easier, please flag it for consideration.
> 
Thank you, I appreciate that.

> > I know you've said that we will be keepting the existing build system,
> > I just need to be sure everyone understands just how important that
> > is.
> > 
> What is your feeling here, in terms of timescale. After any new system
> reaches feature parity, how long would you estimate that we would need
> to support the existing makefile system before it would be safe to
> deprecate it? Should we start a deprecation plan, or is it best just to
> commit to support both until we get all - or almost all - downstream
> consumers switched over? While I wouldn't push for deprecating the old
> system any time soon, and I wouldn't consider maintaining the two
> unduly burdensome, it's not something we want to do in the long term.
> 
I was hoping to avoid putting a specific time frame on it, but its a fair
question to ask.  I feel like any particular timetable is somewhat arbitrary.
Keith suggested a year, which is likely as good as any in my mind.  To put a bit
more detail behind it, a RHEL release cycle is anywhere from 6 to 18 months, so
a year fits well.  If we assume starting a few weeks back when you first
proposed this change, that its going to be merged, that gives us time to package
the build components, build the new package using them, get it through a qa
cycle and fix anything that pops up as a result.  That way, when the switch is
made, it can be done with an immediate deprecation of the old build system with
a level of confidence that some of the more esoteric build targets/configs will
likely work.

> > Though perhaps the time frame for keeping the current build system as priarmy is
> > less concerning, as feature parity is even more critical.  That is to say, the
> > new build system must be able to produce the same configurations that the
> > current build system does.  Without it I don't think anyone will be able to use
> > it consistently, and that will leave a great number of users in a very poor
> > position.  I think getting a little closer to parity with the current system is
> > warranted.  I'd suggest as a gating factor:
> > 
> > 1) Building on all supported arches
> > 2) Cross building on all supported arches
> > 3) Proper identification of targeted machine (i.e. equivalent of the machine
> > component of the current build system)
> > 
> The question there is gating factor for what? Presumably not for merging
> into the staging tree. But for merging into the main tree for releases?
> I'd push back a little on that, as the new system does not interfere in
> any way with the old, and by keeping it in a staging tree until it
> reaches full feature parity will make the job considerably harder. For
> example, it means that anyone submitting a new driver or library has to
> submit the code and makefiles in one set and the meson patches in a
> separate one for a separate build tree. It also makes it less likely
> that people will try out the new system and find the issues with it, and
> help fill in the gaps. While I can understand us not recommending the
> new build system until it reaches feature parity, I think there are a
> lot of benefits to be got by making it widely available, even if it's
> incomplete. 

Yes, sorry, the implied "what" here is gating its introduction to mainline.  I
have no problem with this going into a development or staging branch/tree, only
with it getting merged to mainline and becoming the primary build system today.
I get that it makes reaching feature parity harder, but to not do so relegates
anyone that hasn't had a chance to test the new build system to second class
citizen status (or at least potentially does so).  To be a bit more specific, I
can see how energized you might be to get this in place now because you've
tested it on a wide array on intel hardware, but I'm guessing if it went in
today, people at IBM and Linaro would have to drop active developement to start
switching their build environments over to the new system lest they get left out
in the cold.  I think its more about balacing where the hardship lies here.

As I'm writing this, I wonder if a reasonable compromise couldn't involve the
use of CI?  That is to say, what if we integrated the build system now-ish, and
stood up an official CI instance, that both:
1) built the dpdk in all style configuration, which mandated the use of the old
build system (i.e. we implicitly mandate that the current build system stay
working, and is not forgotten), and gate patch merges on that result.

2) add a test that any change to a meson file in mainline also include a change
to the a Makefile

I'm just spitballing here, but I'm looking for ways to enforce the continued use
of the current build system above and beyond a verbal promise to do so.  The
idea is to ensure that it stays operational and primary to the development of
dpdk until build system parity is reached.

> 
> On a semi-related note, some folks here are chomping at the bit for it
> to get mainlined, as they want the improved build time for recompiles
> for speed up their development process. They can work off the posted
> patches, but it's more painful than having it locked in.
> 
I'm sure they are, but they are just one segment of the community.  While its
faster for them, it also potentially causes anyone not on that platform a
headache, because they have to figure out how to integrate the new system to
their environment.


> > Specific notes inline
> > 
> > > ---
> > >  config/meson.build     | 69 +++++++++++++++++++++++++++++++++++++++++
> > >  config/rte_config.h    | 50 ++++++++++++++++++++++++++++++
> > >  config/x86/meson.build | 70 ++++++++++++++++++++++++++++++++++++++++++
> > >  meson.build            | 83 ++++++++++++++++++++++++++++++++++++++++++++++++++
> > >  meson_options.txt      |  6 ++++
> > >  5 files changed, 278 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
> > > 
> > > diff --git a/config/meson.build b/config/meson.build
> > > new file mode 100644
> > > index 000000000..3a6bcc58d
> > > --- /dev/null
> > > +++ b/config/meson.build
> > > @@ -0,0 +1,69 @@
> > > +#   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')
> > So, in the current build system, arch defined the process architecture, while
> > 'machine' defined the specific processor family (nhm, ivb, etc).  This seems
> > like you are merging those two concepts together.  While that seems reasonable,
> > is that going to be workable with non-x86 architectures?
> > 
> I'm not sure I am, but I'm not familiar enough with other architectures
> to be sure. I'd appreciate some feedback from those more familiar with
> ARM/PPC to help support the effort to be sure.
> 
> For now, in this set, the machine value is being used as now on IA, a
> tuning flag to be passed to the compiler. The actual architecture is
> pulled from host_machine.cpu_family() - which is the final target
> machine the case of a cross build.
> 
> > Have you considered using the cross-script option in meson to define a per arch
> > build file? That I think would eliminate some of this top level parsing of arch
> > options
> > 
> 
> No, I haven't looked into that yet, but I will do so shortly. I'd still
> look to get this in as a starting baseline and then modify it as
> necessary.
> 
> > > +# 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')
> > > +
> > > +# 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')
> > > +	arch_subdir = 'x86'
> > > +	subdir(arch_subdir)
> > > +endif
> > > +dpdk_conf.set('RTE_COMPILE_TIME_CPUFLAGS', ','.join(compile_time_cpuflags))
> > > +
> > Likewise, I think if you use the --cross-script approach, this logic gets
> > eliminated in favor of a file pointer from the command line
> > 
> > <snip>
> > 
> I'd rather not force the use of a cross-script if not cross-compiling.
> 
> > 
> > > +
> > > +# set up some global vars for compiler, platform, configuration, etc.
> > > +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
> > > +if get_option('default_library') == 'static'
> > > +	driver_install_path = get_option('libdir')
> > > +else
> > > +	driver_install_path = '@0@/dpdk/drivers'.format(get_option('prefix'))
> > > +endif
> > > +
> > So, I like this, as it appears to default to shared library builds, which is
> > great.  Unfortunately, it doesn't seem to work for me when using this command:
> > 
> > meson -Ddefault_library=static -Dlibdir=./build/lib . build
> > 
> 
> meson --default-library=static ...
> 
> > If I do that and then run ninja in my build directory, I still get DSO's not
> > static libraries.  I am assuming that I'm doing something subtly wrong in my
> > build, but I can't seem to see what it is.
> > 
> > On the other hand, if static builds don't work yet, thats going to be an issue.
> > 
> > <snip>
> > 
> > > +# configure the build, and make sure configs here and in config folder are
> > > +# 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')
> > > +subdir('config')
> > > +
> > > +# TODO build libs and drivers
> > > +
> > > +# TODO build binaries and installable tools
> > > +
> > This seems outdated, but I think you remove it in a later patch
> > 
> Yep. I put them in as comment placeholders in the early patches to show
> where things would go in later ones to try and make the flow clearer
> i.e. they were deliberately put in, even though removed later.
> 
> Thanks for the feedback.
> 
> /Bruce
> 

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

* Re: [dpdk-dev, 01/17] build: add initial infrastructure for meson & ninja builds
  2017-09-08 11:57       ` Neil Horman
@ 2017-09-08 13:55         ` Bruce Richardson
  2017-09-08 14:00           ` Bruce Richardson
  0 siblings, 1 reply; 107+ messages in thread
From: Bruce Richardson @ 2017-09-08 13:55 UTC (permalink / raw)
  To: Neil Horman; +Cc: dev

On Fri, Sep 08, 2017 at 07:57:06AM -0400, Neil Horman wrote:
> On Fri, Sep 08, 2017 at 09:50:26AM +0100, Bruce Richardson wrote:
> > On Thu, Sep 07, 2017 at 12:21:57PM -0400, Neil Horman wrote:
> > > On Fri, Sep 01, 2017 at 11:04:00AM +0100, Bruce Richardson wrote:
> > > > To build with meson and ninja, we need some initial infrastructure in
> > > > place. The build files for meson always need to be called "meson.build",
> > > > and options get placed in meson_options.txt
> > > > 
> > > > This commit adds a top-level meson.build file, which sets up the global
> > > > variables for tracking drivers, libraries, etc., and then includes other
> > > > build files, before finishing by writing the global build configuration
> > > > header file and a DPDK pkgconfig file at the end, using some of those same
> > > > globals.
> > > > 
> > > > >From the top level build file, the only include file thus far is for the
> > > > config folder, which does some other setup of global configuration
> > > > parameters, including pulling in architecture specific parameters from an
> > > > architectural subdirectory. A number of configuration build options are
> > > > provided for the project to tune a number of global variables which will be
> > > > used later e.g. max numa nodes, max cores, etc. These settings all make
> > > > their way to the global build config header "rte_build_config.h". There is
> > > > also a file "rte_config.h", which includes "rte_build_config.h", and this
> > > > file is meant to hold other build-time values which are present in our
> > > > current static build configuration but are not normally meant for
> > > > user-configuration. Ideally, over time, the values placed here should be
> > > > moved to the individual libraries or drivers which want those values.
> > > > 
> > > > Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> > > > Reviewed-by: Harry van Haaren <harry.van.haaren@intel.com>
> > > 
> > > I feel like I need to underscore my previous concern here.  While I'm not
> > > opposed per-se to a new build system, I am very concerned about the burden that
> > > switching places on downstream consumers, in particular distributions (since I
> > > represent one of them).  Moving to a new build system with new tools means those
> > > tools need to be packaged, tested and shipped, which is a significant work
> > > effort.  While it might be a net gain long term, its something you need to keep
> > > in mind when making these changes.
> > > 
> > Understood. If there is anything we/I can do to make this transition
> > easier, please flag it for consideration.
> > 
> Thank you, I appreciate that.
> 
> > > I know you've said that we will be keepting the existing build system,
> > > I just need to be sure everyone understands just how important that
> > > is.
> > > 
> > What is your feeling here, in terms of timescale. After any new system
> > reaches feature parity, how long would you estimate that we would need
> > to support the existing makefile system before it would be safe to
> > deprecate it? Should we start a deprecation plan, or is it best just to
> > commit to support both until we get all - or almost all - downstream
> > consumers switched over? While I wouldn't push for deprecating the old
> > system any time soon, and I wouldn't consider maintaining the two
> > unduly burdensome, it's not something we want to do in the long term.
> > 
> I was hoping to avoid putting a specific time frame on it, but its a fair
> question to ask.  I feel like any particular timetable is somewhat arbitrary.
> Keith suggested a year, which is likely as good as any in my mind.  To put a bit
> more detail behind it, a RHEL release cycle is anywhere from 6 to 18 months, so
> a year fits well.  If we assume starting a few weeks back when you first
> proposed this change, that its going to be merged, that gives us time to package
> the build components, build the new package using them, get it through a qa
> cycle and fix anything that pops up as a result.  That way, when the switch is
> made, it can be done with an immediate deprecation of the old build system with
> a level of confidence that some of the more esoteric build targets/configs will
> likely work.
> 
> > > Though perhaps the time frame for keeping the current build system as priarmy is
> > > less concerning, as feature parity is even more critical.  That is to say, the
> > > new build system must be able to produce the same configurations that the
> > > current build system does.  Without it I don't think anyone will be able to use
> > > it consistently, and that will leave a great number of users in a very poor
> > > position.  I think getting a little closer to parity with the current system is
> > > warranted.  I'd suggest as a gating factor:
> > > 
> > > 1) Building on all supported arches
> > > 2) Cross building on all supported arches
> > > 3) Proper identification of targeted machine (i.e. equivalent of the machine
> > > component of the current build system)
> > > 
> > The question there is gating factor for what? Presumably not for merging
> > into the staging tree. But for merging into the main tree for releases?
> > I'd push back a little on that, as the new system does not interfere in
> > any way with the old, and by keeping it in a staging tree until it
> > reaches full feature parity will make the job considerably harder. For
> > example, it means that anyone submitting a new driver or library has to
> > submit the code and makefiles in one set and the meson patches in a
> > separate one for a separate build tree. It also makes it less likely
> > that people will try out the new system and find the issues with it, and
> > help fill in the gaps. While I can understand us not recommending the
> > new build system until it reaches feature parity, I think there are a
> > lot of benefits to be got by making it widely available, even if it's
> > incomplete. 
> 
> Yes, sorry, the implied "what" here is gating its introduction to mainline.  I
> have no problem with this going into a development or staging branch/tree, only
> with it getting merged to mainline and becoming the primary build system today.
> I get that it makes reaching feature parity harder, but to not do so relegates
> anyone that hasn't had a chance to test the new build system to second class
> citizen status (or at least potentially does so).  To be a bit more specific, I
> can see how energized you might be to get this in place now because you've
> tested it on a wide array on intel hardware, but I'm guessing if it went in
> today, people at IBM and Linaro would have to drop active developement to start
> switching their build environments over to the new system lest they get left out
> in the cold.  I think its more about balacing where the hardship lies here.
> 
> As I'm writing this, I wonder if a reasonable compromise couldn't involve the
> use of CI?  That is to say, what if we integrated the build system now-ish, and
> stood up an official CI instance, that both:
> 1) built the dpdk in all style configuration, which mandated the use of the old
> build system (i.e. we implicitly mandate that the current build system stay
> working, and is not forgotten), and gate patch merges on that result.
> 
> 2) add a test that any change to a meson file in mainline also include a change
> to the a Makefile
> 
> I'm just spitballing here, but I'm looking for ways to enforce the continued use
> of the current build system above and beyond a verbal promise to do so.  The
> idea is to ensure that it stays operational and primary to the development of
> dpdk until build system parity is reached.
> 

Yes, that all makes sense, and I agree that the main issue is how to
ensure/enforce the fact that the old build system stays as the main way
to build DPDK, until such time as the new system reaches parity. A CI
system like you describe would be the ideal case, and we have some parts
of that, just not enough I think to satify our needs. On the other hand,
while holding the new system in a staging tree till it reaches parity
would definitely achieve that objective I think the cost of that is too
high.

Right now patchwork reports results of "Intel-compilation". I'm not
aware of any immediate plans to expand that - somebody please should if
there are. There is also the planned DPDK lab, but I'm not sure of the
schedule for that or if it will help in this instance.

For now, I'll prepare a slightly-updated V2 patchset, with a view to
getting work started on the build-next tree. While that is going on, we
can maybe continue to think about how to put in suitable guard-rails for
ensuring old system compatibility for when it's pulled to mainline.

Thanks again for raising your concerns about this. It's easy for me to
sometimes push too hard for something I'm enthusiastic about! :-) I do
want this migration done properly, so if you have the bandwidth I'd
appreciate any reviews or feedback you can give, as the work goes on.

Regards,
/Bruce

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

* Re: [dpdk-dev, 01/17] build: add initial infrastructure for meson & ninja builds
  2017-09-08 13:55         ` Bruce Richardson
@ 2017-09-08 14:00           ` Bruce Richardson
  0 siblings, 0 replies; 107+ messages in thread
From: Bruce Richardson @ 2017-09-08 14:00 UTC (permalink / raw)
  To: Neil Horman, Thomas Monjalon, Xu Qian Q; +Cc: dev

+Thomas and Qian from our validation team, in case they have any insight
on build CI.

On Fri, Sep 08, 2017 at 02:55:08PM +0100, Bruce Richardson wrote:
> On Fri, Sep 08, 2017 at 07:57:06AM -0400, Neil Horman wrote:
> > On Fri, Sep 08, 2017 at 09:50:26AM +0100, Bruce Richardson wrote:
> > > On Thu, Sep 07, 2017 at 12:21:57PM -0400, Neil Horman wrote:
> > > > On Fri, Sep 01, 2017 at 11:04:00AM +0100, Bruce Richardson wrote:
> > > > > To build with meson and ninja, we need some initial infrastructure in
> > > > > place. The build files for meson always need to be called "meson.build",
> > > > > and options get placed in meson_options.txt
> > > > > 
> > > > > This commit adds a top-level meson.build file, which sets up the global
> > > > > variables for tracking drivers, libraries, etc., and then includes other
> > > > > build files, before finishing by writing the global build configuration
> > > > > header file and a DPDK pkgconfig file at the end, using some of those same
> > > > > globals.
> > > > > 
> > > > > >From the top level build file, the only include file thus far is for the
> > > > > config folder, which does some other setup of global configuration
> > > > > parameters, including pulling in architecture specific parameters from an
> > > > > architectural subdirectory. A number of configuration build options are
> > > > > provided for the project to tune a number of global variables which will be
> > > > > used later e.g. max numa nodes, max cores, etc. These settings all make
> > > > > their way to the global build config header "rte_build_config.h". There is
> > > > > also a file "rte_config.h", which includes "rte_build_config.h", and this
> > > > > file is meant to hold other build-time values which are present in our
> > > > > current static build configuration but are not normally meant for
> > > > > user-configuration. Ideally, over time, the values placed here should be
> > > > > moved to the individual libraries or drivers which want those values.
> > > > > 
> > > > > Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> > > > > Reviewed-by: Harry van Haaren <harry.van.haaren@intel.com>
> > > > 
> > > > I feel like I need to underscore my previous concern here.  While I'm not
> > > > opposed per-se to a new build system, I am very concerned about the burden that
> > > > switching places on downstream consumers, in particular distributions (since I
> > > > represent one of them).  Moving to a new build system with new tools means those
> > > > tools need to be packaged, tested and shipped, which is a significant work
> > > > effort.  While it might be a net gain long term, its something you need to keep
> > > > in mind when making these changes.
> > > > 
> > > Understood. If there is anything we/I can do to make this transition
> > > easier, please flag it for consideration.
> > > 
> > Thank you, I appreciate that.
> > 
> > > > I know you've said that we will be keepting the existing build system,
> > > > I just need to be sure everyone understands just how important that
> > > > is.
> > > > 
> > > What is your feeling here, in terms of timescale. After any new system
> > > reaches feature parity, how long would you estimate that we would need
> > > to support the existing makefile system before it would be safe to
> > > deprecate it? Should we start a deprecation plan, or is it best just to
> > > commit to support both until we get all - or almost all - downstream
> > > consumers switched over? While I wouldn't push for deprecating the old
> > > system any time soon, and I wouldn't consider maintaining the two
> > > unduly burdensome, it's not something we want to do in the long term.
> > > 
> > I was hoping to avoid putting a specific time frame on it, but its a fair
> > question to ask.  I feel like any particular timetable is somewhat arbitrary.
> > Keith suggested a year, which is likely as good as any in my mind.  To put a bit
> > more detail behind it, a RHEL release cycle is anywhere from 6 to 18 months, so
> > a year fits well.  If we assume starting a few weeks back when you first
> > proposed this change, that its going to be merged, that gives us time to package
> > the build components, build the new package using them, get it through a qa
> > cycle and fix anything that pops up as a result.  That way, when the switch is
> > made, it can be done with an immediate deprecation of the old build system with
> > a level of confidence that some of the more esoteric build targets/configs will
> > likely work.
> > 
> > > > Though perhaps the time frame for keeping the current build system as priarmy is
> > > > less concerning, as feature parity is even more critical.  That is to say, the
> > > > new build system must be able to produce the same configurations that the
> > > > current build system does.  Without it I don't think anyone will be able to use
> > > > it consistently, and that will leave a great number of users in a very poor
> > > > position.  I think getting a little closer to parity with the current system is
> > > > warranted.  I'd suggest as a gating factor:
> > > > 
> > > > 1) Building on all supported arches
> > > > 2) Cross building on all supported arches
> > > > 3) Proper identification of targeted machine (i.e. equivalent of the machine
> > > > component of the current build system)
> > > > 
> > > The question there is gating factor for what? Presumably not for merging
> > > into the staging tree. But for merging into the main tree for releases?
> > > I'd push back a little on that, as the new system does not interfere in
> > > any way with the old, and by keeping it in a staging tree until it
> > > reaches full feature parity will make the job considerably harder. For
> > > example, it means that anyone submitting a new driver or library has to
> > > submit the code and makefiles in one set and the meson patches in a
> > > separate one for a separate build tree. It also makes it less likely
> > > that people will try out the new system and find the issues with it, and
> > > help fill in the gaps. While I can understand us not recommending the
> > > new build system until it reaches feature parity, I think there are a
> > > lot of benefits to be got by making it widely available, even if it's
> > > incomplete. 
> > 
> > Yes, sorry, the implied "what" here is gating its introduction to mainline.  I
> > have no problem with this going into a development or staging branch/tree, only
> > with it getting merged to mainline and becoming the primary build system today.
> > I get that it makes reaching feature parity harder, but to not do so relegates
> > anyone that hasn't had a chance to test the new build system to second class
> > citizen status (or at least potentially does so).  To be a bit more specific, I
> > can see how energized you might be to get this in place now because you've
> > tested it on a wide array on intel hardware, but I'm guessing if it went in
> > today, people at IBM and Linaro would have to drop active developement to start
> > switching their build environments over to the new system lest they get left out
> > in the cold.  I think its more about balacing where the hardship lies here.
> > 
> > As I'm writing this, I wonder if a reasonable compromise couldn't involve the
> > use of CI?  That is to say, what if we integrated the build system now-ish, and
> > stood up an official CI instance, that both:
> > 1) built the dpdk in all style configuration, which mandated the use of the old
> > build system (i.e. we implicitly mandate that the current build system stay
> > working, and is not forgotten), and gate patch merges on that result.
> > 
> > 2) add a test that any change to a meson file in mainline also include a change
> > to the a Makefile
> > 
> > I'm just spitballing here, but I'm looking for ways to enforce the continued use
> > of the current build system above and beyond a verbal promise to do so.  The
> > idea is to ensure that it stays operational and primary to the development of
> > dpdk until build system parity is reached.
> > 
> 
> Yes, that all makes sense, and I agree that the main issue is how to
> ensure/enforce the fact that the old build system stays as the main way
> to build DPDK, until such time as the new system reaches parity. A CI
> system like you describe would be the ideal case, and we have some parts
> of that, just not enough I think to satify our needs. On the other hand,
> while holding the new system in a staging tree till it reaches parity
> would definitely achieve that objective I think the cost of that is too
> high.
> 
> Right now patchwork reports results of "Intel-compilation". I'm not
> aware of any immediate plans to expand that - somebody please should if
> there are. There is also the planned DPDK lab, but I'm not sure of the
> schedule for that or if it will help in this instance.
> 
> For now, I'll prepare a slightly-updated V2 patchset, with a view to
> getting work started on the build-next tree. While that is going on, we
> can maybe continue to think about how to put in suitable guard-rails for
> ensuring old system compatibility for when it's pulled to mainline.
> 
> Thanks again for raising your concerns about this. It's easy for me to
> sometimes push too hard for something I'm enthusiastic about! :-) I do
> want this migration done properly, so if you have the bandwidth I'd
> appreciate any reviews or feedback you can give, as the work goes on.
> 
> Regards,
> /Bruce
> 

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

* Re: [PATCH 01/17] build: add initial infrastructure for meson & ninja builds
  2017-09-01 10:04 ` [PATCH 01/17] build: add initial infrastructure for meson & ninja builds Bruce Richardson
  2017-09-04 13:36   ` Van Haaren, Harry
  2017-09-07 16:21   ` [dpdk-dev, " Neil Horman
@ 2017-09-08 16:03   ` Van Haaren, Harry
  2017-09-08 16:13     ` Richardson, Bruce
  2 siblings, 1 reply; 107+ messages in thread
From: Van Haaren, Harry @ 2017-09-08 16:03 UTC (permalink / raw)
  To: Richardson, Bruce, dev; +Cc: Richardson, Bruce

> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Bruce Richardson
> Sent: Friday, September 1, 2017 11:04 AM
> To: dev@dpdk.org
> Cc: Richardson, Bruce <bruce.richardson@intel.com>
> Subject: [dpdk-dev] [PATCH 01/17] build: add initial infrastructure for meson &
> ninja builds

<snip commit message etc>

> diff --git a/config/meson.build b/config/meson.build
<snip>
> +# 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')
> +# 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')
> +
> +# disable any unwanted warnings
> +unwanted_warnings = [
> +	'-Wno-address-of-packed-member',
> +	'-Wno-format-truncation'
> +]


Feedback from usage while developing new features;
- Mis-matched integer sign comparison doesn't cause a warning
- And -Werror isn't set by default

Adding these as per below fixes things... but for cleanliness "unwanted warnings" should probably be renamed, we want more warnings! :D

# disable any unwanted warnings
unwanted_warnings = [
	'-Werror',
	'-Wno-address-of-packed-member',
	'-Wno-format-truncation',
	'-Wsign-compare',
]

The performance of Ninja is amazing for testing shared-object builds and version.map changes - feedback is instant. Makes light work of re-checking ABI/API stuff.

> +foreach arg: unwanted_warnings
> +	if cc.has_argument(arg)
> +		add_project_arguments(arg, language: 'c')
> +	endif
> +endforeach
> +

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

* Re: [PATCH 01/17] build: add initial infrastructure for meson & ninja builds
  2017-09-08 16:03   ` [PATCH " Van Haaren, Harry
@ 2017-09-08 16:13     ` Richardson, Bruce
  2017-09-12  9:56       ` Bruce Richardson
  0 siblings, 1 reply; 107+ messages in thread
From: Richardson, Bruce @ 2017-09-08 16:13 UTC (permalink / raw)
  To: Van Haaren, Harry, dev



> -----Original Message-----
> From: Van Haaren, Harry
> Sent: Friday, September 8, 2017 5:03 PM
> To: Richardson, Bruce <bruce.richardson@intel.com>; dev@dpdk.org
> Cc: Richardson, Bruce <bruce.richardson@intel.com>
> Subject: RE: [dpdk-dev] [PATCH 01/17] build: add initial infrastructure
> for meson & ninja builds
> 
> > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Bruce Richardson
> > Sent: Friday, September 1, 2017 11:04 AM
> > To: dev@dpdk.org
> > Cc: Richardson, Bruce <bruce.richardson@intel.com>
> > Subject: [dpdk-dev] [PATCH 01/17] build: add initial infrastructure
> > for meson & ninja builds
> 
> <snip commit message etc>
> 
> > diff --git a/config/meson.build b/config/meson.build
> <snip>
> > +# 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') #
> > +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')
> > +
> > +# disable any unwanted warnings
> > +unwanted_warnings = [
> > +	'-Wno-address-of-packed-member',
> > +	'-Wno-format-truncation'
> > +]
> 
> 
> Feedback from usage while developing new features;
> - Mis-matched integer sign comparison doesn't cause a warning
> - And -Werror isn't set by default
> 
Will fix the former in V2.
For the latter, I already have a patch for it that approximates the behavior of the existing system - i.e. a "developer build" setting, which is "off" by default, except when you are building from a git checkout in which case it defaults to "on". However, I don't think I'll include that in V2, as having Werror when we are not reasonably sure we have fixed all warnings in the code for all supported compilers and distros is a bad idea IMHO.

> Adding these as per below fixes things... but for cleanliness "unwanted
> warnings" should probably be renamed, we want more warnings! :D
> 
> # disable any unwanted warnings
> unwanted_warnings = [
> 	'-Werror',
> 	'-Wno-address-of-packed-member',
> 	'-Wno-format-truncation',
> 	'-Wsign-compare',
> ]
> 
Actually, I'd rather keep it as a list of warnings to disable for now. Enabling warnings should be handled differently, as we may only enable specific warnings depending on the build type being done.

/Bruce

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

* Re: [PATCH 01/17] build: add initial infrastructure for meson & ninja builds
  2017-09-08 16:13     ` Richardson, Bruce
@ 2017-09-12  9:56       ` Bruce Richardson
  0 siblings, 0 replies; 107+ messages in thread
From: Bruce Richardson @ 2017-09-12  9:56 UTC (permalink / raw)
  To: Van Haaren, Harry, dev

On Fri, Sep 08, 2017 at 04:13:58PM +0000, Richardson, Bruce wrote:
> 
> 
> > -----Original Message-----
> > From: Van Haaren, Harry
> > Sent: Friday, September 8, 2017 5:03 PM
> > To: Richardson, Bruce <bruce.richardson@intel.com>; dev@dpdk.org
> > Cc: Richardson, Bruce <bruce.richardson@intel.com>
> > Subject: RE: [dpdk-dev] [PATCH 01/17] build: add initial infrastructure
> > for meson & ninja builds
> > 
> > > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Bruce Richardson
> > > Sent: Friday, September 1, 2017 11:04 AM
> > > To: dev@dpdk.org
> > > Cc: Richardson, Bruce <bruce.richardson@intel.com>
> > > Subject: [dpdk-dev] [PATCH 01/17] build: add initial infrastructure
> > > for meson & ninja builds
> > 
> > <snip commit message etc>
> > 
> > > diff --git a/config/meson.build b/config/meson.build
> > <snip>
> > > +# 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') #
> > > +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')
> > > +
> > > +# disable any unwanted warnings
> > > +unwanted_warnings = [
> > > +	'-Wno-address-of-packed-member',
> > > +	'-Wno-format-truncation'
> > > +]
> > 
> > 
> > Feedback from usage while developing new features;
> > - Mis-matched integer sign comparison doesn't cause a warning
> > - And -Werror isn't set by default
> > 
> Will fix the former in V2.
> For the latter, I already have a patch for it that approximates the behavior of the existing system - i.e. a "developer build" setting, which is "off" by default, except when you are building from a git checkout in which case it defaults to "on". However, I don't think I'll include that in V2, as having Werror when we are not reasonably sure we have fixed all warnings in the code for all supported compilers and distros is a bad idea IMHO.
> 
> > Adding these as per below fixes things... but for cleanliness "unwanted
> > warnings" should probably be renamed, we want more warnings! :D
> > 
> > # disable any unwanted warnings
> > unwanted_warnings = [
> > 	'-Werror',
> > 	'-Wno-address-of-packed-member',
> > 	'-Wno-format-truncation',
> > 	'-Wsign-compare',
> > ]
> > 
> Actually, I'd rather keep it as a list of warnings to disable for now. Enabling warnings should be handled differently, as we may only enable specific warnings depending on the build type being done.
> 
On second-thoughts, for V2 I will do as you suggest and add in the extra
warnings '-Wsign-compare' and '-Wcast-qual', to the existing warnings
list. It simplifies the code and we can just split them out later if we
want them only for certain build targets. For now, I don't think that is
needed, so I'll keep it simple.

/Bruce

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

* [PATCH v2 00/17] build DPDK libs and some drivers with meson/ninja
  2017-09-01 10:03 [PATCH 00/17] build DPDK libs and some drivers with meson/ninja Bruce Richardson
                   ` (17 preceding siblings ...)
  2017-09-01 10:38 ` [PATCH 00/17] build DPDK libs and some drivers with meson/ninja Bruce Richardson
@ 2017-09-12 10:37 ` Bruce Richardson
  2017-09-12 10:37   ` [PATCH v2 01/17] build: add initial infrastructure for meson & ninja builds Bruce Richardson
                     ` (18 more replies)
  18 siblings, 19 replies; 107+ messages in thread
From: Bruce Richardson @ 2017-09-12 10:37 UTC (permalink / raw)
  To: dev; +Cc: nhorman, luca.boccassi, harry.van.haaren, Bruce Richardson

V2 changes:
* fixed copyright notices, updated 2016 to 2017
* removed dependency on kconfig file in kernel build tree
* marked pmdinfogen as a "native" binary, in preparation for future cross-
  compilation work
* added in additional warning flags for compatibility with existing system
-----

Following on from the two previous RFCs [1] [2], here is a cleaned up
patchset to serve as a start-point for getting all of DPDK building with
meson and ninja.

What's covered:
* Basic infrastructure for feature detection and DPDK compilation
* Building of all DPDK libraries - as either static or shared
* Compilation of igb_uio driver for Linux
* Building a number of mempool, crypto and net drivers.
* Installation of compiled libraries and headers
* Installation of usertools scripts
* Compilation of testpmd as dpdk-testpmd and install of same
* Generation and installation of pkgconfig file for DPDK
* Contributors guide document addition describing how to add build scripts

What's not implemented:
* Just about everything else :-), including
* Support for non-x86 architectures, including cross-compilation
* Lots of PMDs
* Support for building and running the unit tests

Some key differences from RFC2:
* Removed duplication between the different driver meson files by moving
  the build logic up one level to the driver/meson.build file.
* Added a build option to allow versioning the libraries using the DPDK
  version number, rather than individual .so versions.
* Made EAL a default dependency for libs, to simplify meson.build files for
  a number of them.
* Made the build variables used for libraries and drivers more consistent.
* Moved responsibility for determining if a given driver or library should
  be built to the driver/library's own build file, giving a single place
  where all details about that component are placed, and saving having lots
  of environment detection logic in higher-level build files.
* Begun adding in developer documentation to make it easier for driver
  authors/maintainers to contribute.

Meson 0.41 and ninja are needed, and ideally meson 0.42 is recommended.
Ninja is available in most distributions, and meson - if an updated version
is not available on your distro of choice - can be easily got using 
	"pip3 install meson"

To build and install then use:

	meson build # use default compiler and shared libs
	cd build
	ninja
	sudo ninja install

Thereafter to use DPDK in other build systems one can use:

	pkg-config --cflags DPDK
	pkt-config --libs DPDK

to query the needed DPDK build parameters.

Once reviewed and tested a bit, I hope to apply this set - or a new
revision of it - to the build-next tree, to serve as a baseline for others
to use and to add the missing functionality to.

Regards,
/Bruce

[1] http://dpdk.org/ml/archives/dev/2017-June/067429.html
[2] http://dpdk.org/ml/archives/dev/2017-August/072818.html

Bruce Richardson (17):
  build: add initial infrastructure for meson & ninja builds
  eal: add eal library to meson build
  igb_uio: add igb_uio kmod to meson build
  build: add DPDK libraries to build
  build: add buildtools to meson build
  build: add infrastructure for building PMDs
  drivers/mempool: add SW mempool drivers to meson build
  drivers/crypto: add crypto drv class and null PMD to meson
  crypto/openssl: add driver to meson build
  crypto/qat: add driver to meson build
  drivers/net: add net driver support to meson build
  drivers/net: add set of vdev PMDs to build
  drivers/net: add drivers for Intel NICs to meson build
  app/test-pmd: add test-pmd to meson build
  usertools: add usertools installation to meson build
  build: add option to version libs using DPDK version
  doc: add documentation on how to add new components to DPDK

 app/meson.build                                    |  32 +++
 app/test-pmd/meson.build                           |  74 +++++++
 buildtools/gen-pmdinfo-cfile.sh                    |  41 ++++
 buildtools/meson.build                             |  34 ++++
 buildtools/pmdinfogen/meson.build                  |  36 ++++
 config/meson.build                                 |  71 +++++++
 config/rte_config.h                                | 121 ++++++++++++
 config/x86/meson.build                             |  70 +++++++
 doc/guides/contributing/coding_style.rst           | 214 +++++++++++++++++++++
 drivers/crypto/meson.build                         |  35 ++++
 drivers/crypto/null/meson.build                    |  33 ++++
 drivers/crypto/openssl/meson.build                 |  38 ++++
 drivers/crypto/qat/meson.build                     |  41 ++++
 drivers/mempool/meson.build                        |  35 ++++
 drivers/mempool/ring/meson.build                   |  32 +++
 drivers/mempool/stack/meson.build                  |  32 +++
 drivers/meson.build                                | 128 ++++++++++++
 drivers/net/af_packet/meson.build                  |  35 ++++
 drivers/net/e1000/base/meson.build                 |  65 +++++++
 drivers/net/e1000/meson.build                      |  44 +++++
 drivers/net/fm10k/base/meson.build                 |  55 ++++++
 drivers/net/fm10k/meson.build                      |  44 +++++
 drivers/net/i40e/base/meson.build                  |  56 ++++++
 drivers/net/i40e/meson.build                       |  60 ++++++
 drivers/net/ixgbe/base/meson.build                 |  60 ++++++
 drivers/net/ixgbe/meson.build                      |  58 ++++++
 drivers/net/meson.build                            |  36 ++++
 drivers/net/null/meson.build                       |  32 +++
 drivers/net/pcap/meson.build                       |  41 ++++
 drivers/net/ring/meson.build                       |  33 ++++
 lib/librte_acl/meson.build                         |  59 ++++++
 lib/librte_bitratestats/meson.build                |  34 ++++
 lib/librte_cfgfile/meson.build                     |  34 ++++
 lib/librte_cmdline/meson.build                     |  55 ++++++
 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        |  46 +++++
 lib/librte_eal/linuxapp/meson.build                |  42 ++++
 lib/librte_eal/meson.build                         |  44 +++++
 lib/librte_efd/meson.build                         |  34 ++++
 lib/librte_ether/meson.build                       |  45 +++++
 lib/librte_eventdev/meson.build                    |  36 ++++
 lib/librte_gro/meson.build                         |  34 ++++
 lib/librte_hash/meson.build                        |  45 +++++
 lib/librte_ip_frag/meson.build                     |  39 ++++
 lib/librte_jobstats/meson.build                    |  33 ++++
 lib/librte_kni/meson.build                         |  38 ++++
 lib/librte_kvargs/meson.build                      |  34 ++++
 lib/librte_latencystats/meson.build                |  34 ++++
 lib/librte_lpm/meson.build                         |  35 ++++
 lib/librte_mbuf/meson.build                        |  35 ++++
 lib/librte_mempool/meson.build                     |  35 ++++
 lib/librte_meter/meson.build                       |  33 ++++
 lib/librte_metrics/meson.build                     |  33 ++++
 lib/librte_net/meson.build                         |  45 +++++
 lib/librte_pdump/meson.build                       |  34 ++++
 lib/librte_pipeline/meson.build                    |  35 ++++
 lib/librte_port/meson.build                        |  58 ++++++
 lib/librte_power/meson.build                       |  37 ++++
 lib/librte_reorder/meson.build                     |  34 ++++
 lib/librte_ring/meson.build                        |  33 ++++
 lib/librte_sched/meson.build                       |  36 ++++
 lib/librte_table/meson.build                       |  52 +++++
 lib/librte_timer/meson.build                       |  33 ++++
 lib/librte_vhost/meson.build                       |  39 ++++
 lib/meson.build                                    | 105 ++++++++++
 meson.build                                        |  88 +++++++++
 meson_options.txt                                  |   9 +
 usertools/meson.build                              |  32 +++
 80 files changed, 3788 insertions(+)
 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
 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/e1000/base/meson.build
 create mode 100644 drivers/net/e1000/meson.build
 create mode 100644 drivers/net/fm10k/base/meson.build
 create mode 100644 drivers/net/fm10k/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/null/meson.build
 create mode 100644 drivers/net/pcap/meson.build
 create mode 100644 drivers/net/ring/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
 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

-- 
2.13.5

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

* [PATCH v2 01/17] build: add initial infrastructure for meson & ninja builds
  2017-09-12 10:37 ` [PATCH v2 " Bruce Richardson
@ 2017-09-12 10:37   ` Bruce Richardson
  2017-09-12 10:37   ` [PATCH v2 02/17] eal: add eal library to meson build Bruce Richardson
                     ` (17 subsequent siblings)
  18 siblings, 0 replies; 107+ messages in thread
From: Bruce Richardson @ 2017-09-12 10:37 UTC (permalink / raw)
  To: dev; +Cc: nhorman, luca.boccassi, harry.van.haaren, Bruce Richardson

To build with meson and ninja, we need some initial infrastructure in
place. The build files for meson always need to be called "meson.build",
and options get placed in meson_options.txt

This commit adds a top-level meson.build file, which sets up the global
variables for tracking drivers, libraries, etc., and then includes other
build files, before finishing by writing the global build configuration
header file and a DPDK pkgconfig file at the end, using some of those same
globals.

>From the top level build file, the only include file thus far is for the
config folder, which does some other setup of global configuration
parameters, including pulling in architecture specific parameters from an
architectural subdirectory. A number of configuration build options are
provided for the project to tune a number of global variables which will be
used later e.g. max numa nodes, max cores, etc. These settings all make
their way to the global build config header "rte_build_config.h". There is
also a file "rte_config.h", which includes "rte_build_config.h", and this
file is meant to hold other build-time values which are present in our
current static build configuration but are not normally meant for
user-configuration. Ideally, over time, the values placed here should be
moved to the individual libraries or drivers which want those values.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Harry van Haaren <harry.van.haaren@intel.com>
---
 config/meson.build     | 71 ++++++++++++++++++++++++++++++++++++++++++
 config/rte_config.h    | 50 ++++++++++++++++++++++++++++++
 config/x86/meson.build | 70 ++++++++++++++++++++++++++++++++++++++++++
 meson.build            | 83 ++++++++++++++++++++++++++++++++++++++++++++++++++
 meson_options.txt      |  6 ++++
 5 files changed, 280 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

diff --git a/config/meson.build b/config/meson.build
new file mode 100644
index 000000000..27d7125cf
--- /dev/null
+++ b/config/meson.build
@@ -0,0 +1,71 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation.
+#   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')
+# 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')
+
+# enable extra warnings and disable any unwanted warnings
+warning_flags = [
+	'-Wsign-compare',
+	'-Wcast-qual',
+	'-Wno-address-of-packed-member',
+	'-Wno-format-truncation'
+]
+foreach arg: warning_flags
+	if cc.has_argument(arg)
+		add_project_arguments(arg, language: 'c')
+	endif
+endforeach
+
+compile_time_cpuflags = []
+if host_machine.cpu_family().startswith('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')
diff --git a/config/rte_config.h b/config/rte_config.h
new file mode 100644
index 000000000..813c3a67d
--- /dev/null
+++ b/config/rte_config.h
@@ -0,0 +1,50 @@
+/*
+ *   BSD LICENSE
+ *
+ *   Copyright(c) 2017 Intel Corporation.
+ *   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.
+ */
+
+/**
+ * @file Header file containing DPDK compilation parameters
+ *
+ * Header file containing DPDK compilation parameters. Also include the
+ * meson-generated header file containing the detected parameters that
+ * are variable across builds or build environments.
+ *
+ * NOTE: This file is only used for meson+ninja builds. For builds done
+ * using make/gmake, the rte_config.h file is autogenerated from the
+ * defconfig_* files in the config directory.
+ */
+#ifndef _RTE_CONFIG_H_
+#define _RTE_CONFIG_H_
+
+#include <rte_build_config.h>
+
+#endif /* _RTE_CONFIG_H_ */
diff --git a/config/x86/meson.build b/config/x86/meson.build
new file mode 100644
index 000000000..0d1a532ad
--- /dev/null
+++ b/config/x86/meson.build
@@ -0,0 +1,70 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation.
+#   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.
+
+# for checking defines we need to use the correct compiler flags
+march_opt = '-march=@0@'.format(machine)
+
+# we require SSE4.2 for DPDK
+sse_errormsg = '''SSE4.2 instruction set is required for DPDK.
+Please set the machine type to "nehalem" or "corei7" or higher value'''
+
+if cc.get_define('__SSE4_2__', args: march_opt) == ''
+	error(sse_errormsg)
+endif
+
+dpdk_conf.set('RTE_ARCH_X86', 1)
+if (host_machine.cpu_family() == 'x86_64')
+	dpdk_conf.set('RTE_ARCH_X86_64', 1)
+	dpdk_conf.set('RTE_ARCH', 'x86_64')
+	dpdk_conf.set('RTE_ARCH_64', 1)
+else
+	dpdk_conf.set('RTE_ARCH_I686', 1)
+	dpdk_conf.set('RTE_ARCH', 'i686')
+endif
+
+if cc.get_define('__AES__', args: march_opt) != ''
+	dpdk_conf.set('RTE_MACHINE_CPUFLAG_AES', 1)
+	compile_time_cpuflags += ['RTE_CPUFLAG_AES']
+endif
+if cc.get_define('__PCLMUL__', args: march_opt) != ''
+	dpdk_conf.set('RTE_MACHINE_CPUFLAG_PCLMULQDQ', 1)
+	compile_time_cpuflags += ['RTE_CPUFLAG_PCLMULQDQ']
+endif
+if cc.get_define('__AVX__', args: march_opt) != ''
+	dpdk_conf.set('RTE_MACHINE_CPUFLAG_AVX', 1)
+	compile_time_cpuflags += ['RTE_CPUFLAG_AVX']
+endif
+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)
diff --git a/meson.build b/meson.build
new file mode 100644
index 000000000..8588e0e39
--- /dev/null
+++ b/meson.build
@@ -0,0 +1,83 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation.
+#   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.
+
+project('DPDK', 'C',
+	version: '17.08.0',
+	license: 'BSD',
+	default_options: ['buildtype=release'],
+	meson_version: '>= 0.41'
+)
+
+# set up some global vars for compiler, platform, configuration, etc.
+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
+if get_option('default_library') == 'static'
+	driver_install_path = get_option('libdir')
+else
+	driver_install_path = '@0@/dpdk/drivers'.format(get_option('prefix'))
+endif
+
+# configure the build, and make sure configs here and in config folder are
+# 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')
+subdir('config')
+
+# TODO build libs and drivers
+
+# TODO build binaries and installable tools
+
+# write the build config
+build_cfg = 'rte_build_config.h'
+configure_file(output: build_cfg,
+		configuration: dpdk_conf,
+		install_dir: get_option('includedir'))
+
+# 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_drivers = ['-Wl,--whole-archive'] + dpdk_drivers + ['-Wl,--no-whole-archive']
+	dpdk_libraries = dpdk_drivers + dpdk_libraries + dpdk_extra_ldflags
+endif
+
+pkg = import('pkgconfig')
+pkg.generate(name: meson.project_name(),
+	version: meson.project_version(),
+	libraries: dpdk_libraries,
+	description: 'The Data Plane Development Kit (DPDK)',
+	extra_cflags: '-include "rte_config.h"'
+)
diff --git a/meson_options.txt b/meson_options.txt
new file mode 100644
index 000000000..c03b79fbd
--- /dev/null
+++ b/meson_options.txt
@@ -0,0 +1,6 @@
+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')
-- 
2.13.5

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

* [PATCH v2 02/17] eal: add eal library to meson build
  2017-09-12 10:37 ` [PATCH v2 " Bruce Richardson
  2017-09-12 10:37   ` [PATCH v2 01/17] build: add initial infrastructure for meson & ninja builds Bruce Richardson
@ 2017-09-12 10:37   ` Bruce Richardson
  2017-09-12 10:37   ` [PATCH v2 03/17] igb_uio: add igb_uio kmod " Bruce Richardson
                     ` (16 subsequent siblings)
  18 siblings, 0 replies; 107+ messages in thread
From: Bruce Richardson @ 2017-09-12 10:37 UTC (permalink / raw)
  To: dev; +Cc: nhorman, luca.boccassi, harry.van.haaren, Bruce Richardson

Support building the EAL with meson and ninja. This involves a number of
different meson.build files for iterating through all the different
subdirectories in the EAL. The library itself will be compiled on build but
the header files are only copied from their initial location once "ninja
install" is run. Instead, we use meson dependency tracking to ensure that
other libraries which use the EAL headers can find them in their original
locations.

Note: this does not include building kernel modules on either BSD or Linux

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Harry van Haaren <harry.van.haaren@intel.com>
---
 config/rte_config.h                                | 11 ++++
 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/meson.build                | 32 ++++++++++
 lib/librte_eal/meson.build                         | 44 +++++++++++++
 lib/meson.build                                    | 32 ++++++++++
 meson.build                                        |  3 +-
 14 files changed, 580 insertions(+), 1 deletion(-)
 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/meson.build
 create mode 100644 lib/librte_eal/meson.build
 create mode 100644 lib/meson.build

diff --git a/config/rte_config.h b/config/rte_config.h
index 813c3a67d..c94704cfe 100644
--- a/config/rte_config.h
+++ b/config/rte_config.h
@@ -47,4 +47,15 @@
 
 #include <rte_build_config.h>
 
+/****** library defines ********/
+
+/* 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_ */
diff --git a/lib/librte_eal/bsdapp/eal/meson.build b/lib/librte_eal/bsdapp/eal/meson.build
new file mode 100644
index 000000000..00973122a
--- /dev/null
+++ b/lib/librte_eal/bsdapp/eal/meson.build
@@ -0,0 +1,67 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation.
+#   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')
+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_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'),
+			include_directories : eal_inc,
+			version: '@0@.1'.format(version),
+			c_args: '-D_GNU_SOURCE',
+			link_depends: version_map,
+			link_args: [eal_extra_link_arg,
+				'-Wl,--version-script=' + version_map],
+			install: true
+)
+
+dpdk_libraries += eal_lib
+dpdk_extra_ldflags += ['-pthread', eal_extra_link_arg]
+
+rte_eal = declare_dependency(link_with: eal_lib,
+		include_directories: eal_inc,
+		dependencies: dependency('threads'))
+set_variable('dep_rte_eal', rte_eal)
diff --git a/lib/librte_eal/bsdapp/meson.build b/lib/librte_eal/bsdapp/meson.build
new file mode 100644
index 000000000..bda974a9a
--- /dev/null
+++ b/lib/librte_eal/bsdapp/meson.build
@@ -0,0 +1,32 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation.
+#   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')
diff --git a/lib/librte_eal/common/arch/meson.build b/lib/librte_eal/common/arch/meson.build
new file mode 100644
index 000000000..9e2539fde
--- /dev/null
+++ b/lib/librte_eal/common/arch/meson.build
@@ -0,0 +1,33 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation.
+#   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)
diff --git a/lib/librte_eal/common/arch/x86/meson.build b/lib/librte_eal/common/arch/x86/meson.build
new file mode 100644
index 000000000..c007e57c9
--- /dev/null
+++ b/lib/librte_eal/common/arch/x86/meson.build
@@ -0,0 +1,32 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation.
+#   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')
diff --git a/lib/librte_eal/common/include/arch/meson.build b/lib/librte_eal/common/include/arch/meson.build
new file mode 100644
index 000000000..9e2539fde
--- /dev/null
+++ b/lib/librte_eal/common/include/arch/meson.build
@@ -0,0 +1,33 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation.
+#   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)
diff --git a/lib/librte_eal/common/include/arch/x86/meson.build b/lib/librte_eal/common/include/arch/x86/meson.build
new file mode 100644
index 000000000..80b5980c1
--- /dev/null
+++ b/lib/librte_eal/common/include/arch/x86/meson.build
@@ -0,0 +1,48 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation.
+#   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_atomic_32.h',
+	'rte_atomic_64.h',
+	'rte_atomic.h',
+	'rte_byteorder_32.h',
+	'rte_byteorder_64.h',
+	'rte_byteorder.h',
+	'rte_cpuflags.h',
+	'rte_cycles.h',
+	'rte_io.h',
+	'rte_memcpy.h',
+	'rte_prefetch.h',
+	'rte_pause.h',
+	'rte_rtm.h',
+	'rte_rwlock.h',
+	'rte_spinlock.h',
+	'rte_vect.h')
diff --git a/lib/librte_eal/common/include/meson.build b/lib/librte_eal/common/include/meson.build
new file mode 100644
index 000000000..d106d1a46
--- /dev/null
+++ b/lib/librte_eal/common/include/meson.build
@@ -0,0 +1,71 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation.
+#   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('.')
+
+common_headers = [
+	'rte_alarm.h',
+	'rte_branch_prediction.h',
+	'rte_bus.h',
+	'rte_common.h',
+	'rte_debug.h',
+	'rte_devargs.h',
+	'rte_dev.h',
+	'rte_eal.h',
+	'rte_eal_memconfig.h',
+	'rte_errno.h',
+	'rte_hexdump.h',
+	'rte_interrupts.h',
+	'rte_keepalive.h',
+	'rte_launch.h',
+	'rte_lcore.h',
+	'rte_log.h',
+	'rte_malloc.h',
+	'rte_malloc_heap.h',
+	'rte_memory.h',
+	'rte_memzone.h',
+	'rte_pci_dev_feature_defs.h',
+	'rte_pci_dev_features.h',
+	'rte_pci.h',
+	'rte_per_lcore.h',
+	'rte_random.h',
+	'rte_service.h',
+	'rte_service_component.h',
+	'rte_string_fns.h',
+	'rte_tailq.h',
+	'rte_time.h',
+	'rte_vdev.h',
+	'rte_version.h']
+
+install_headers(common_headers)
+install_subdir('generic', install_dir : 'include')
+
+subdir('arch')
diff --git a/lib/librte_eal/common/meson.build b/lib/librte_eal/common/meson.build
new file mode 100644
index 000000000..eeab002fe
--- /dev/null
+++ b/lib/librte_eal/common/meson.build
@@ -0,0 +1,71 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation.
+#   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('.')
+
+eal_common_sources = files(
+	'eal_common_bus.c',
+	'eal_common_cpuflags.c',
+	'eal_common_devargs.c',
+	'eal_common_dev.c',
+	'eal_common_errno.c',
+	'eal_common_hexdump.c',
+	'eal_common_launch.c',
+	'eal_common_lcore.c',
+	'eal_common_log.c',
+	'eal_common_memory.c',
+	'eal_common_memzone.c',
+	'eal_common_options.c',
+	'eal_common_pci.c',
+	'eal_common_pci_uio.c',
+	'eal_common_proc.c',
+	'eal_common_string_fns.c',
+	'eal_common_tailqs.c',
+	'eal_common_thread.c',
+	'eal_common_timer.c',
+	'eal_common_vdev.c',
+	'eal_filesystem.h',
+	'eal_hugepages.h',
+	'eal_internal_cfg.h',
+	'eal_options.h',
+	'eal_private.h',
+	'eal_thread.h',
+	'malloc_elem.c',
+	'malloc_elem.h',
+	'malloc_heap.c',
+	'malloc_heap.h',
+	'rte_keepalive.c',
+	'rte_malloc.c',
+	'rte_service.c'
+)
+
+subdir('arch')
+subdir('include')
diff --git a/lib/librte_eal/linuxapp/eal/meson.build b/lib/librte_eal/linuxapp/eal/meson.build
new file mode 100644
index 000000000..e7daed499
--- /dev/null
+++ b/lib/librte_eal/linuxapp/eal/meson.build
@@ -0,0 +1,72 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation.
+#   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')
+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_log.c',
+		'eal_pci_uio.c',
+		'eal_pci_vfio.c',
+		'eal_thread.c',
+		'eal_timer.c',
+		'eal_vfio.c',
+		'eal_vfio_mp_sync.c',
+		'eal.c',
+		'eal_memory.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'),
+			include_directories : eal_inc,
+			version: '@0@.1'.format(version),
+			c_args: '-D_GNU_SOURCE',
+			link_depends: version_map,
+			link_args: [eal_extra_link_arg,
+				'-Wl,--version-script=' + version_map],
+			install: true
+)
+
+dpdk_libraries += eal_lib
+dpdk_extra_ldflags += ['-pthread', eal_extra_link_arg]
+
+rte_eal = declare_dependency(link_with: eal_lib,
+		include_directories: eal_inc,
+		dependencies: dependency('threads'))
+set_variable('dep_rte_eal', rte_eal)
diff --git a/lib/librte_eal/linuxapp/meson.build b/lib/librte_eal/linuxapp/meson.build
new file mode 100644
index 000000000..bda974a9a
--- /dev/null
+++ b/lib/librte_eal/linuxapp/meson.build
@@ -0,0 +1,32 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation.
+#   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')
diff --git a/lib/librte_eal/meson.build b/lib/librte_eal/meson.build
new file mode 100644
index 000000000..2700fb04d
--- /dev/null
+++ b/lib/librte_eal/meson.build
@@ -0,0 +1,44 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation.
+#   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  # the version of the EAL API
+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()))
+endif
diff --git a/lib/meson.build b/lib/meson.build
new file mode 100644
index 000000000..7cafe6666
--- /dev/null
+++ b/lib/meson.build
@@ -0,0 +1,32 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation.
+#   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('librte_eal')
diff --git a/meson.build b/meson.build
index 8588e0e39..614393e65 100644
--- a/meson.build
+++ b/meson.build
@@ -57,7 +57,8 @@ endif
 global_inc = include_directories('.', 'config')
 subdir('config')
 
-# TODO build libs and drivers
+# build libs and (TODO) drivers
+subdir('lib')
 
 # TODO build binaries and installable tools
 
-- 
2.13.5

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

* [PATCH v2 03/17] igb_uio: add igb_uio kmod to meson build
  2017-09-12 10:37 ` [PATCH v2 " Bruce Richardson
  2017-09-12 10:37   ` [PATCH v2 01/17] build: add initial infrastructure for meson & ninja builds Bruce Richardson
  2017-09-12 10:37   ` [PATCH v2 02/17] eal: add eal library to meson build Bruce Richardson
@ 2017-09-12 10:37   ` Bruce Richardson
  2017-09-12 10:37   ` [PATCH v2 04/17] build: add DPDK libraries to build Bruce Richardson
                     ` (15 subsequent siblings)
  18 siblings, 0 replies; 107+ messages in thread
From: Bruce Richardson @ 2017-09-12 10:37 UTC (permalink / raw)
  To: dev; +Cc: nhorman, luca.boccassi, harry.van.haaren, Bruce Richardson

Support building igb_uio using meson and ninja. For this, we still use the
kernel's kbuild system, by calling out to make, since it's safer and easier
than trying to reproduce that in meson. A list of suitable file
dependencies is given so that we have a reasonable chance of a rebuild when
necessary.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Harry van Haaren <harry.van.haaren@intel.com>
---
 lib/librte_eal/linuxapp/igb_uio/Kbuild      |  1 +
 lib/librte_eal/linuxapp/igb_uio/meson.build | 46 +++++++++++++++++++++++++++++
 lib/librte_eal/linuxapp/meson.build         | 10 +++++++
 meson_options.txt                           |  2 ++
 4 files changed, 59 insertions(+)
 create mode 100644 lib/librte_eal/linuxapp/igb_uio/Kbuild
 create mode 100644 lib/librte_eal/linuxapp/igb_uio/meson.build

diff --git a/lib/librte_eal/linuxapp/igb_uio/Kbuild b/lib/librte_eal/linuxapp/igb_uio/Kbuild
new file mode 100644
index 000000000..98c98fe52
--- /dev/null
+++ b/lib/librte_eal/linuxapp/igb_uio/Kbuild
@@ -0,0 +1 @@
+obj-m := igb_uio.o
diff --git a/lib/librte_eal/linuxapp/igb_uio/meson.build b/lib/librte_eal/linuxapp/igb_uio/meson.build
new file mode 100644
index 000000000..4712756ea
--- /dev/null
+++ b/lib/librte_eal/linuxapp/igb_uio/meson.build
@@ -0,0 +1,46 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation.
+#   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.
+
+mkfile = custom_target('igb_uio_makefile',
+	output: 'Makefile',
+	command: ['touch', '@OUTPUT@'])
+
+custom_target('igb_uio',
+	input: ['igb_uio.c', 'Kbuild'],
+	output: 'igb_uio.ko',
+	command: ['make', '-C', kernel_dir,
+		'M=' + meson.current_build_dir(),
+		'src=' + meson.current_source_dir(),
+		'EXTRA_CFLAGS=-I' + meson.current_source_dir() +
+			'/../../common/include',
+		'modules'],
+	depends: mkfile,
+	build_by_default: true)
diff --git a/lib/librte_eal/linuxapp/meson.build b/lib/librte_eal/linuxapp/meson.build
index bda974a9a..16a3f6b8b 100644
--- a/lib/librte_eal/linuxapp/meson.build
+++ b/lib/librte_eal/linuxapp/meson.build
@@ -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
diff --git a/meson_options.txt b/meson_options.txt
index c03b79fbd..9c45b8159 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -4,3 +4,5 @@ option('max_numa_nodes', type: 'string', value: '4', description: 'maximum numbe
 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')
+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')
-- 
2.13.5

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

* [PATCH v2 04/17] build: add DPDK libraries to build
  2017-09-12 10:37 ` [PATCH v2 " Bruce Richardson
                     ` (2 preceding siblings ...)
  2017-09-12 10:37   ` [PATCH v2 03/17] igb_uio: add igb_uio kmod " Bruce Richardson
@ 2017-09-12 10:37   ` Bruce Richardson
  2017-09-12 10:37   ` [PATCH v2 05/17] build: add buildtools to meson build Bruce Richardson
                     ` (14 subsequent siblings)
  18 siblings, 0 replies; 107+ messages in thread
From: Bruce Richardson @ 2017-09-12 10:37 UTC (permalink / raw)
  To: dev; +Cc: nhorman, luca.boccassi, harry.van.haaren, Bruce Richardson

Add non-EAL libraries to DPDK build. The compat lib is a special case,
along with the previously-added EAL, but all other libs can be build using
the same set of commands, where the individual meson.build files only need
to specify their dependencies, source files, header files and ABI versions.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Harry van Haaren <harry.van.haaren@intel.com>
---
 config/rte_config.h                 | 36 ++++++++++++++++++++
 lib/librte_acl/meson.build          | 59 ++++++++++++++++++++++++++++++++
 lib/librte_bitratestats/meson.build | 34 +++++++++++++++++++
 lib/librte_cfgfile/meson.build      | 34 +++++++++++++++++++
 lib/librte_cmdline/meson.build      | 55 ++++++++++++++++++++++++++++++
 lib/librte_compat/meson.build       | 36 ++++++++++++++++++++
 lib/librte_cryptodev/meson.build    | 40 ++++++++++++++++++++++
 lib/librte_distributor/meson.build  | 39 +++++++++++++++++++++
 lib/librte_efd/meson.build          | 34 +++++++++++++++++++
 lib/librte_ether/meson.build        | 45 +++++++++++++++++++++++++
 lib/librte_eventdev/meson.build     | 36 ++++++++++++++++++++
 lib/librte_gro/meson.build          | 34 +++++++++++++++++++
 lib/librte_hash/meson.build         | 45 +++++++++++++++++++++++++
 lib/librte_ip_frag/meson.build      | 39 +++++++++++++++++++++
 lib/librte_jobstats/meson.build     | 33 ++++++++++++++++++
 lib/librte_kni/meson.build          | 38 +++++++++++++++++++++
 lib/librte_kvargs/meson.build       | 34 +++++++++++++++++++
 lib/librte_latencystats/meson.build | 34 +++++++++++++++++++
 lib/librte_lpm/meson.build          | 35 +++++++++++++++++++
 lib/librte_mbuf/meson.build         | 35 +++++++++++++++++++
 lib/librte_mempool/meson.build      | 35 +++++++++++++++++++
 lib/librte_meter/meson.build        | 33 ++++++++++++++++++
 lib/librte_metrics/meson.build      | 33 ++++++++++++++++++
 lib/librte_net/meson.build          | 45 +++++++++++++++++++++++++
 lib/librte_pdump/meson.build        | 34 +++++++++++++++++++
 lib/librte_pipeline/meson.build     | 35 +++++++++++++++++++
 lib/librte_port/meson.build         | 58 ++++++++++++++++++++++++++++++++
 lib/librte_power/meson.build        | 37 ++++++++++++++++++++
 lib/librte_reorder/meson.build      | 34 +++++++++++++++++++
 lib/librte_ring/meson.build         | 33 ++++++++++++++++++
 lib/librte_sched/meson.build        | 36 ++++++++++++++++++++
 lib/librte_table/meson.build        | 52 ++++++++++++++++++++++++++++
 lib/librte_timer/meson.build        | 33 ++++++++++++++++++
 lib/librte_vhost/meson.build        | 39 +++++++++++++++++++++
 lib/meson.build                     | 67 +++++++++++++++++++++++++++++++++++++
 35 files changed, 1379 insertions(+)
 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_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
 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

diff --git a/config/rte_config.h b/config/rte_config.h
index c94704cfe..b47cfabae 100644
--- a/config/rte_config.h
+++ b/config/rte_config.h
@@ -58,4 +58,40 @@
 #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
+
+/* 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
+
 #endif /* _RTE_CONFIG_H_ */
diff --git a/lib/librte_acl/meson.build b/lib/librte_acl/meson.build
new file mode 100644
index 000000000..b81b74468
--- /dev/null
+++ b/lib/librte_acl/meson.build
@@ -0,0 +1,59 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation.
+#   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')
+
+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
diff --git a/lib/librte_bitratestats/meson.build b/lib/librte_bitratestats/meson.build
new file mode 100644
index 000000000..dcf6070bf
--- /dev/null
+++ b/lib/librte_bitratestats/meson.build
@@ -0,0 +1,34 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation.
+#   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 += ['ethdev', 'metrics']
diff --git a/lib/librte_cfgfile/meson.build b/lib/librte_cfgfile/meson.build
new file mode 100644
index 000000000..1a4992ff3
--- /dev/null
+++ b/lib/librte_cfgfile/meson.build
@@ -0,0 +1,34 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation.
+#   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')
diff --git a/lib/librte_cmdline/meson.build b/lib/librte_cmdline/meson.build
new file mode 100644
index 000000000..80fbe5d07
--- /dev/null
+++ b/lib/librte_cmdline/meson.build
@@ -0,0 +1,55 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation.
+#   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('cmdline.c',
+	'cmdline_cirbuf.c',
+	'cmdline_parse.c',
+	'cmdline_parse_etheraddr.c',
+	'cmdline_parse_ipaddr.c',
+	'cmdline_parse_num.c',
+	'cmdline_parse_portlist.c',
+	'cmdline_parse_string.c',
+	'cmdline_rdline.c',
+	'cmdline_socket.c',
+	'cmdline_vt100.c')
+
+headers = files('cmdline.h',
+	'cmdline_parse.h',
+	'cmdline_parse_num.h',
+	'cmdline_parse_ipaddr.h',
+	'cmdline_parse_etheraddr.h',
+	'cmdline_parse_string.h',
+	'cmdline_rdline.h',
+	'cmdline_vt100.h',
+	'cmdline_socket.h',
+	'cmdline_cirbuf.h',
+	'cmdline_parse_portlist.h')
diff --git a/lib/librte_compat/meson.build b/lib/librte_compat/meson.build
new file mode 100644
index 000000000..3b911dfff
--- /dev/null
+++ b/lib/librte_compat/meson.build
@@ -0,0 +1,36 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation.
+#   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')
+
+set_variable('dep_rte_compat',
+	declare_dependency(include_directories: include_directories('.')))
diff --git a/lib/librte_cryptodev/meson.build b/lib/librte_cryptodev/meson.build
new file mode 100644
index 000000000..e45e7098a
--- /dev/null
+++ b/lib/librte_cryptodev/meson.build
@@ -0,0 +1,40 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation.
+#   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_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 += ['kvargs', 'mbuf']
diff --git a/lib/librte_distributor/meson.build b/lib/librte_distributor/meson.build
new file mode 100644
index 000000000..6118c5f50
--- /dev/null
+++ b/lib/librte_distributor/meson.build
@@ -0,0 +1,39 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation.
+#   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 += ['mbuf', 'compat']
diff --git a/lib/librte_efd/meson.build b/lib/librte_efd/meson.build
new file mode 100644
index 000000000..73c004e70
--- /dev/null
+++ b/lib/librte_efd/meson.build
@@ -0,0 +1,34 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation.
+#   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 += ['ring', 'hash']
diff --git a/lib/librte_ether/meson.build b/lib/librte_ether/meson.build
new file mode 100644
index 000000000..d10bd37d5
--- /dev/null
+++ b/lib/librte_ether/meson.build
@@ -0,0 +1,45 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation.
+#   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.
+
+name = 'ethdev'
+version = 6
+sources = files('rte_ethdev.c', 'rte_flow.c', 'rte_tm.c')
+
+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_tm.h')
+
+deps += ['net']
diff --git a/lib/librte_eventdev/meson.build b/lib/librte_eventdev/meson.build
new file mode 100644
index 000000000..60d5f4e89
--- /dev/null
+++ b/lib/librte_eventdev/meson.build
@@ -0,0 +1,36 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation.
+#   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 += ['ring']
diff --git a/lib/librte_gro/meson.build b/lib/librte_gro/meson.build
new file mode 100644
index 000000000..f6848c42b
--- /dev/null
+++ b/lib/librte_gro/meson.build
@@ -0,0 +1,34 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation.
+#   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 += ['ethdev']
diff --git a/lib/librte_hash/meson.build b/lib/librte_hash/meson.build
new file mode 100644
index 000000000..1df383f4b
--- /dev/null
+++ b/lib/librte_hash/meson.build
@@ -0,0 +1,45 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation.
+#   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
+headers = files('rte_cmp_arm64.h',
+	'rte_cmp_x86.h',
+	'rte_crc_arm64.h',
+	'rte_cuckoo_hash.h',
+	'rte_cuckoo_hash_x86.h',
+	'rte_fbk_hash.h',
+	'rte_hash_crc.h',
+	'rte_hash.h',
+	'rte_jhash.h',
+	'rte_thash.h')
+
+sources = files('rte_cuckoo_hash.c', 'rte_fbk_hash.c')
+deps += ['ring', 'compat']
diff --git a/lib/librte_ip_frag/meson.build b/lib/librte_ip_frag/meson.build
new file mode 100644
index 000000000..11523badf
--- /dev/null
+++ b/lib/librte_ip_frag/meson.build
@@ -0,0 +1,39 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation.
+#   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 += ['ethdev', 'hash']
diff --git a/lib/librte_jobstats/meson.build b/lib/librte_jobstats/meson.build
new file mode 100644
index 000000000..97cf01cad
--- /dev/null
+++ b/lib/librte_jobstats/meson.build
@@ -0,0 +1,33 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation.
+#   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')
diff --git a/lib/librte_kni/meson.build b/lib/librte_kni/meson.build
new file mode 100644
index 000000000..25934a46d
--- /dev/null
+++ b/lib/librte_kni/meson.build
@@ -0,0 +1,38 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation.
+#   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
+version = 2
+sources = files('rte_kni.c')
+headers = files('rte_kni.h')
+deps += ['ethdev']
diff --git a/lib/librte_kvargs/meson.build b/lib/librte_kvargs/meson.build
new file mode 100644
index 000000000..2962fc370
--- /dev/null
+++ b/lib/librte_kvargs/meson.build
@@ -0,0 +1,34 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation.
+#   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 = 1
+sources = files('rte_kvargs.c')
+headers = files('rte_kvargs.h')
diff --git a/lib/librte_latencystats/meson.build b/lib/librte_latencystats/meson.build
new file mode 100644
index 000000000..10a778433
--- /dev/null
+++ b/lib/librte_latencystats/meson.build
@@ -0,0 +1,34 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation.
+#   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 += ['metrics', 'ethdev']
diff --git a/lib/librte_lpm/meson.build b/lib/librte_lpm/meson.build
new file mode 100644
index 000000000..af88a97ec
--- /dev/null
+++ b/lib/librte_lpm/meson.build
@@ -0,0 +1,35 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation.
+#   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 += ['compat']
diff --git a/lib/librte_mbuf/meson.build b/lib/librte_mbuf/meson.build
new file mode 100644
index 000000000..96856e231
--- /dev/null
+++ b/lib/librte_mbuf/meson.build
@@ -0,0 +1,35 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation.
+#   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_mbuf.c', 'rte_mbuf_ptype.c')
+headers = files('rte_mbuf.h', 'rte_mbuf_ptype.h')
+deps += ['mempool']
diff --git a/lib/librte_mempool/meson.build b/lib/librte_mempool/meson.build
new file mode 100644
index 000000000..96e582deb
--- /dev/null
+++ b/lib/librte_mempool/meson.build
@@ -0,0 +1,35 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation.
+#   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_mempool.c', 'rte_mempool_ops.c')
+headers = files('rte_mempool.h')
+deps += ['ring']
diff --git a/lib/librte_meter/meson.build b/lib/librte_meter/meson.build
new file mode 100644
index 000000000..debcebcc1
--- /dev/null
+++ b/lib/librte_meter/meson.build
@@ -0,0 +1,33 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation.
+#   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')
diff --git a/lib/librte_metrics/meson.build b/lib/librte_metrics/meson.build
new file mode 100644
index 000000000..c820503f0
--- /dev/null
+++ b/lib/librte_metrics/meson.build
@@ -0,0 +1,33 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation.
+#   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')
diff --git a/lib/librte_net/meson.build b/lib/librte_net/meson.build
new file mode 100644
index 000000000..62bbf4c22
--- /dev/null
+++ b/lib/librte_net/meson.build
@@ -0,0 +1,45 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation.
+#   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 = 1
+headers = files('rte_ip.h',
+	'rte_tcp.h',
+	'rte_udp.h',
+	'rte_sctp.h',
+	'rte_icmp.h',
+	'rte_arp.h',
+	'rte_ether.h',
+	'rte_gre.h',
+	'rte_net.h',
+	'rte_net_crc.h')
+
+sources = files('rte_net.c', 'rte_net_crc.c')
+deps += ['mbuf']
diff --git a/lib/librte_pdump/meson.build b/lib/librte_pdump/meson.build
new file mode 100644
index 000000000..94a92b677
--- /dev/null
+++ b/lib/librte_pdump/meson.build
@@ -0,0 +1,34 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation.
+#   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 += ['ethdev']
diff --git a/lib/librte_pipeline/meson.build b/lib/librte_pipeline/meson.build
new file mode 100644
index 000000000..54e34fc62
--- /dev/null
+++ b/lib/librte_pipeline/meson.build
@@ -0,0 +1,35 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation.
+#   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']
diff --git a/lib/librte_port/meson.build b/lib/librte_port/meson.build
new file mode 100644
index 000000000..a0d3a8c07
--- /dev/null
+++ b/lib/librte_port/meson.build
@@ -0,0 +1,58 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation.
+#   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_port_ethdev.c',
+	'rte_port_fd.c',
+	'rte_port_ring.c',
+	'rte_port_sched.c',
+	'rte_port_source_sink.c')
+headers = files(
+	'rte_port_ethdev.h',
+	'rte_port_fd.h',
+	'rte_port.h',
+	'rte_port_ring.h',
+	'rte_port_sched.h',
+	'rte_port_source_sink.h')
+deps += ['ethdev', 'sched']
+
+if dpdk_conf.has('RTE_LIBRTE_IP_FRAG')
+	sources += files('rte_port_frag.c', 'rte_port_ras.c')
+	headers += files('rte_port_frag.h', 'rte_port_ras.h')
+	deps += ['ip_frag']
+endif
+
+if dpdk_conf.has('RTE_LIBRTE_KNI')
+	sources += files('rte_port_kni.c')
+	headers += files('rte_port_kni.h')
+	deps += 'kni'
+endif
diff --git a/lib/librte_power/meson.build b/lib/librte_power/meson.build
new file mode 100644
index 000000000..541efa6a4
--- /dev/null
+++ b/lib/librte_power/meson.build
@@ -0,0 +1,37 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation.
+#   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('rte_power.c', 'rte_power_acpi_cpufreq.c',
+		'rte_power_kvm_vm.c', 'guest_channel.c')
+headers = files('rte_power.h')
diff --git a/lib/librte_reorder/meson.build b/lib/librte_reorder/meson.build
new file mode 100644
index 000000000..456e83f02
--- /dev/null
+++ b/lib/librte_reorder/meson.build
@@ -0,0 +1,34 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation.
+#   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 += ['mbuf']
diff --git a/lib/librte_ring/meson.build b/lib/librte_ring/meson.build
new file mode 100644
index 000000000..8c102fe6a
--- /dev/null
+++ b/lib/librte_ring/meson.build
@@ -0,0 +1,33 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation.
+#   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_ring.c')
+headers = files('rte_ring.h')
diff --git a/lib/librte_sched/meson.build b/lib/librte_sched/meson.build
new file mode 100644
index 000000000..c4badb211
--- /dev/null
+++ b/lib/librte_sched/meson.build
@@ -0,0 +1,36 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation.
+#   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']
diff --git a/lib/librte_table/meson.build b/lib/librte_table/meson.build
new file mode 100644
index 000000000..2fb3ec804
--- /dev/null
+++ b/lib/librte_table/meson.build
@@ -0,0 +1,52 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation.
+#   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_table_lpm.c', 'rte_table_lpm_ipv6.c',
+		'rte_table_hash_cuckoo.c', 'rte_table_hash_key8.c',
+		'rte_table_hash_key16.c', 'rte_table_hash_key32.c',
+		'rte_table_hash_ext.c', 'rte_table_hash_lru.c',
+		'rte_table_array.c', 'rte_table_stub.c')
+headers = files('rte_table.h', 'rte_table_lpm.h',
+		'rte_table_lpm_ipv6.h', 'rte_table_hash.h',
+		'rte_lru.h', 'rte_table_array.h',
+		'rte_table_stub.h')
+deps += ['mbuf', 'port', 'lpm', 'hash']
+
+if arch_subdir == 'x86'
+	headers += files('rte_lru_x86.h')
+endif
+
+if dpdk_conf.has('RTE_LIBRTE_ACL')
+	sources += files('rte_table_acl.c')
+	headers += files('rte_table_acl.h')
+	deps += ['acl']
+endif
diff --git a/lib/librte_timer/meson.build b/lib/librte_timer/meson.build
new file mode 100644
index 000000000..0edc45772
--- /dev/null
+++ b/lib/librte_timer/meson.build
@@ -0,0 +1,33 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation.
+#   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')
diff --git a/lib/librte_vhost/meson.build b/lib/librte_vhost/meson.build
new file mode 100644
index 000000000..5482169ca
--- /dev/null
+++ b/lib/librte_vhost/meson.build
@@ -0,0 +1,39 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation.
+#   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
+version = 4
+sources = files('fd_man.c', 'socket.c', 'vhost.c', 'vhost_user.c',
+		'virtio_net.c')
+headers = files('rte_vhost.h')
+deps += ['ethdev']
diff --git a/lib/meson.build b/lib/meson.build
index 7cafe6666..d814721de 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -29,4 +29,71 @@
 #   (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, and compat, just a header
 subdir('librte_eal')
+subdir('librte_compat')
+
+# process all libraries equally, as far as possible
+# "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.
+libraries = ['ring', 'mempool', 'mbuf', 'net', 'ether', # core
+	'metrics', # bitrate/latency stats depends on this
+	'hash',    # efd depends on this
+	'kvargs',  # cryptodev depends on this
+	'acl', 'bitratestats', 'cfgfile', 'cmdline', 'cryptodev',
+	'distributor', 'efd', 'eventdev', 'gro', 'ip_frag', 'jobstats',
+	'kni', 'latencystats', 'lpm', 'meter', 'power', 'pdump',
+	'reorder', 'sched', 'timer', 'vhost',
+	# add pkt framework libs which use other libs from above
+	'port', 'table', 'pipeline']
+
+foreach l:libraries
+	build = true
+	name = l
+	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 = ['eal']
+	ext_deps = []
+
+	dir_name = 'librte_' + l
+	subdir(dir_name)
+
+	if build
+		dpdk_conf.set('RTE_LIBRTE_' + name.to_upper(), 1)
+		install_headers(headers)
+
+		dep_objs = ext_deps
+		foreach d:deps
+			dep_objs += [get_variable('dep_rte_' + d)]
+		endforeach
+
+		version_map = '@0@/@1@/rte_@2@_version.map'.format(
+				meson.current_source_dir(), dir_name, name)
+		libname = 'rte_' + name
+		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,
+				link_depends: version_map,
+				version: '@0@.1'.format(version),
+				install: true)
+		dep = declare_dependency(link_with: lib,
+				include_directories: include_directories(dir_name),
+				dependencies: dep_objs)
+		set_variable('dep_' + libname, dep)
+
+		dpdk_libraries = [lib] + dpdk_libraries
+	endif
+endforeach
-- 
2.13.5

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

* [PATCH v2 05/17] build: add buildtools to meson build
  2017-09-12 10:37 ` [PATCH v2 " Bruce Richardson
                     ` (3 preceding siblings ...)
  2017-09-12 10:37   ` [PATCH v2 04/17] build: add DPDK libraries to build Bruce Richardson
@ 2017-09-12 10:37   ` Bruce Richardson
  2017-09-12 10:37   ` [PATCH v2 06/17] build: add infrastructure for building PMDs Bruce Richardson
                     ` (13 subsequent siblings)
  18 siblings, 0 replies; 107+ messages in thread
From: Bruce Richardson @ 2017-09-12 10:37 UTC (permalink / raw)
  To: dev; +Cc: nhorman, luca.boccassi, harry.van.haaren, Bruce Richardson

Add the buildtools folder, and more specifically the pmdinfogen binary to
the meson and ninja build. This will be needed for building the PMDs in the
driver folder later, as the pmd info output from the tool needs to be
included in those libs.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Harry van Haaren <harry.van.haaren@intel.com>
---
 buildtools/gen-pmdinfo-cfile.sh   | 41 +++++++++++++++++++++++++++++++++++++++
 buildtools/meson.build            | 34 ++++++++++++++++++++++++++++++++
 buildtools/pmdinfogen/meson.build | 36 ++++++++++++++++++++++++++++++++++
 meson.build                       |  1 +
 4 files changed, 112 insertions(+)
 create mode 100755 buildtools/gen-pmdinfo-cfile.sh
 create mode 100644 buildtools/meson.build
 create mode 100644 buildtools/pmdinfogen/meson.build

diff --git a/buildtools/gen-pmdinfo-cfile.sh b/buildtools/gen-pmdinfo-cfile.sh
new file mode 100755
index 000000000..6441613ac
--- /dev/null
+++ b/buildtools/gen-pmdinfo-cfile.sh
@@ -0,0 +1,41 @@
+#! /bin/sh
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation.
+#   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.
+
+
+arfile=$1
+output=$2
+pmdinfogen=$3
+
+tmp_o=${output%.c.pmd.c}.tmp.o
+
+ar p $arfile > $tmp_o && \
+		$pmdinfogen $tmp_o $output
diff --git a/buildtools/meson.build b/buildtools/meson.build
new file mode 100644
index 000000000..4537e4d3b
--- /dev/null
+++ b/buildtools/meson.build
@@ -0,0 +1,34 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation.
+#   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')
+
+pmdinfo = find_program('gen-pmdinfo-cfile.sh')
diff --git a/buildtools/pmdinfogen/meson.build b/buildtools/pmdinfogen/meson.build
new file mode 100644
index 000000000..843afba7c
--- /dev/null
+++ b/buildtools/pmdinfogen/meson.build
@@ -0,0 +1,36 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation.
+#   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.
+
+pmdinfogen = executable('pmdinfogen',
+	'pmdinfogen.c',
+	include_directories: eal_inc,
+	native: true,
+	c_args: cflags)
diff --git a/meson.build b/meson.build
index 614393e65..6e16e1bd2 100644
--- a/meson.build
+++ b/meson.build
@@ -59,6 +59,7 @@ subdir('config')
 
 # build libs and (TODO) drivers
 subdir('lib')
+subdir('buildtools')
 
 # TODO build binaries and installable tools
 
-- 
2.13.5

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

* [PATCH v2 06/17] build: add infrastructure for building PMDs
  2017-09-12 10:37 ` [PATCH v2 " Bruce Richardson
                     ` (4 preceding siblings ...)
  2017-09-12 10:37   ` [PATCH v2 05/17] build: add buildtools to meson build Bruce Richardson
@ 2017-09-12 10:37   ` Bruce Richardson
  2017-09-12 10:37   ` [PATCH v2 07/17] drivers/mempool: add SW mempool drivers to meson build Bruce Richardson
                     ` (12 subsequent siblings)
  18 siblings, 0 replies; 107+ messages in thread
From: Bruce Richardson @ 2017-09-12 10:37 UTC (permalink / raw)
  To: dev; +Cc: nhorman, luca.boccassi, harry.van.haaren, Bruce Richardson

Add in the top-level drivers meson.build file to start adding in building
of PMDs. Since all PMDs are built in pretty much the same way, the logic
for building each PMD, including extracting the pmdinfo, is included in the
top level build file. This means that each individual driver class only
needs to specify its default dependencies and a few naming conventions, and
each driver only needs to specify it's source files, headers, etc.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Harry van Haaren <harry.van.haaren@intel.com>
---
 drivers/meson.build | 121 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 meson.build         |   3 +-
 2 files changed, 123 insertions(+), 1 deletion(-)
 create mode 100644 drivers/meson.build

diff --git a/drivers/meson.build b/drivers/meson.build
new file mode 100644
index 000000000..3e5046fe1
--- /dev/null
+++ b/drivers/meson.build
@@ -0,0 +1,121 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation.
+#   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.
+
+driver_classes = []
+
+foreach class:driver_classes
+	drivers = []
+	std_deps = []
+	config_flag_fmt = '' # format string used to set the value in dpdk_conf
+	driver_name_fmt = '' # format string for driver name, used to name
+	                     # the library, the dependency and to find the
+	                     # version file for linking
+
+	subdir(class)
+
+	foreach drv:drivers
+		drv_path = join_paths(class, drv)
+
+		# 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_path)]
+		# 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 = []
+		pkgconfig_extra_libs = []
+
+		# pull in driver directory which should assign to each of the above
+		subdir(drv_path)
+
+		if build
+			dpdk_conf.set(config_flag_fmt.format(drv.to_upper()),1)
+
+			# get dependency objs from strings
+			dep_objs = []
+			foreach d:deps
+				dep_objs += [get_variable('dep_rte_' + d)]
+			endforeach
+			dep_objs += ext_deps
+			dpdk_extra_ldflags += pkgconfig_extra_libs
+
+			# generate pmdinfo sources
+			pmdinfogen_srcs = run_command('grep', '--files-with-matches',
+				'RTE_PMD_REGISTER_.*(.*)', sources).stdout().strip().split()
+			foreach src: pmdinfogen_srcs
+				out_filename = '@0@.pmd.c'.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 = driver_name_fmt.format(drv)
+			version_map = '@0@/@1@/@2@_version.map'.format(
+					meson.current_source_dir(),
+					drv_path, drv_name)
+			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: '@0@.1'.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_@0@'.format(drv_name),
+					declare_dependency(link_with: lib,
+					include_directories: includes,
+					dependencies: dep_objs))
+		endif # build
+	endforeach
+endforeach
diff --git a/meson.build b/meson.build
index 6e16e1bd2..a7feb7069 100644
--- a/meson.build
+++ b/meson.build
@@ -57,9 +57,10 @@ endif
 global_inc = include_directories('.', 'config')
 subdir('config')
 
-# build libs and (TODO) drivers
+# build libs and drivers
 subdir('lib')
 subdir('buildtools')
+subdir('drivers')
 
 # TODO build binaries and installable tools
 
-- 
2.13.5

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

* [PATCH v2 07/17] drivers/mempool: add SW mempool drivers to meson build
  2017-09-12 10:37 ` [PATCH v2 " Bruce Richardson
                     ` (5 preceding siblings ...)
  2017-09-12 10:37   ` [PATCH v2 06/17] build: add infrastructure for building PMDs Bruce Richardson
@ 2017-09-12 10:37   ` Bruce Richardson
  2017-09-12 10:38   ` [PATCH v2 08/17] drivers/crypto: add crypto drv class and null PMD to meson Bruce Richardson
                     ` (11 subsequent siblings)
  18 siblings, 0 replies; 107+ messages in thread
From: Bruce Richardson @ 2017-09-12 10:37 UTC (permalink / raw)
  To: dev; +Cc: nhorman, luca.boccassi, harry.van.haaren, Bruce Richardson

With build infrastructure in place, add in mempool drivers to the build.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Harry van Haaren <harry.van.haaren@intel.com>
---
 drivers/mempool/meson.build       | 35 +++++++++++++++++++++++++++++++++++
 drivers/mempool/ring/meson.build  | 32 ++++++++++++++++++++++++++++++++
 drivers/mempool/stack/meson.build | 32 ++++++++++++++++++++++++++++++++
 drivers/meson.build               |  2 +-
 4 files changed, 100 insertions(+), 1 deletion(-)
 create mode 100644 drivers/mempool/meson.build
 create mode 100644 drivers/mempool/ring/meson.build
 create mode 100644 drivers/mempool/stack/meson.build

diff --git a/drivers/mempool/meson.build b/drivers/mempool/meson.build
new file mode 100644
index 000000000..c1bda9783
--- /dev/null
+++ b/drivers/mempool/meson.build
@@ -0,0 +1,35 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation.
+#   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.
+
+drivers = ['ring', 'stack']
+std_deps = ['mempool']
+config_flag_fmt = 'RTE_LIBRTE_@0@_MEMPOOL'
+driver_name_fmt = 'rte_mempool_@0@'
diff --git a/drivers/mempool/ring/meson.build b/drivers/mempool/ring/meson.build
new file mode 100644
index 000000000..7a988f0a2
--- /dev/null
+++ b/drivers/mempool/ring/meson.build
@@ -0,0 +1,32 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation.
+#   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')
diff --git a/drivers/mempool/stack/meson.build b/drivers/mempool/stack/meson.build
new file mode 100644
index 000000000..7b690b68d
--- /dev/null
+++ b/drivers/mempool/stack/meson.build
@@ -0,0 +1,32 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation.
+#   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')
diff --git a/drivers/meson.build b/drivers/meson.build
index 3e5046fe1..d8f11aa68 100644
--- a/drivers/meson.build
+++ b/drivers/meson.build
@@ -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.
 
-driver_classes = []
+driver_classes = ['mempool']
 
 foreach class:driver_classes
 	drivers = []
-- 
2.13.5

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

* [PATCH v2 08/17] drivers/crypto: add crypto drv class and null PMD to meson
  2017-09-12 10:37 ` [PATCH v2 " Bruce Richardson
                     ` (6 preceding siblings ...)
  2017-09-12 10:37   ` [PATCH v2 07/17] drivers/mempool: add SW mempool drivers to meson build Bruce Richardson
@ 2017-09-12 10:38   ` Bruce Richardson
  2017-09-12 10:38   ` [PATCH v2 09/17] crypto/openssl: add driver to meson build Bruce Richardson
                     ` (10 subsequent siblings)
  18 siblings, 0 replies; 107+ messages in thread
From: Bruce Richardson @ 2017-09-12 10:38 UTC (permalink / raw)
  To: dev; +Cc: nhorman, luca.boccassi, harry.van.haaren, Bruce Richardson

Add in a crypto driver class, and implement compiling the null crypto
instance.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Harry van Haaren <harry.van.haaren@intel.com>
---
 drivers/crypto/meson.build      | 35 +++++++++++++++++++++++++++++++++++
 drivers/crypto/null/meson.build | 33 +++++++++++++++++++++++++++++++++
 drivers/meson.build             | 13 +++++++------
 3 files changed, 75 insertions(+), 6 deletions(-)
 create mode 100644 drivers/crypto/meson.build
 create mode 100644 drivers/crypto/null/meson.build

diff --git a/drivers/crypto/meson.build b/drivers/crypto/meson.build
new file mode 100644
index 000000000..c84a9d522
--- /dev/null
+++ b/drivers/crypto/meson.build
@@ -0,0 +1,35 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation.
+#   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.
+
+drivers = ['null']
+std_deps = ['cryptodev'] # cryptodev pulls in all other needed deps
+config_flag_fmt = 'RTE_LIBRTE_@0@_PMD'
+driver_name_fmt = 'rte_pmd_@0@'
diff --git a/drivers/crypto/null/meson.build b/drivers/crypto/null/meson.build
new file mode 100644
index 000000000..ea08f783c
--- /dev/null
+++ b/drivers/crypto/null/meson.build
@@ -0,0 +1,33 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation.
+#   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.
+
+name = 'null_crypto'
+sources = files('null_crypto_pmd.c', 'null_crypto_pmd_ops.c')
diff --git a/drivers/meson.build b/drivers/meson.build
index d8f11aa68..be87918b2 100644
--- a/drivers/meson.build
+++ b/drivers/meson.build
@@ -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.
 
-driver_classes = ['mempool']
+driver_classes = ['crypto', 'mempool']
 
 foreach class:driver_classes
 	drivers = []
@@ -46,6 +46,7 @@ foreach class:driver_classes
 
 		# set up empty variables used for build
 		build = true # set to false to disable, e.g. missing deps
+		name = drv
 		version = 1
 		sources = []
 		objs = []
@@ -65,7 +66,7 @@ foreach class:driver_classes
 		subdir(drv_path)
 
 		if build
-			dpdk_conf.set(config_flag_fmt.format(drv.to_upper()),1)
+			dpdk_conf.set(config_flag_fmt.format(name.to_upper()),1)
 
 			# get dependency objs from strings
 			dep_objs = []
@@ -92,11 +93,11 @@ foreach class:driver_classes
 			endforeach
 
 			# now build the driver itself, and add to the drivers list
-			drv_name = driver_name_fmt.format(drv)
+			lib_name = driver_name_fmt.format(name)
 			version_map = '@0@/@1@/@2@_version.map'.format(
 					meson.current_source_dir(),
-					drv_path, drv_name)
-			lib = library(drv_name,
+					drv_path, lib_name)
+			lib = library(lib_name,
 				sources,
 				objects: objs,
 				include_directories: includes,
@@ -112,7 +113,7 @@ foreach class:driver_classes
 
 			# 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_@0@'.format(drv_name),
+			set_variable('dep_@0@'.format(lib_name),
 					declare_dependency(link_with: lib,
 					include_directories: includes,
 					dependencies: dep_objs))
-- 
2.13.5

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

* [PATCH v2 09/17] crypto/openssl: add driver to meson build
  2017-09-12 10:37 ` [PATCH v2 " Bruce Richardson
                     ` (7 preceding siblings ...)
  2017-09-12 10:38   ` [PATCH v2 08/17] drivers/crypto: add crypto drv class and null PMD to meson Bruce Richardson
@ 2017-09-12 10:38   ` Bruce Richardson
  2017-09-12 10:38   ` [PATCH v2 10/17] crypto/qat: " Bruce Richardson
                     ` (9 subsequent siblings)
  18 siblings, 0 replies; 107+ messages in thread
From: Bruce Richardson @ 2017-09-12 10:38 UTC (permalink / raw)
  To: dev; +Cc: nhorman, luca.boccassi, harry.van.haaren, Bruce Richardson

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Harry van Haaren <harry.van.haaren@intel.com>
---
 drivers/crypto/meson.build         |  2 +-
 drivers/crypto/openssl/meson.build | 38 ++++++++++++++++++++++++++++++++++++++
 2 files changed, 39 insertions(+), 1 deletion(-)
 create mode 100644 drivers/crypto/openssl/meson.build

diff --git a/drivers/crypto/meson.build b/drivers/crypto/meson.build
index c84a9d522..b9488e761 100644
--- a/drivers/crypto/meson.build
+++ b/drivers/crypto/meson.build
@@ -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 = ['null']
+drivers = ['null', 'openssl']
 std_deps = ['cryptodev'] # cryptodev pulls in all other needed deps
 config_flag_fmt = 'RTE_LIBRTE_@0@_PMD'
 driver_name_fmt = 'rte_pmd_@0@'
diff --git a/drivers/crypto/openssl/meson.build b/drivers/crypto/openssl/meson.build
new file mode 100644
index 000000000..677d16742
--- /dev/null
+++ b/drivers/crypto/openssl/meson.build
@@ -0,0 +1,38 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation.
+#   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.
+
+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 += dep
+pkgconfig_extra_libs += '-lcrypto'
-- 
2.13.5

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

* [PATCH v2 10/17] crypto/qat: add driver to meson build
  2017-09-12 10:37 ` [PATCH v2 " Bruce Richardson
                     ` (8 preceding siblings ...)
  2017-09-12 10:38   ` [PATCH v2 09/17] crypto/openssl: add driver to meson build Bruce Richardson
@ 2017-09-12 10:38   ` Bruce Richardson
  2017-09-12 10:38   ` [PATCH v2 11/17] drivers/net: add net driver support " Bruce Richardson
                     ` (8 subsequent siblings)
  18 siblings, 0 replies; 107+ messages in thread
From: Bruce Richardson @ 2017-09-12 10:38 UTC (permalink / raw)
  To: dev; +Cc: nhorman, luca.boccassi, harry.van.haaren, Bruce Richardson

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Harry van Haaren <harry.van.haaren@intel.com>
---
 config/rte_config.h            |  8 ++++++++
 drivers/crypto/meson.build     |  2 +-
 drivers/crypto/qat/meson.build | 41 +++++++++++++++++++++++++++++++++++++++++
 3 files changed, 50 insertions(+), 1 deletion(-)
 create mode 100644 drivers/crypto/qat/meson.build

diff --git a/config/rte_config.h b/config/rte_config.h
index b47cfabae..f2009ac79 100644
--- a/config/rte_config.h
+++ b/config/rte_config.h
@@ -94,4 +94,12 @@
 #define RTE_SCHED_PORT_N_GRINDERS 8
 #undef RTE_SCHED_VECTOR
 
+/****** driver defines ********/
+
+/*
+ * 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_ */
diff --git a/drivers/crypto/meson.build b/drivers/crypto/meson.build
index b9488e761..cacef1c17 100644
--- a/drivers/crypto/meson.build
+++ b/drivers/crypto/meson.build
@@ -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 = ['null', 'openssl']
+drivers = ['qat', 'null', 'openssl']
 std_deps = ['cryptodev'] # cryptodev pulls in all other needed deps
 config_flag_fmt = 'RTE_LIBRTE_@0@_PMD'
 driver_name_fmt = 'rte_pmd_@0@'
diff --git a/drivers/crypto/qat/meson.build b/drivers/crypto/qat/meson.build
new file mode 100644
index 000000000..0ff431064
--- /dev/null
+++ b/drivers/crypto/qat/meson.build
@@ -0,0 +1,41 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation.
+#   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.
+
+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 += dep
+pkgconfig_extra_libs += '-lcrypto'
-- 
2.13.5

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

* [PATCH v2 11/17] drivers/net: add net driver support to meson build
  2017-09-12 10:37 ` [PATCH v2 " Bruce Richardson
                     ` (9 preceding siblings ...)
  2017-09-12 10:38   ` [PATCH v2 10/17] crypto/qat: " Bruce Richardson
@ 2017-09-12 10:38   ` Bruce Richardson
  2017-09-12 10:38   ` [PATCH v2 12/17] drivers/net: add set of vdev PMDs to build Bruce Richardson
                     ` (7 subsequent siblings)
  18 siblings, 0 replies; 107+ messages in thread
From: Bruce Richardson @ 2017-09-12 10:38 UTC (permalink / raw)
  To: dev; +Cc: nhorman, luca.boccassi, harry.van.haaren, Bruce Richardson

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Harry van Haaren <harry.van.haaren@intel.com>
---
 drivers/meson.build     |  2 +-
 drivers/net/meson.build | 35 +++++++++++++++++++++++++++++++++++
 2 files changed, 36 insertions(+), 1 deletion(-)
 create mode 100644 drivers/net/meson.build

diff --git a/drivers/meson.build b/drivers/meson.build
index be87918b2..f19da16fb 100644
--- a/drivers/meson.build
+++ b/drivers/meson.build
@@ -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.
 
-driver_classes = ['crypto', 'mempool']
+driver_classes = ['crypto', 'mempool', 'net']
 
 foreach class:driver_classes
 	drivers = []
diff --git a/drivers/net/meson.build b/drivers/net/meson.build
new file mode 100644
index 000000000..d760069fb
--- /dev/null
+++ b/drivers/net/meson.build
@@ -0,0 +1,35 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation.
+#   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.
+
+drivers = []
+std_deps = ['ethdev', 'kvargs'] # 'ethdev' also pulls in mbuf, net, eal etc
+config_flag_fmt = 'RTE_LIBRTE_@0@_PMD'
+driver_name_fmt = 'rte_pmd_@0@'
-- 
2.13.5

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

* [PATCH v2 12/17] drivers/net: add set of vdev PMDs to build
  2017-09-12 10:37 ` [PATCH v2 " Bruce Richardson
                     ` (10 preceding siblings ...)
  2017-09-12 10:38   ` [PATCH v2 11/17] drivers/net: add net driver support " Bruce Richardson
@ 2017-09-12 10:38   ` Bruce Richardson
  2017-09-12 10:38   ` [PATCH v2 13/17] drivers/net: add drivers for Intel NICs to meson build Bruce Richardson
                     ` (6 subsequent siblings)
  18 siblings, 0 replies; 107+ messages in thread
From: Bruce Richardson @ 2017-09-12 10:38 UTC (permalink / raw)
  To: dev; +Cc: nhorman, luca.boccassi, harry.van.haaren, Bruce Richardson

Add the af_packet, null, pcap and ring PMDs to the meson build.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Harry van Haaren <harry.van.haaren@intel.com>
---
 config/rte_config.h               |  4 ++++
 drivers/net/af_packet/meson.build | 35 +++++++++++++++++++++++++++++++++
 drivers/net/meson.build           |  2 +-
 drivers/net/null/meson.build      | 32 ++++++++++++++++++++++++++++++
 drivers/net/pcap/meson.build      | 41 +++++++++++++++++++++++++++++++++++++++
 drivers/net/ring/meson.build      | 33 +++++++++++++++++++++++++++++++
 6 files changed, 146 insertions(+), 1 deletion(-)
 create mode 100644 drivers/net/af_packet/meson.build
 create mode 100644 drivers/net/null/meson.build
 create mode 100644 drivers/net/pcap/meson.build
 create mode 100644 drivers/net/ring/meson.build

diff --git a/config/rte_config.h b/config/rte_config.h
index f2009ac79..79d7e26d9 100644
--- a/config/rte_config.h
+++ b/config/rte_config.h
@@ -102,4 +102,8 @@
  */
 #define RTE_QAT_PMD_MAX_NB_SESSIONS 2048
 
+/* Ring net PMD settings */
+#define RTE_PMD_RING_MAX_RX_RINGS 16
+#define RTE_PMD_RING_MAX_TX_RINGS 16
+
 #endif /* _RTE_CONFIG_H_ */
diff --git a/drivers/net/af_packet/meson.build b/drivers/net/af_packet/meson.build
new file mode 100644
index 000000000..f3607d768
--- /dev/null
+++ b/drivers/net/af_packet/meson.build
@@ -0,0 +1,35 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation.
+#   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('rte_eth_af_packet.c')
diff --git a/drivers/net/meson.build b/drivers/net/meson.build
index d760069fb..9a24bae43 100644
--- a/drivers/net/meson.build
+++ b/drivers/net/meson.build
@@ -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 = []
+drivers = ['af_packet', 'null', 'pcap', 'ring']
 std_deps = ['ethdev', 'kvargs'] # 'ethdev' also pulls in mbuf, net, eal etc
 config_flag_fmt = 'RTE_LIBRTE_@0@_PMD'
 driver_name_fmt = 'rte_pmd_@0@'
diff --git a/drivers/net/null/meson.build b/drivers/net/null/meson.build
new file mode 100644
index 000000000..e90b5c5c7
--- /dev/null
+++ b/drivers/net/null/meson.build
@@ -0,0 +1,32 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation.
+#   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_null.c')
diff --git a/drivers/net/pcap/meson.build b/drivers/net/pcap/meson.build
new file mode 100644
index 000000000..2051ccab0
--- /dev/null
+++ b/drivers/net/pcap/meson.build
@@ -0,0 +1,41 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation.
+#   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.
+
+pcap_dep = dependency('pcap', required: false)
+if pcap_dep.found() == true
+	ext_deps += pcap_dep
+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'
diff --git a/drivers/net/ring/meson.build b/drivers/net/ring/meson.build
new file mode 100644
index 000000000..1ac2c90e7
--- /dev/null
+++ b/drivers/net/ring/meson.build
@@ -0,0 +1,33 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation.
+#   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_ring.c')
+install_headers('rte_eth_ring.h')
-- 
2.13.5

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

* [PATCH v2 13/17] drivers/net: add drivers for Intel NICs to meson build
  2017-09-12 10:37 ` [PATCH v2 " Bruce Richardson
                     ` (11 preceding siblings ...)
  2017-09-12 10:38   ` [PATCH v2 12/17] drivers/net: add set of vdev PMDs to build Bruce Richardson
@ 2017-09-12 10:38   ` Bruce Richardson
  2017-09-12 10:38   ` [PATCH v2 14/17] app/test-pmd: add test-pmd " Bruce Richardson
                     ` (5 subsequent siblings)
  18 siblings, 0 replies; 107+ messages in thread
From: Bruce Richardson @ 2017-09-12 10:38 UTC (permalink / raw)
  To: dev; +Cc: nhorman, luca.boccassi, harry.van.haaren, Bruce Richardson

Add the e1000, fm10k, i40e and ixgbe drivers to the meson & ninja build.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Harry van Haaren <harry.van.haaren@intel.com>
---
 config/rte_config.h                | 12 +++++++
 drivers/net/e1000/base/meson.build | 65 ++++++++++++++++++++++++++++++++++++++
 drivers/net/e1000/meson.build      | 44 ++++++++++++++++++++++++++
 drivers/net/fm10k/base/meson.build | 55 ++++++++++++++++++++++++++++++++
 drivers/net/fm10k/meson.build      | 44 ++++++++++++++++++++++++++
 drivers/net/i40e/base/meson.build  | 56 ++++++++++++++++++++++++++++++++
 drivers/net/i40e/meson.build       | 60 +++++++++++++++++++++++++++++++++++
 drivers/net/ixgbe/base/meson.build | 60 +++++++++++++++++++++++++++++++++++
 drivers/net/ixgbe/meson.build      | 58 ++++++++++++++++++++++++++++++++++
 drivers/net/meson.build            |  3 +-
 10 files changed, 456 insertions(+), 1 deletion(-)
 create mode 100644 drivers/net/e1000/base/meson.build
 create mode 100644 drivers/net/e1000/meson.build
 create mode 100644 drivers/net/fm10k/base/meson.build
 create mode 100644 drivers/net/fm10k/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

diff --git a/config/rte_config.h b/config/rte_config.h
index 79d7e26d9..3e26d5118 100644
--- a/config/rte_config.h
+++ b/config/rte_config.h
@@ -102,6 +102,18 @@
  */
 #define RTE_QAT_PMD_MAX_NB_SESSIONS 2048
 
+/* fm10k defines */
+#define RTE_LIBRTE_FM10K_RX_OLFLAGS_ENABLE 1
+
+/* i40e defines */
+#define RTE_LIBRTE_I40E_RX_ALLOW_BULK_ALLOC 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
+
 /* Ring net PMD settings */
 #define RTE_PMD_RING_MAX_RX_RINGS 16
 #define RTE_PMD_RING_MAX_TX_RINGS 16
diff --git a/drivers/net/e1000/base/meson.build b/drivers/net/e1000/base/meson.build
new file mode 100644
index 000000000..9592762c9
--- /dev/null
+++ b/drivers/net/e1000/base/meson.build
@@ -0,0 +1,65 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation.
+#   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 = [
+	'e1000_80003es2lan.c',
+	'e1000_82540.c',
+	'e1000_82541.c',
+	'e1000_82542.c',
+	'e1000_82543.c',
+	'e1000_82571.c',
+	'e1000_82575.c',
+	'e1000_api.c',
+	'e1000_i210.c',
+	'e1000_ich8lan.c',
+	'e1000_mac.c',
+	'e1000_manage.c',
+	'e1000_mbx.c',
+	'e1000_nvm.c',
+	'e1000_osdep.c',
+	'e1000_phy.c',
+	'e1000_vf.c'
+]
+
+error_cflags = ['-Wno-uninitialized', '-Wno-unused-parameter',
+	'-Wno-unused-variable', '-Wno-misleading-indentation',
+	'-Wno-implicit-fallthrough']
+c_args = cflags
+foreach flag: error_cflags
+	if cc.has_argument(flag)
+		c_args += flag
+	endif
+endforeach
+
+base_lib = static_library('e1000_base', sources,
+	dependencies: rte_eal,
+	c_args: c_args)
+base_objs = base_lib.extract_all_objects()
diff --git a/drivers/net/e1000/meson.build b/drivers/net/e1000/meson.build
new file mode 100644
index 000000000..1775e1ba0
--- /dev/null
+++ b/drivers/net/e1000/meson.build
@@ -0,0 +1,44 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation.
+#   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('base')
+objs = [base_objs]
+
+sources = files(
+	'em_ethdev.c',
+	'em_rxtx.c',
+	'igb_ethdev.c',
+	'igb_flow.c',
+	'igb_pf.c',
+	'igb_rxtx.c'
+)
+
+includes += include_directories('base')
diff --git a/drivers/net/fm10k/base/meson.build b/drivers/net/fm10k/base/meson.build
new file mode 100644
index 000000000..e351f96da
--- /dev/null
+++ b/drivers/net/fm10k/base/meson.build
@@ -0,0 +1,55 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation.
+#   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 = [
+	'fm10k_api.c',
+	'fm10k_common.c',
+	'fm10k_mbx.c',
+	'fm10k_pf.c',
+	'fm10k_tlv.c',
+	'fm10k_vf.c'
+]
+
+error_cflags = ['-Wno-unused-parameter', '-Wno-unused-value',
+	'-Wno-strict-aliasing', '-Wno-format-extra-args',
+	'-Wno-unused-variable', '-Wno-missing-field-initializers'
+]
+c_args = cflags
+foreach flag: error_cflags
+	if cc.has_argument(flag)
+		c_args += flag
+	endif
+endforeach
+
+base_lib = static_library('fm10k_base', sources,
+	dependencies: rte_eal,
+	c_args: c_args)
+base_objs = base_lib.extract_all_objects()
diff --git a/drivers/net/fm10k/meson.build b/drivers/net/fm10k/meson.build
new file mode 100644
index 000000000..ebfdd1fb9
--- /dev/null
+++ b/drivers/net/fm10k/meson.build
@@ -0,0 +1,44 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation.
+#   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('base')
+objs = [base_objs]
+
+sources = files(
+	'fm10k_ethdev.c',
+	'fm10k_rxtx.c',
+)
+if arch_subdir == 'x86'
+	dpdk_conf.set('RTE_LIBRTE_FM10K_INC_VECTOR', 1)
+	sources += files('fm10k_rxtx_vec.c')
+endif
+
+includes += include_directories('base')
diff --git a/drivers/net/i40e/base/meson.build b/drivers/net/i40e/base/meson.build
new file mode 100644
index 000000000..2eae30fc7
--- /dev/null
+++ b/drivers/net/i40e/base/meson.build
@@ -0,0 +1,56 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation.
+#   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 = [
+	'i40e_adminq.c',
+	'i40e_common.c',
+	'i40e_dcb.c',
+	'i40e_diag.c',
+	'i40e_hmc.c',
+	'i40e_lan_hmc.c',
+	'i40e_nvm.c'
+]
+
+error_cflags = ['-Wno-sign-compare', '-Wno-unused-value',
+		'-Wno-format', '-Wno-unused-but-set-variable',
+		'-Wno-strict-aliasing'
+]
+c_args = cflags
+foreach flag: error_cflags
+	if cc.has_argument(flag)
+		c_args += flag
+	endif
+endforeach
+
+base_lib = static_library('i40e_base', sources,
+	dependencies: rte_eal,
+	c_args: c_args)
+base_objs = base_lib.extract_all_objects()
diff --git a/drivers/net/i40e/meson.build b/drivers/net/i40e/meson.build
new file mode 100644
index 000000000..dc5e59d19
--- /dev/null
+++ b/drivers/net/i40e/meson.build
@@ -0,0 +1,60 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation.
+#   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.
+
+cflags = ['-DPF_DRIVER',
+	'-DVF_DRIVER',
+	'-DINTEGRATED_VF',
+	'-DX722_A0_SUPPORT']
+
+subdir('base')
+objs = [base_objs]
+
+sources = files(
+	'i40e_ethdev.c',
+	'i40e_rxtx.c',
+	'i40e_ethdev_vf.c',
+	'i40e_pf.c',
+	'i40e_fdir.c',
+	'i40e_flow.c',
+	'i40e_tm.c',
+	'rte_pmd_i40e.c'
+	)
+
+deps += ['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')
+
+install_headers('rte_pmd_i40e.h')
diff --git a/drivers/net/ixgbe/base/meson.build b/drivers/net/ixgbe/base/meson.build
new file mode 100644
index 000000000..5a3d73311
--- /dev/null
+++ b/drivers/net/ixgbe/base/meson.build
@@ -0,0 +1,60 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation.
+#   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)
+base_objs = base_lib.extract_all_objects()
diff --git a/drivers/net/ixgbe/meson.build b/drivers/net/ixgbe/meson.build
new file mode 100644
index 000000000..8de42d56d
--- /dev/null
+++ b/drivers/net/ixgbe/meson.build
@@ -0,0 +1,58 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation.
+#   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.
+
+cflags = ['-DRTE_LIBRTE_IXGBE_BYPASS']
+
+subdir('base')
+objs = [base_objs]
+
+sources = files(
+	'ixgbe_82599_bypass.c',
+	'ixgbe_bypass.c',
+	'ixgbe_ethdev.c',
+	'ixgbe_fdir.c',
+	'ixgbe_flow.c',
+	'ixgbe_pf.c',
+	'ixgbe_rxtx.c',
+	'ixgbe_tm.c',
+	'rte_pmd_ixgbe.c'
+)
+
+deps += ['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')
+
+install_headers('rte_pmd_ixgbe.h')
diff --git a/drivers/net/meson.build b/drivers/net/meson.build
index 9a24bae43..d07b38b19 100644
--- a/drivers/net/meson.build
+++ b/drivers/net/meson.build
@@ -29,7 +29,8 @@
 #   (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 = ['af_packet', 'null', 'pcap', 'ring']
+drivers = ['af_packet', 'e1000', 'fm10k', 'i40e', 'ixgbe',
+	'null', 'pcap', 'ring']
 std_deps = ['ethdev', 'kvargs'] # 'ethdev' also pulls in mbuf, net, eal etc
 config_flag_fmt = 'RTE_LIBRTE_@0@_PMD'
 driver_name_fmt = 'rte_pmd_@0@'
-- 
2.13.5

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

* [PATCH v2 14/17] app/test-pmd: add test-pmd to meson build
  2017-09-12 10:37 ` [PATCH v2 " Bruce Richardson
                     ` (12 preceding siblings ...)
  2017-09-12 10:38   ` [PATCH v2 13/17] drivers/net: add drivers for Intel NICs to meson build Bruce Richardson
@ 2017-09-12 10:38   ` Bruce Richardson
  2017-09-12 10:38   ` [PATCH v2 15/17] usertools: add usertools installation " Bruce Richardson
                     ` (4 subsequent siblings)
  18 siblings, 0 replies; 107+ messages in thread
From: Bruce Richardson @ 2017-09-12 10:38 UTC (permalink / raw)
  To: dev; +Cc: nhorman, luca.boccassi, harry.van.haaren, Bruce Richardson

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Harry van Haaren <harry.van.haaren@intel.com>
---
 app/meson.build          | 32 +++++++++++++++++++++
 app/test-pmd/meson.build | 74 ++++++++++++++++++++++++++++++++++++++++++++++++
 meson.build              |  3 +-
 3 files changed, 108 insertions(+), 1 deletion(-)
 create mode 100644 app/meson.build
 create mode 100644 app/test-pmd/meson.build

diff --git a/app/meson.build b/app/meson.build
new file mode 100644
index 000000000..da8b631f4
--- /dev/null
+++ b/app/meson.build
@@ -0,0 +1,32 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation.
+#   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')
diff --git a/app/test-pmd/meson.build b/app/test-pmd/meson.build
new file mode 100644
index 000000000..a374771bf
--- /dev/null
+++ b/app/test-pmd/meson.build
@@ -0,0 +1,74 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation.
+#   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('cmdline.c',
+	'cmdline_flow.c',
+	'config.c',
+	'csumonly.c',
+	'flowgen.c',
+	'icmpecho.c',
+	'ieee1588fwd.c',
+	'iofwd.c',
+	'macfwd.c',
+	'macswap.c',
+	'parameters.c',
+	'rxonly.c',
+	'testpmd.c',
+	'txonly.c')
+
+deps = ['ethdev', 'gro', 'cmdline', 'metrics']
+if dpdk_conf.has('RTE_LIBRTE_PDUMP')
+	deps += 'pdump'
+endif
+if dpdk_conf.has('RTE_LIBRTE_I40E_PMD')
+	deps += 'pmd_i40e'
+endif
+if dpdk_conf.has('RTE_LIBRTE_IXGBE_PMD')
+	deps += 'pmd_ixgbe'
+endif
+
+dep_objs = []
+foreach d:deps
+	dep_objs += get_variable('dep_rte_' + d)
+endforeach
+
+link_libs = []
+if get_option('default_library') == 'static'
+	link_libs = dpdk_drivers
+endif
+
+executable('dpdk-testpmd',
+	sources,
+	link_whole: link_libs,
+	dependencies: dep_objs,
+	link_args: eal_extra_link_arg, # add -ldl for linux, -lexecinfo for BSD
+	install_rpath: driver_install_path,
+	install: true)
diff --git a/meson.build b/meson.build
index a7feb7069..098d97cd3 100644
--- a/meson.build
+++ b/meson.build
@@ -62,7 +62,8 @@ subdir('lib')
 subdir('buildtools')
 subdir('drivers')
 
-# TODO build binaries and installable tools
+# build binaries and (TODO) installable tools
+subdir('app')
 
 # write the build config
 build_cfg = 'rte_build_config.h'
-- 
2.13.5

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

* [PATCH v2 15/17] usertools: add usertools installation to meson build
  2017-09-12 10:37 ` [PATCH v2 " Bruce Richardson
                     ` (13 preceding siblings ...)
  2017-09-12 10:38   ` [PATCH v2 14/17] app/test-pmd: add test-pmd " Bruce Richardson
@ 2017-09-12 10:38   ` Bruce Richardson
  2017-09-12 10:38   ` [PATCH v2 16/17] build: add option to version libs using DPDK version Bruce Richardson
                     ` (3 subsequent siblings)
  18 siblings, 0 replies; 107+ messages in thread
From: Bruce Richardson @ 2017-09-12 10:38 UTC (permalink / raw)
  To: dev; +Cc: nhorman, luca.boccassi, harry.van.haaren, Bruce Richardson

Have the "usertools" scripts installed when doing a DPDK install using
ninja. They will be copies to $prefix/bin, generally /usr/local/bin,
alongside testpmd.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Harry van Haaren <harry.van.haaren@intel.com>
---
 meson.build           |  3 ++-
 usertools/meson.build | 32 ++++++++++++++++++++++++++++++++
 2 files changed, 34 insertions(+), 1 deletion(-)
 create mode 100644 usertools/meson.build

diff --git a/meson.build b/meson.build
index 098d97cd3..9e4e9e809 100644
--- a/meson.build
+++ b/meson.build
@@ -62,7 +62,8 @@ subdir('lib')
 subdir('buildtools')
 subdir('drivers')
 
-# build binaries and (TODO) installable tools
+# build binaries and installable tools
+subdir('usertools')
 subdir('app')
 
 # write the build config
diff --git a/usertools/meson.build b/usertools/meson.build
new file mode 100644
index 000000000..c5452e3fc
--- /dev/null
+++ b/usertools/meson.build
@@ -0,0 +1,32 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation.
+#   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')
-- 
2.13.5

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

* [PATCH v2 16/17] build: add option to version libs using DPDK version
  2017-09-12 10:37 ` [PATCH v2 " Bruce Richardson
                     ` (14 preceding siblings ...)
  2017-09-12 10:38   ` [PATCH v2 15/17] usertools: add usertools installation " Bruce Richardson
@ 2017-09-12 10:38   ` Bruce Richardson
  2017-09-13 11:32     ` Luca Boccassi
  2017-09-12 10:38   ` [PATCH v2 17/17] doc: add documentation on how to add new components to DPDK Bruce Richardson
                     ` (2 subsequent siblings)
  18 siblings, 1 reply; 107+ messages in thread
From: Bruce Richardson @ 2017-09-12 10:38 UTC (permalink / raw)
  To: dev; +Cc: nhorman, luca.boccassi, harry.van.haaren, Bruce Richardson

Normally, each library has it's own version number based on the ABI.
Add an option to have all libs just use the DPDK version number as the
.so version.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Harry van Haaren <harry.van.haaren@intel.com>
---
 drivers/meson.build | 8 +++++++-
 lib/meson.build     | 8 +++++++-
 meson_options.txt   | 1 +
 3 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/drivers/meson.build b/drivers/meson.build
index f19da16fb..0c251bd61 100644
--- a/drivers/meson.build
+++ b/drivers/meson.build
@@ -92,6 +92,12 @@ foreach class:driver_classes
 						depends: [pmdinfogen, tmp_lib])
 			endforeach
 
+			if get_option('per_library_versions')
+				so_version = '@0@.1'.format(version)
+			else
+				so_version = meson.project_version()
+			endif
+
 			# now build the driver itself, and add to the drivers list
 			lib_name = driver_name_fmt.format(name)
 			version_map = '@0@/@1@/@2@_version.map'.format(
@@ -105,7 +111,7 @@ foreach class:driver_classes
 				c_args: cflags,
 				link_args: '-Wl,--version-script=' + version_map,
 				link_depends: version_map,
-				version: '@0@.1'.format(version),
+				version: so_version,
 				install: true,
 				install_dir: driver_install_path)
 
diff --git a/lib/meson.build b/lib/meson.build
index d814721de..36652cfe1 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -76,6 +76,12 @@ foreach l:libraries
 			dep_objs += [get_variable('dep_rte_' + d)]
 		endforeach
 
+		if get_option('per_library_versions')
+			so_version = '@0@.1'.format(version)
+		else
+			so_version = meson.project_version()
+		endif
+
 		version_map = '@0@/@1@/rte_@2@_version.map'.format(
 				meson.current_source_dir(), dir_name, name)
 		libname = 'rte_' + name
@@ -87,7 +93,7 @@ foreach l:libraries
 				include_directories: include_directories(dir_name),
 				link_args: '-Wl,--version-script=' + version_map,
 				link_depends: version_map,
-				version: '@0@.1'.format(version),
+				version: so_version,
 				install: true)
 		dep = declare_dependency(link_with: lib,
 				include_directories: include_directories(dir_name),
diff --git a/meson_options.txt b/meson_options.txt
index 9c45b8159..636226ce8 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -6,3 +6,4 @@ 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')
 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')
+option('per_library_versions', type: 'boolean', value: true, description: 'true: each lib gets its own version number, false: DPDK version used for each lib')
-- 
2.13.5

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

* [PATCH v2 17/17] doc: add documentation on how to add new components to DPDK
  2017-09-12 10:37 ` [PATCH v2 " Bruce Richardson
                     ` (15 preceding siblings ...)
  2017-09-12 10:38   ` [PATCH v2 16/17] build: add option to version libs using DPDK version Bruce Richardson
@ 2017-09-12 10:38   ` Bruce Richardson
  2017-09-12 13:21   ` [PATCH v2 00/17] build DPDK libs and some drivers with meson/ninja Wiles, Keith
  2017-09-13 14:12   ` [PATCH v3 " Bruce Richardson
  18 siblings, 0 replies; 107+ messages in thread
From: Bruce Richardson @ 2017-09-12 10:38 UTC (permalink / raw)
  To: dev; +Cc: nhorman, luca.boccassi, harry.van.haaren, Bruce Richardson

Add to the contributors guide details on how to add libraries and drivers
and integrate them with the DPDK build system(s).

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Harry van Haaren <harry.van.haaren@intel.com>
---
 doc/guides/contributing/coding_style.rst | 214 +++++++++++++++++++++++++++++++
 1 file changed, 214 insertions(+)

diff --git a/doc/guides/contributing/coding_style.rst b/doc/guides/contributing/coding_style.rst
index d8e4a0f9c..3c59cbca5 100644
--- a/doc/guides/contributing/coding_style.rst
+++ b/doc/guides/contributing/coding_style.rst
@@ -702,3 +702,217 @@ All Python code should work with Python 2.7+ and 3.2+ and be compliant with
 `PEP8 (Style Guide for Python Code) <https://www.python.org/dev/peps/pep-0008/>`_.
 
 The ``pep8`` tool can be used for testing compliance with the guidelines.
+
+Integrating with the Build System
+---------------------------------
+
+DPDK supports being built in two different ways:
+
+* using ``make`` - or more specifically "GNU make", i.e. ``gmake`` on FreeBSD
+* using the tools ``meson`` and ``ninja``
+
+Any new library or driver to be integrated into DPDK should support being
+built with both systems. While building using ``make`` is a legacy approach, and
+most build-system enhancements are being done using ``meson`` and ``ninja``
+there are no plans at this time to deprecate the legacy ``make`` build system.
+
+Therefore all new component additions should include both a ``Makefile`` and a
+``meson.build`` file, and should be added to the component lists in both the
+``Makefile`` and ``meson.build`` files in the relevant top-level directory:
+either ``lib`` directory or a ``driver`` subdirectory.
+
+Makefile Contents
+~~~~~~~~~~~~~~~~~
+
+The ``Makefile`` for the component should be of the following format, where
+``<name>`` corresponds to the name of the library in question, e.g. hash,
+lpm, etc. For drivers, the same format of Makefile is used.
+
+.. code-block:: makefile
+
+	# pull in basic DPDK definitions, including whether library is to be
+	# built or not
+	include $(RTE_SDK)/mk/rte.vars.mk
+
+	# library name
+	LIB = librte_<name>.a
+
+	# any library cflags needed. Generally add "-O3 $(WERROR_FLAGS)"
+	CFLAGS += -O3
+	CFLAGS += $(WERROR_FLAGS)
+
+	# the symbol version information for the library, and .so version
+	EXPORT_MAP := rte_<name>_version.map
+	LIBABIVER := 1
+
+	# all source filenames are stored in SRCS-y
+	SRCS-$(CONFIG_RTE_LIBRTE_<NAME>) += rte_<name>.c
+
+	# install includes
+	SYMLINK-$(CONFIG_RTE_LIBRTE_<NAME>)-include += rte_<name>.h
+
+	# pull in rules to build the library
+	include $(RTE_SDK)/mk/rte.lib.mk
+
+Meson Build File Contents - Libraries
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+The ``meson.build`` file for a new DPDK library should be of the following basic
+format.
+
+.. code-block:: python
+
+	sources = files('file1.c', ...)
+	headers = files('file1.c', ...)
+
+
+The will build based on a number of conventions and assumptions within the DPDK
+itself, for example, that the library name is the same as the directory name in
+which the files are stored.
+
+For a library ``meson.build`` file, there are number of variables which can be
+set, some mandatory, others optional. The mandatory fields are:
+
+sources
+	**Default Value = []**.
+	This variable should list out the files to be compiled up to create the
+	library. Files must be specified using the meson ``files()`` function.
+
+
+The optional fields are:
+
+build
+	**Default Value = true.**
+	Used to optionally compile a library, based on its dependencies or
+	environment. A simple example of use would be:
+
+.. code-block:: python
+
+	if host_machine.system() != 'linux'
+	        build = false
+	endif
+
+
+cflags
+	**Default Value = []**.
+	Used to specify any additional cflags that need to be passed to compile
+	the sources in the library.
+
+deps
+	**Default Value = ['eal']**.
+	Used to list the internal library dependencies of the library. It should
+	be assigned to using ``+=`` rather than overwriting using ``=``.  The
+	dependencies should be specified as strings, each one giving the name of
+	a DPDK library, without the ``librte_`` prefix. Dependencies are handled
+	recursively, so specifying e.g. ``mempool``, will automatically also
+	make the library depend upon the mempool library's dependencies too -
+	``ring`` and ``eal``. For libraries that only depend upon EAL, this
+	variable may be omitted from the ``meson.build`` file.  For example:
+
+.. code-block:: python
+
+	deps += ['ethdev']
+
+
+ext_deps
+	**Default Value = []**.
+	Used to specify external dependencies of this library. They should be
+	returned as dependency objects, as returned from the meson
+	``dependency()`` or ``find_library()`` functions. Before returning
+	these, they should be checked to ensure the dependencies have been
+	found, and, if not, the ``build`` variable should be set to ``false``.
+	For example:
+
+.. code-block:: python
+
+	my_dep = dependency('libX', required: 'false')
+	if my_dep.found()
+		ext_deps += my_dep
+	else
+		build = false
+	endif
+
+
+headers
+	**Default Value = []**.
+	Used to return the list of header files for the library that should be
+	installed to $PREFIX/include when ``ninja install`` is run. As with
+	source files, these should be specified using the meson ``files()``
+	function.
+
+name
+	**Default Value = library name derived from the directory name**.
+	If a library's .so or .a file differs from that given in the directory
+	name, the name should be specified using this variable. In practice,
+	since the convention is that for a library called ``librte_xyz.so``, the
+	sources are stored in a directory ``lib/librte_xyz``, this value should
+	never be needed for new libraries.
+
+.. note::
+
+	The name value also provides the name used to find the function version
+	map file, as part of the build process, so if the directory name and
+	library names differ, the ``version.map`` file should be named
+	consistently with the library, not the directory
+
+objs
+	**Default Value = []**.
+	This variable can be used to pass to the library build some pre-built
+	objects that were compiled up as part of another target given in the
+	included library ``meson.build`` file.
+
+version
+	**Default Value = 1**.
+	Specifies the ABI version of the library, and is used as the major
+	version number of the resulting ``.so`` library.
+
+Meson Build File Contents - Drivers
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+For drivers, the values are largely the same as for libraries. The variables
+supported are:
+
+build
+	As above.
+
+cflags
+	As above.
+
+deps
+	As above.
+
+ext_deps
+	As above.
+
+includes
+	**Default Value = <driver directory>** Some drivers include a base
+	directory for additional source files and headers, so we have this
+	variable to allow the headers from that base directory to be found when
+	compiling driver sources. Should be appended to using ``+=`` rather than
+	overwritten using ``=``.  The values appended should be meson include
+	objects got using the ``include_directories()`` function. For example:
+
+.. code-block:: python
+
+	includes += include_directories('base')
+
+name
+	As above, though note that each driver class can define it's own naming
+	scheme for the resulting ``.so`` files.
+
+objs
+	As above, generally used for the contents of the ``base`` directory.
+
+pkgconfig_extra_libs
+	**Default Value = []**
+	This variable is used to pass additional library link flags through to
+	the DPDK pkgconfig file generated, for example, to track any additional
+	libraries that may need to be linked into the build - especially when
+	using static libraries. Anything added here will be appended to the end
+	of the ``pkgconfig --libs`` output.
+
+sources [mandatory]
+	As above
+
+version
+	As above
-- 
2.13.5

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

* Re: [PATCH v2 00/17] build DPDK libs and some drivers with meson/ninja
  2017-09-12 10:37 ` [PATCH v2 " Bruce Richardson
                     ` (16 preceding siblings ...)
  2017-09-12 10:38   ` [PATCH v2 17/17] doc: add documentation on how to add new components to DPDK Bruce Richardson
@ 2017-09-12 13:21   ` Wiles, Keith
  2017-09-12 13:24     ` Bruce Richardson
  2017-09-13 14:12   ` [PATCH v3 " Bruce Richardson
  18 siblings, 1 reply; 107+ messages in thread
From: Wiles, Keith @ 2017-09-12 13:21 UTC (permalink / raw)
  To: Richardson, Bruce; +Cc: dev, nhorman, luca.boccassi, Van Haaren, Harry


> On Sep 12, 2017, at 5:37 AM, Bruce Richardson <bruce.richardson@intel.com> wrote:
> 
> V2 changes:
> * fixed copyright notices, updated 2016 to 2017
> * removed dependency on kconfig file in kernel build tree
> * marked pmdinfogen as a "native" binary, in preparation for future cross-
>  compilation work
> * added in additional warning flags for compatibility with existing system
> ——


> Once reviewed and tested a bit, I hope to apply this set - or a new
> revision of it - to the build-next tree, to serve as a baseline for others
> to use and to add the missing functionality to.

I would really like to see these patches in a build-next tree as it is much easier to work with and help with changes then patches on the master.

When can we have a build-next tree created?

> 
> Regards,
> /Bruce

Regards,
Keith


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

* Re: [PATCH v2 00/17] build DPDK libs and some drivers with meson/ninja
  2017-09-12 13:21   ` [PATCH v2 00/17] build DPDK libs and some drivers with meson/ninja Wiles, Keith
@ 2017-09-12 13:24     ` Bruce Richardson
  2017-09-12 13:26       ` Wiles, Keith
  0 siblings, 1 reply; 107+ messages in thread
From: Bruce Richardson @ 2017-09-12 13:24 UTC (permalink / raw)
  To: Wiles, Keith; +Cc: dev, nhorman, luca.boccassi, Van Haaren, Harry

On Tue, Sep 12, 2017 at 02:21:22PM +0100, Wiles, Keith wrote:
> 
> > On Sep 12, 2017, at 5:37 AM, Bruce Richardson <bruce.richardson@intel.com> wrote:
> > 
> > V2 changes:
> > * fixed copyright notices, updated 2016 to 2017
> > * removed dependency on kconfig file in kernel build tree
> > * marked pmdinfogen as a "native" binary, in preparation for future cross-
> >  compilation work
> > * added in additional warning flags for compatibility with existing system
> > ——
> 
> 
> > Once reviewed and tested a bit, I hope to apply this set - or a new
> > revision of it - to the build-next tree, to serve as a baseline for others
> > to use and to add the missing functionality to.
> 
> I would really like to see these patches in a build-next tree as it is much easier to work with and help with changes then patches on the master.
> 
> When can we have a build-next tree created?
> 
Tree already exists. I'm just waiting on a bit more review and ideally
an ack before I apply this set there.

http://dpdk.org/browse/draft/dpdk-next-build/

/Bruce

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

* Re: [PATCH v2 00/17] build DPDK libs and some drivers with meson/ninja
  2017-09-12 13:24     ` Bruce Richardson
@ 2017-09-12 13:26       ` Wiles, Keith
  2017-09-12 14:00         ` Wiles, Keith
  2017-09-12 19:19         ` Neil Horman
  0 siblings, 2 replies; 107+ messages in thread
From: Wiles, Keith @ 2017-09-12 13:26 UTC (permalink / raw)
  To: Richardson, Bruce; +Cc: dev, nhorman, luca.boccassi, Van Haaren, Harry


> On Sep 12, 2017, at 8:24 AM, Richardson, Bruce <bruce.richardson@intel.com> wrote:
> 
> On Tue, Sep 12, 2017 at 02:21:22PM +0100, Wiles, Keith wrote:
>> 
>>> On Sep 12, 2017, at 5:37 AM, Bruce Richardson <bruce.richardson@intel.com> wrote:
>>> 
>>> V2 changes:
>>> * fixed copyright notices, updated 2016 to 2017
>>> * removed dependency on kconfig file in kernel build tree
>>> * marked pmdinfogen as a "native" binary, in preparation for future cross-
>>> compilation work
>>> * added in additional warning flags for compatibility with existing system
>>> ——
>> 
>> 
>>> Once reviewed and tested a bit, I hope to apply this set - or a new
>>> revision of it - to the build-next tree, to serve as a baseline for others
>>> to use and to add the missing functionality to.
>> 
>> I would really like to see these patches in a build-next tree as it is much easier to work with and help with changes then patches on the master.
>> 
>> When can we have a build-next tree created?
>> 
> Tree already exists. I'm just waiting on a bit more review and ideally
> an ack before I apply this set there.

Not sure what you are waiting for as an ack is not going to make much of a difference IMO :-)

> 
> http://dpdk.org/browse/draft/dpdk-next-build/
> 
> /Bruce

Regards,
Keith


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

* Re: [PATCH v2 00/17] build DPDK libs and some drivers with meson/ninja
  2017-09-12 13:26       ` Wiles, Keith
@ 2017-09-12 14:00         ` Wiles, Keith
  2017-09-12 15:46           ` Bruce Richardson
  2017-09-12 19:19         ` Neil Horman
  1 sibling, 1 reply; 107+ messages in thread
From: Wiles, Keith @ 2017-09-12 14:00 UTC (permalink / raw)
  To: Richardson, Bruce; +Cc: dev, nhorman, luca.boccassi, Van Haaren, Harry


> On Sep 12, 2017, at 8:26 AM, Wiles, Keith <keith.wiles@intel.com> wrote:
> 
>> 
>> On Sep 12, 2017, at 8:24 AM, Richardson, Bruce <bruce.richardson@intel.com> wrote:
>> 
>> On Tue, Sep 12, 2017 at 02:21:22PM +0100, Wiles, Keith wrote:
>>> 
>>>> On Sep 12, 2017, at 5:37 AM, Bruce Richardson <bruce.richardson@intel.com> wrote:
>>>> 
>>>> V2 changes:
>>>> * fixed copyright notices, updated 2016 to 2017
>>>> * removed dependency on kconfig file in kernel build tree
>>>> * marked pmdinfogen as a "native" binary, in preparation for future cross-
>>>> compilation work
>>>> * added in additional warning flags for compatibility with existing system
>>>> ——
>>> 
>>> 
>>>> Once reviewed and tested a bit, I hope to apply this set - or a new
>>>> revision of it - to the build-next tree, to serve as a baseline for others
>>>> to use and to add the missing functionality to.
>>> 
>>> I would really like to see these patches in a build-next tree as it is much easier to work with and help with changes then patches on the master.
>>> 
>>> When can we have a build-next tree created?
>>> 
>> Tree already exists. I'm just waiting on a bit more review and ideally
>> an ack before I apply this set there.
> 
> Not sure what you are waiting for as an ack is not going to make much of a difference IMO :-)

I pulled down the dpdk-next-build tree and applied the patches, things work and build, but a number of compiler warns pop up. I think we can ack this one and I know a number of things need to be fixed.

So I am going to ack this patch set for the dpdk-next-build tree.

Acked-by: Keith Wiles <keith.wiles@intel.com>

> 
>> 
>> http://dpdk.org/browse/draft/dpdk-next-build/
>> 
>> /Bruce
> 
> Regards,
> Keith

Regards,
Keith


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

* Re: [PATCH v2 00/17] build DPDK libs and some drivers with meson/ninja
  2017-09-12 14:00         ` Wiles, Keith
@ 2017-09-12 15:46           ` Bruce Richardson
  0 siblings, 0 replies; 107+ messages in thread
From: Bruce Richardson @ 2017-09-12 15:46 UTC (permalink / raw)
  To: Wiles, Keith; +Cc: dev, nhorman, luca.boccassi, Van Haaren, Harry

On Tue, Sep 12, 2017 at 03:00:13PM +0100, Wiles, Keith wrote:
> 
> > On Sep 12, 2017, at 8:26 AM, Wiles, Keith <keith.wiles@intel.com> wrote:
> > 
> >> 
> >> On Sep 12, 2017, at 8:24 AM, Richardson, Bruce <bruce.richardson@intel.com> wrote:
> >> 
> >> On Tue, Sep 12, 2017 at 02:21:22PM +0100, Wiles, Keith wrote:
> >>> 
> >>>> On Sep 12, 2017, at 5:37 AM, Bruce Richardson <bruce.richardson@intel.com> wrote:
> >>>> 
> >>>> V2 changes:
> >>>> * fixed copyright notices, updated 2016 to 2017
> >>>> * removed dependency on kconfig file in kernel build tree
> >>>> * marked pmdinfogen as a "native" binary, in preparation for future cross-
> >>>> compilation work
> >>>> * added in additional warning flags for compatibility with existing system
> >>>> ——
> >>> 
> >>> 
> >>>> Once reviewed and tested a bit, I hope to apply this set - or a new
> >>>> revision of it - to the build-next tree, to serve as a baseline for others
> >>>> to use and to add the missing functionality to.
> >>> 
> >>> I would really like to see these patches in a build-next tree as it is much easier to work with and help with changes then patches on the master.
> >>> 
> >>> When can we have a build-next tree created?
> >>> 
> >> Tree already exists. I'm just waiting on a bit more review and ideally
> >> an ack before I apply this set there.
> > 
> > Not sure what you are waiting for as an ack is not going to make much of a difference IMO :-)
> 
> I pulled down the dpdk-next-build tree and applied the patches, things work and build, but a number of compiler warns pop up. I think we can ack this one and I know a number of things need to be fixed.
> 
> So I am going to ack this patch set for the dpdk-next-build tree.
> 
> Acked-by: Keith Wiles <keith.wiles@intel.com>
>
Yep, compiler warnings should hopefully be fixed by these patches which
I submitted for inclusion in the main tree.

http://dpdk.org/dev/patchwork/patch/28457/
http://dpdk.org/dev/patchwork/patch/28458/

Regards,
/Bruce

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

* Re: [PATCH v2 00/17] build DPDK libs and some drivers with meson/ninja
  2017-09-12 13:26       ` Wiles, Keith
  2017-09-12 14:00         ` Wiles, Keith
@ 2017-09-12 19:19         ` Neil Horman
  2017-09-12 20:36           ` Wiles, Keith
  1 sibling, 1 reply; 107+ messages in thread
From: Neil Horman @ 2017-09-12 19:19 UTC (permalink / raw)
  To: Wiles, Keith; +Cc: Richardson, Bruce, dev, luca.boccassi, Van Haaren, Harry

On Tue, Sep 12, 2017 at 01:26:09PM +0000, Wiles, Keith wrote:
> 
> > On Sep 12, 2017, at 8:24 AM, Richardson, Bruce <bruce.richardson@intel.com> wrote:
> > 
> > On Tue, Sep 12, 2017 at 02:21:22PM +0100, Wiles, Keith wrote:
> >> 
> >>> On Sep 12, 2017, at 5:37 AM, Bruce Richardson <bruce.richardson@intel.com> wrote:
> >>> 
> >>> V2 changes:
> >>> * fixed copyright notices, updated 2016 to 2017
> >>> * removed dependency on kconfig file in kernel build tree
> >>> * marked pmdinfogen as a "native" binary, in preparation for future cross-
> >>> compilation work
> >>> * added in additional warning flags for compatibility with existing system
> >>> ——
> >> 
> >> 
> >>> Once reviewed and tested a bit, I hope to apply this set - or a new
> >>> revision of it - to the build-next tree, to serve as a baseline for others
> >>> to use and to add the missing functionality to.
> >> 
> >> I would really like to see these patches in a build-next tree as it is much easier to work with and help with changes then patches on the master.
> >> 
> >> When can we have a build-next tree created?
> >> 
> > Tree already exists. I'm just waiting on a bit more review and ideally
> > an ack before I apply this set there.
> 
> Not sure what you are waiting for as an ack is not going to make much of a difference IMO :-)
> 
Why would an ACK not make any difference?  Are you suggesting that using this is
a forgone conclusion?

Neil

> > 
> > http://dpdk.org/browse/draft/dpdk-next-build/
> > 
> > /Bruce
> 
> Regards,
> Keith
> 

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

* Re: [PATCH v2 00/17] build DPDK libs and some drivers with meson/ninja
  2017-09-12 19:19         ` Neil Horman
@ 2017-09-12 20:36           ` Wiles, Keith
  0 siblings, 0 replies; 107+ messages in thread
From: Wiles, Keith @ 2017-09-12 20:36 UTC (permalink / raw)
  To: Neil Horman; +Cc: Richardson, Bruce, dev, luca.boccassi, Van Haaren, Harry


> On Sep 12, 2017, at 2:19 PM, Neil Horman <nhorman@tuxdriver.com> wrote:
> 
> On Tue, Sep 12, 2017 at 01:26:09PM +0000, Wiles, Keith wrote:
>> 
>>> On Sep 12, 2017, at 8:24 AM, Richardson, Bruce <bruce.richardson@intel.com> wrote:
>>> 
>>> On Tue, Sep 12, 2017 at 02:21:22PM +0100, Wiles, Keith wrote:
>>>> 
>>>>> On Sep 12, 2017, at 5:37 AM, Bruce Richardson <bruce.richardson@intel.com> wrote:
>>>>> 
>>>>> V2 changes:
>>>>> * fixed copyright notices, updated 2016 to 2017
>>>>> * removed dependency on kconfig file in kernel build tree
>>>>> * marked pmdinfogen as a "native" binary, in preparation for future cross-
>>>>> compilation work
>>>>> * added in additional warning flags for compatibility with existing system
>>>>> ——
>>>> 
>>>> 
>>>>> Once reviewed and tested a bit, I hope to apply this set - or a new
>>>>> revision of it - to the build-next tree, to serve as a baseline for others
>>>>> to use and to add the missing functionality to.
>>>> 
>>>> I would really like to see these patches in a build-next tree as it is much easier to work with and help with changes then patches on the master.
>>>> 
>>>> When can we have a build-next tree created?
>>>> 
>>> Tree already exists. I'm just waiting on a bit more review and ideally
>>> an ack before I apply this set there.
>> 
>> Not sure what you are waiting for as an ack is not going to make much of a difference IMO :-)
>> 
> Why would an ACK not make any difference?  Are you suggesting that using this is
> a forgone conclusion?

No, moving this patch to the dpdk-next-build repo is all I am saying. The patch and ack here is not for the master repo only the next-build repo and a pull request from the next-build repo still needs to be approved at some point for the master.

> 
> Neil
> 
>>> 
>>> http://dpdk.org/browse/draft/dpdk-next-build/
>>> 
>>> /Bruce
>> 
>> Regards,
>> Keith

Regards,
Keith


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

* Re: [PATCH v2 16/17] build: add option to version libs using DPDK version
  2017-09-12 10:38   ` [PATCH v2 16/17] build: add option to version libs using DPDK version Bruce Richardson
@ 2017-09-13 11:32     ` Luca Boccassi
  2017-09-13 13:11       ` Bruce Richardson
  0 siblings, 1 reply; 107+ messages in thread
From: Luca Boccassi @ 2017-09-13 11:32 UTC (permalink / raw)
  To: Bruce Richardson, dev; +Cc: nhorman, harry.van.haaren, Christian Ehrhardt

On Tue, 2017-09-12 at 11:38 +0100, Bruce Richardson wrote:
> Normally, each library has it's own version number based on the ABI.
> Add an option to have all libs just use the DPDK version number as
> the
> .so version.
> 
> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> Reviewed-by: Harry van Haaren <harry.van.haaren@intel.com>
> ---
>  drivers/meson.build | 8 +++++++-
>  lib/meson.build     | 8 +++++++-
>  meson_options.txt   | 1 +
>  3 files changed, 15 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/meson.build b/drivers/meson.build
> index f19da16fb..0c251bd61 100644
> --- a/drivers/meson.build
> +++ b/drivers/meson.build
> @@ -92,6 +92,12 @@ foreach class:driver_classes
>  						depends:
> [pmdinfogen, tmp_lib])
>  			endforeach
>  
> +			if get_option('per_library_versions')
> +				so_version = '@0@.1'.format(version)
> +			else
> +				so_version = meson.project_version()
> +			endif
> +
>  			# now build the driver itself, and add to
> the drivers list
>  			lib_name = driver_name_fmt.format(name)
>  			version_map = '@0@/@1@/@2@_version.map'.form
> at(
> @@ -105,7 +111,7 @@ foreach class:driver_classes
>  				c_args: cflags,
>  				link_args: '-Wl,--version-script=' +
> version_map,
>  				link_depends: version_map,
> -				version: '@0@.1'.format(version),
> +				version: so_version,
>  				install: true,
>  				install_dir: driver_install_path)
>  
> diff --git a/lib/meson.build b/lib/meson.build
> index d814721de..36652cfe1 100644
> --- a/lib/meson.build
> +++ b/lib/meson.build
> @@ -76,6 +76,12 @@ foreach l:libraries
>  			dep_objs += [get_variable('dep_rte_' + d)]
>  		endforeach
>  
> +		if get_option('per_library_versions')
> +			so_version = '@0@.1'.format(version)
> +		else
> +			so_version = meson.project_version()
> +		endif
> +
>  		version_map = '@0@/@1@/rte_@2@_version.map'.format(
>  				meson.current_source_dir(),
> dir_name, name)
>  		libname = 'rte_' + name
> @@ -87,7 +93,7 @@ foreach l:libraries
>  				include_directories:
> include_directories(dir_name),
>  				link_args: '-Wl,--version-script=' +
> version_map,
>  				link_depends: version_map,
> -				version: '@0@.1'.format(version),
> +				version: so_version,
>  				install: true)
>  		dep = declare_dependency(link_with: lib,
>  				include_directories:
> include_directories(dir_name),
> diff --git a/meson_options.txt b/meson_options.txt
> index 9c45b8159..636226ce8 100644
> --- a/meson_options.txt
> +++ b/meson_options.txt
> @@ -6,3 +6,4 @@ 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')
>  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')
> +option('per_library_versions', type: 'boolean', value: true,
> description: 'true: each lib gets its own version number, false: DPDK
> version used for each lib')

Hi Bruce,

First of all thanks for implementing this option, and sorry for the
delay.

A couple of minor things:

1) The project version has 3 digits, but the ABI version should have 2
- eg: should be 17.08 but right now it's 17.08.0 - given point releases
will be ABI compatible so they must not change the ABI version. In the
packaging code we use cut to chop it off:

DPDK_ABI := $(shell echo $(DEB_VERSION_UPSTREAM) | cut -d '.'  -f1-2)

Not sure how to achieve the same in a Meson script though (can it shell
out? or are there string manipulation built-ins?), sorry - just
starting to look at it.

Right now the rte_config option allows the user to completely override
the version - I'm fine with having a single boolean provided this
change is applied, it simplifies packaging a bit, but if it's easier
for you to just accepted a version instead of a boolean it's fine as
well, as you prefer

2) When the option is true, it should not generate a symlink with the
ABI "revision", as the first digit is really not the revision, so it
does not make much sense. Worse, it will stop 2 versions being co-
installable (which was the whole point :-) ), as, eg, 17.02, 17.05 and
17.08 will all ship a libfoo.so.17 symlink. I can fix it in the
packaging, but I don't think it should be generated upstream at all
when this option is enabled.

IOW, the following is the current result:

$ ls -l debian/librte-ethdev17.08/usr/lib/x86_64-linux-gnu/
total 72
lrwxrwxrwx 1 lboccass lboccass    24 Sep 13 11:50 librte_ethdev.so.17 -> librte_ethdev.so.17.08.0
-rw-r--r-- 1 lboccass lboccass 71672 Sep 13 11:50 librte_ethdev.so.17.08.0

The expected result would be to create a single file "librte_ethdev.so.17.08" instead.

-- 
Kind regards,
Luca Boccassi

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

* Re: [PATCH v2 16/17] build: add option to version libs using DPDK version
  2017-09-13 11:32     ` Luca Boccassi
@ 2017-09-13 13:11       ` Bruce Richardson
  2017-09-13 17:02         ` Luca Boccassi
  0 siblings, 1 reply; 107+ messages in thread
From: Bruce Richardson @ 2017-09-13 13:11 UTC (permalink / raw)
  To: Luca Boccassi; +Cc: dev, nhorman, harry.van.haaren, Christian Ehrhardt

On Wed, Sep 13, 2017 at 12:32:24PM +0100, Luca Boccassi wrote:
> On Tue, 2017-09-12 at 11:38 +0100, Bruce Richardson wrote:
> > Normally, each library has it's own version number based on the ABI.
> > Add an option to have all libs just use the DPDK version number as
> > the
> > .so version.
> > 
> > Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> > Reviewed-by: Harry van Haaren <harry.van.haaren@intel.com>
> > ---
> >  drivers/meson.build | 8 +++++++-
> >  lib/meson.build     | 8 +++++++-
> >  meson_options.txt   | 1 +
> >  3 files changed, 15 insertions(+), 2 deletions(-)
> > 
> > diff --git a/drivers/meson.build b/drivers/meson.build
> > index f19da16fb..0c251bd61 100644
> > --- a/drivers/meson.build
> > +++ b/drivers/meson.build
> > @@ -92,6 +92,12 @@ foreach class:driver_classes
> >  						depends:
> > [pmdinfogen, tmp_lib])
> >  			endforeach
> >  
> > +			if get_option('per_library_versions')
> > +				so_version = '@0@.1'.format(version)
> > +			else
> > +				so_version = meson.project_version()
> > +			endif
> > +
> >  			# now build the driver itself, and add to
> > the drivers list
> >  			lib_name = driver_name_fmt.format(name)
> >  			version_map = '@0@/@1@/@2@_version.map'.form
> > at(
> > @@ -105,7 +111,7 @@ foreach class:driver_classes
> >  				c_args: cflags,
> >  				link_args: '-Wl,--version-script=' +
> > version_map,
> >  				link_depends: version_map,
> > -				version: '@0@.1'.format(version),
> > +				version: so_version,
> >  				install: true,
> >  				install_dir: driver_install_path)
> >  
> > diff --git a/lib/meson.build b/lib/meson.build
> > index d814721de..36652cfe1 100644
> > --- a/lib/meson.build
> > +++ b/lib/meson.build
> > @@ -76,6 +76,12 @@ foreach l:libraries
> >  			dep_objs += [get_variable('dep_rte_' + d)]
> >  		endforeach
> >  
> > +		if get_option('per_library_versions')
> > +			so_version = '@0@.1'.format(version)
> > +		else
> > +			so_version = meson.project_version()
> > +		endif
> > +
> >  		version_map = '@0@/@1@/rte_@2@_version.map'.format(
> >  				meson.current_source_dir(),
> > dir_name, name)
> >  		libname = 'rte_' + name
> > @@ -87,7 +93,7 @@ foreach l:libraries
> >  				include_directories:
> > include_directories(dir_name),
> >  				link_args: '-Wl,--version-script=' +
> > version_map,
> >  				link_depends: version_map,
> > -				version: '@0@.1'.format(version),
> > +				version: so_version,
> >  				install: true)
> >  		dep = declare_dependency(link_with: lib,
> >  				include_directories:
> > include_directories(dir_name),
> > diff --git a/meson_options.txt b/meson_options.txt
> > index 9c45b8159..636226ce8 100644
> > --- a/meson_options.txt
> > +++ b/meson_options.txt
> > @@ -6,3 +6,4 @@ 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')
> >  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')
> > +option('per_library_versions', type: 'boolean', value: true,
> > description: 'true: each lib gets its own version number, false: DPDK
> > version used for each lib')
> 
> Hi Bruce,
> 
> First of all thanks for implementing this option, and sorry for the
> delay.
> 
> A couple of minor things:
> 
> 1) The project version has 3 digits, but the ABI version should have 2
> - eg: should be 17.08 but right now it's 17.08.0 - given point releases
> will be ABI compatible so they must not change the ABI version. In the
> packaging code we use cut to chop it off:
> 
> DPDK_ABI := $(shell echo $(DEB_VERSION_UPSTREAM) | cut -d '.'  -f1-2)
> 
> Not sure how to achieve the same in a Meson script though (can it shell
> out? or are there string manipulation built-ins?), sorry - just
> starting to look at it.
> 
That should be easy enough to do. It's 3-digits because I'm just pulling
the project version unmodified from the initial project definition. I'd
say I can manage to strip off one digit as part of the build.

> Right now the rte_config option allows the user to completely override
> the version - I'm fine with having a single boolean provided this
> change is applied, it simplifies packaging a bit, but if it's easier
> for you to just accepted a version instead of a boolean it's fine as
> well, as you prefer

If there is a case where we might want to provide a particular version,
I'm happy to edit the option, but if not I'll keep it as-is, because it
will ensure all users of the option get the exact same behaviour, and
means I only have two possibilities to test.

> 
> 2) When the option is true, it should not generate a symlink with the
> ABI "revision", as the first digit is really not the revision, so it
> does not make much sense. Worse, it will stop 2 versions being co-
> installable (which was the whole point :-) ), as, eg, 17.02, 17.05 and
> 17.08 will all ship a libfoo.so.17 symlink. I can fix it in the
> packaging, but I don't think it should be generated upstream at all
> when this option is enabled.

Not exactly sure how to fix this, but I think it may work by using
soversion as well as version in the library() calls.

> 
> IOW, the following is the current result:
> 
> $ ls -l debian/librte-ethdev17.08/usr/lib/x86_64-linux-gnu/
> total 72
> lrwxrwxrwx 1 lboccass lboccass    24 Sep 13 11:50 librte_ethdev.so.17 -> librte_ethdev.so.17.08.0
> -rw-r--r-- 1 lboccass lboccass 71672 Sep 13 11:50 librte_ethdev.so.17.08.0
> 
> The expected result would be to create a single file "librte_ethdev.so.17.08" instead.
> 

Let me see what I can do :-)

/Bruce

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

* [PATCH v3 00/17] build DPDK libs and some drivers with meson/ninja
  2017-09-12 10:37 ` [PATCH v2 " Bruce Richardson
                     ` (17 preceding siblings ...)
  2017-09-12 13:21   ` [PATCH v2 00/17] build DPDK libs and some drivers with meson/ninja Wiles, Keith
@ 2017-09-13 14:12   ` Bruce Richardson
  2017-09-13 14:12     ` [PATCH v3 01/17] build: add initial infrastructure for meson & ninja builds Bruce Richardson
                       ` (17 more replies)
  18 siblings, 18 replies; 107+ messages in thread
From: Bruce Richardson @ 2017-09-13 14:12 UTC (permalink / raw)
  To: dev
  Cc: nhorman, luca.boccassi, harry.van.haaren, keith.wiles, Bruce Richardson

V3 changes:
* used two-digit version numbers when globally versioning libs+drivers
* removed symlinks with single-digit version numbers in same case
* moved driver install location from $prefix/dpdk to $prefix/share/dpdk

V2 changes:
* fixed copyright notices, updated 2016 to 2017
* removed dependency on kconfig file in kernel build tree
* marked pmdinfogen as a "native" binary, in preparation for future cross-
  compilation work
* added in additional warning flags for compatibility with existing system
---

Following on from the two previous RFCs [1] [2], here is a cleaned up
patchset to serve as a start-point for getting all of DPDK building with
meson and ninja.

What's covered:
* Basic infrastructure for feature detection and DPDK compilation
* Building of all DPDK libraries - as either static or shared
* Compilation of igb_uio driver for Linux
* Building a number of mempool, crypto and net drivers.
* Installation of compiled libraries and headers
* Installation of usertools scripts
* Compilation of testpmd as dpdk-testpmd and install of same
* Generation and installation of pkgconfig file for DPDK
* Contributors guide document addition describing how to add build scripts

What's not implemented:
* Just about everything else :-), including
* Support for non-x86 architectures, including cross-compilation
* Lots of PMDs
* Support for building and running the unit tests

Some key differences from RFC2:
* Removed duplication between the different driver meson files by moving
  the build logic up one level to the driver/meson.build file.
* Added a build option to allow versioning the libraries using the DPDK
  version number, rather than individual .so versions.
* Made EAL a default dependency for libs, to simplify meson.build files for
  a number of them.
* Made the build variables used for libraries and drivers more consistent.
* Moved responsibility for determining if a given driver or library should
  be built to the driver/library's own build file, giving a single place
  where all details about that component are placed, and saving having lots
  of environment detection logic in higher-level build files.
* Begun adding in developer documentation to make it easier for driver
  authors/maintainers to contribute.

Meson 0.41 and ninja are needed, and ideally meson 0.42 is recommended.
Ninja is available in most distributions, and meson - if an updated version
is not available on your distro of choice - can be easily got using 
	"pip3 install meson"

To build and install then use:

	meson build # use default compiler and shared libs
	cd build
	ninja
	sudo ninja install

Thereafter to use DPDK in other build systems one can use:

	pkg-config --cflags DPDK
	pkt-config --libs DPDK

to query the needed DPDK build parameters.

Once reviewed and tested a bit, I hope to apply this set - or a new
revision of it - to the build-next tree, to serve as a baseline for others
to use and to add the missing functionality to.

Regards,
/Bruce

[1] http://dpdk.org/ml/archives/dev/2017-June/067429.html
[2] http://dpdk.org/ml/archives/dev/2017-August/072818.html

Bruce Richardson (17):
  build: add initial infrastructure for meson & ninja builds
  eal: add eal library to meson build
  igb_uio: add igb_uio kmod to meson build
  build: add DPDK libraries to build
  build: add buildtools to meson build
  build: add infrastructure for building PMDs
  drivers/mempool: add SW mempool drivers to meson build
  drivers/crypto: add crypto drv class and null PMD to meson
  crypto/openssl: add driver to meson build
  crypto/qat: add driver to meson build
  drivers/net: add net driver support to meson build
  drivers/net: add set of vdev PMDs to build
  drivers/net: add drivers for Intel NICs to meson build
  app/test-pmd: add test-pmd to meson build
  usertools: add usertools installation to meson build
  build: add option to version libs using DPDK version
  doc: add documentation on how to add new components to DPDK

 app/meson.build                                    |  32 +++
 app/test-pmd/meson.build                           |  74 +++++++
 buildtools/gen-pmdinfo-cfile.sh                    |  41 ++++
 buildtools/meson.build                             |  34 ++++
 buildtools/pmdinfogen/meson.build                  |  36 ++++
 config/meson.build                                 |  72 +++++++
 config/rte_config.h                                | 121 ++++++++++++
 config/x86/meson.build                             |  70 +++++++
 doc/guides/contributing/coding_style.rst           | 214 +++++++++++++++++++++
 drivers/crypto/meson.build                         |  35 ++++
 drivers/crypto/null/meson.build                    |  33 ++++
 drivers/crypto/openssl/meson.build                 |  38 ++++
 drivers/crypto/qat/meson.build                     |  41 ++++
 drivers/mempool/meson.build                        |  35 ++++
 drivers/mempool/ring/meson.build                   |  32 +++
 drivers/mempool/stack/meson.build                  |  32 +++
 drivers/meson.build                                | 133 +++++++++++++
 drivers/net/af_packet/meson.build                  |  35 ++++
 drivers/net/e1000/base/meson.build                 |  65 +++++++
 drivers/net/e1000/meson.build                      |  44 +++++
 drivers/net/fm10k/base/meson.build                 |  55 ++++++
 drivers/net/fm10k/meson.build                      |  44 +++++
 drivers/net/i40e/base/meson.build                  |  56 ++++++
 drivers/net/i40e/meson.build                       |  60 ++++++
 drivers/net/ixgbe/base/meson.build                 |  60 ++++++
 drivers/net/ixgbe/meson.build                      |  58 ++++++
 drivers/net/meson.build                            |  36 ++++
 drivers/net/null/meson.build                       |  32 +++
 drivers/net/pcap/meson.build                       |  41 ++++
 drivers/net/ring/meson.build                       |  33 ++++
 lib/librte_acl/meson.build                         |  59 ++++++
 lib/librte_bitratestats/meson.build                |  34 ++++
 lib/librte_cfgfile/meson.build                     |  34 ++++
 lib/librte_cmdline/meson.build                     |  55 ++++++
 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              |  77 ++++++++
 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            |  82 ++++++++
 lib/librte_eal/linuxapp/igb_uio/Kbuild             |   1 +
 lib/librte_eal/linuxapp/igb_uio/meson.build        |  46 +++++
 lib/librte_eal/linuxapp/meson.build                |  42 ++++
 lib/librte_eal/meson.build                         |  44 +++++
 lib/librte_efd/meson.build                         |  34 ++++
 lib/librte_ether/meson.build                       |  45 +++++
 lib/librte_eventdev/meson.build                    |  36 ++++
 lib/librte_gro/meson.build                         |  34 ++++
 lib/librte_hash/meson.build                        |  45 +++++
 lib/librte_ip_frag/meson.build                     |  39 ++++
 lib/librte_jobstats/meson.build                    |  33 ++++
 lib/librte_kni/meson.build                         |  38 ++++
 lib/librte_kvargs/meson.build                      |  34 ++++
 lib/librte_latencystats/meson.build                |  34 ++++
 lib/librte_lpm/meson.build                         |  35 ++++
 lib/librte_mbuf/meson.build                        |  35 ++++
 lib/librte_mempool/meson.build                     |  35 ++++
 lib/librte_meter/meson.build                       |  33 ++++
 lib/librte_metrics/meson.build                     |  33 ++++
 lib/librte_net/meson.build                         |  45 +++++
 lib/librte_pdump/meson.build                       |  34 ++++
 lib/librte_pipeline/meson.build                    |  35 ++++
 lib/librte_port/meson.build                        |  58 ++++++
 lib/librte_power/meson.build                       |  37 ++++
 lib/librte_reorder/meson.build                     |  34 ++++
 lib/librte_ring/meson.build                        |  33 ++++
 lib/librte_sched/meson.build                       |  36 ++++
 lib/librte_table/meson.build                       |  52 +++++
 lib/librte_timer/meson.build                       |  33 ++++
 lib/librte_vhost/meson.build                       |  39 ++++
 lib/meson.build                                    | 109 +++++++++++
 meson.build                                        |  88 +++++++++
 meson_options.txt                                  |   9 +
 usertools/meson.build                              |  32 +++
 80 files changed, 3818 insertions(+)
 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
 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/e1000/base/meson.build
 create mode 100644 drivers/net/e1000/meson.build
 create mode 100644 drivers/net/fm10k/base/meson.build
 create mode 100644 drivers/net/fm10k/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/null/meson.build
 create mode 100644 drivers/net/pcap/meson.build
 create mode 100644 drivers/net/ring/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
 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

-- 
2.13.5

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

* [PATCH v3 01/17] build: add initial infrastructure for meson & ninja builds
  2017-09-13 14:12   ` [PATCH v3 " Bruce Richardson
@ 2017-09-13 14:12     ` Bruce Richardson
  2017-09-20 10:10       ` Timothy M. Redaelli
  2017-09-13 14:12     ` [PATCH v3 02/17] eal: add eal library to meson build Bruce Richardson
                       ` (16 subsequent siblings)
  17 siblings, 1 reply; 107+ messages in thread
From: Bruce Richardson @ 2017-09-13 14:12 UTC (permalink / raw)
  To: dev
  Cc: nhorman, luca.boccassi, harry.van.haaren, keith.wiles, Bruce Richardson

To build with meson and ninja, we need some initial infrastructure in
place. The build files for meson always need to be called "meson.build",
and options get placed in meson_options.txt

This commit adds a top-level meson.build file, which sets up the global
variables for tracking drivers, libraries, etc., and then includes other
build files, before finishing by writing the global build configuration
header file and a DPDK pkgconfig file at the end, using some of those same
globals.

>From the top level build file, the only include file thus far is for the
config folder, which does some other setup of global configuration
parameters, including pulling in architecture specific parameters from an
architectural subdirectory. A number of configuration build options are
provided for the project to tune a number of global variables which will be
used later e.g. max numa nodes, max cores, etc. These settings all make
their way to the global build config header "rte_build_config.h". There is
also a file "rte_config.h", which includes "rte_build_config.h", and this
file is meant to hold other build-time values which are present in our
current static build configuration but are not normally meant for
user-configuration. Ideally, over time, the values placed here should be
moved to the individual libraries or drivers which want those values.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 config/meson.build     | 72 +++++++++++++++++++++++++++++++++++++++++++
 config/rte_config.h    | 50 ++++++++++++++++++++++++++++++
 config/x86/meson.build | 70 ++++++++++++++++++++++++++++++++++++++++++
 meson.build            | 83 ++++++++++++++++++++++++++++++++++++++++++++++++++
 meson_options.txt      |  6 ++++
 5 files changed, 281 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

diff --git a/config/meson.build b/config/meson.build
new file mode 100644
index 000000000..b57a7e64b
--- /dev/null
+++ b/config/meson.build
@@ -0,0 +1,72 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation.
+#   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')
+# 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')
+
+# enable extra warnings and disable any unwanted warnings
+warning_flags = [
+	'-Wsign-compare',
+	'-Wcast-qual',
+	'-Wno-address-of-packed-member',
+	'-Wno-format-truncation'
+]
+foreach arg: warning_flags
+	if cc.has_argument(arg)
+		add_project_arguments(arg, language: 'c')
+	endif
+endforeach
+
+compile_time_cpuflags = []
+if host_machine.cpu_family().startswith('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', join_paths(
+		get_option('prefix'), 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')
diff --git a/config/rte_config.h b/config/rte_config.h
new file mode 100644
index 000000000..813c3a67d
--- /dev/null
+++ b/config/rte_config.h
@@ -0,0 +1,50 @@
+/*
+ *   BSD LICENSE
+ *
+ *   Copyright(c) 2017 Intel Corporation.
+ *   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.
+ */
+
+/**
+ * @file Header file containing DPDK compilation parameters
+ *
+ * Header file containing DPDK compilation parameters. Also include the
+ * meson-generated header file containing the detected parameters that
+ * are variable across builds or build environments.
+ *
+ * NOTE: This file is only used for meson+ninja builds. For builds done
+ * using make/gmake, the rte_config.h file is autogenerated from the
+ * defconfig_* files in the config directory.
+ */
+#ifndef _RTE_CONFIG_H_
+#define _RTE_CONFIG_H_
+
+#include <rte_build_config.h>
+
+#endif /* _RTE_CONFIG_H_ */
diff --git a/config/x86/meson.build b/config/x86/meson.build
new file mode 100644
index 000000000..0d1a532ad
--- /dev/null
+++ b/config/x86/meson.build
@@ -0,0 +1,70 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation.
+#   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.
+
+# for checking defines we need to use the correct compiler flags
+march_opt = '-march=@0@'.format(machine)
+
+# we require SSE4.2 for DPDK
+sse_errormsg = '''SSE4.2 instruction set is required for DPDK.
+Please set the machine type to "nehalem" or "corei7" or higher value'''
+
+if cc.get_define('__SSE4_2__', args: march_opt) == ''
+	error(sse_errormsg)
+endif
+
+dpdk_conf.set('RTE_ARCH_X86', 1)
+if (host_machine.cpu_family() == 'x86_64')
+	dpdk_conf.set('RTE_ARCH_X86_64', 1)
+	dpdk_conf.set('RTE_ARCH', 'x86_64')
+	dpdk_conf.set('RTE_ARCH_64', 1)
+else
+	dpdk_conf.set('RTE_ARCH_I686', 1)
+	dpdk_conf.set('RTE_ARCH', 'i686')
+endif
+
+if cc.get_define('__AES__', args: march_opt) != ''
+	dpdk_conf.set('RTE_MACHINE_CPUFLAG_AES', 1)
+	compile_time_cpuflags += ['RTE_CPUFLAG_AES']
+endif
+if cc.get_define('__PCLMUL__', args: march_opt) != ''
+	dpdk_conf.set('RTE_MACHINE_CPUFLAG_PCLMULQDQ', 1)
+	compile_time_cpuflags += ['RTE_CPUFLAG_PCLMULQDQ']
+endif
+if cc.get_define('__AVX__', args: march_opt) != ''
+	dpdk_conf.set('RTE_MACHINE_CPUFLAG_AVX', 1)
+	compile_time_cpuflags += ['RTE_CPUFLAG_AVX']
+endif
+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)
diff --git a/meson.build b/meson.build
new file mode 100644
index 000000000..972ef9701
--- /dev/null
+++ b/meson.build
@@ -0,0 +1,83 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation.
+#   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.
+
+project('DPDK', 'C',
+	version: '17.08.0',
+	license: 'BSD',
+	default_options: ['buildtype=release'],
+	meson_version: '>= 0.41'
+)
+
+# set up some global vars for compiler, platform, configuration, etc.
+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
+if get_option('default_library') == 'static'
+	driver_install_path = get_option('libdir')
+else
+	driver_install_path = join_paths(get_option('datadir'), 'dpdk/drivers')
+endif
+
+# configure the build, and make sure configs here and in config folder are
+# 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')
+subdir('config')
+
+# TODO build libs and drivers
+
+# TODO build binaries and installable tools
+
+# write the build config
+build_cfg = 'rte_build_config.h'
+configure_file(output: build_cfg,
+		configuration: dpdk_conf,
+		install_dir: get_option('includedir'))
+
+# 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_drivers = ['-Wl,--whole-archive'] + dpdk_drivers + ['-Wl,--no-whole-archive']
+	dpdk_libraries = dpdk_drivers + dpdk_libraries + dpdk_extra_ldflags
+endif
+
+pkg = import('pkgconfig')
+pkg.generate(name: meson.project_name(),
+	version: meson.project_version(),
+	libraries: dpdk_libraries,
+	description: 'The Data Plane Development Kit (DPDK)',
+	extra_cflags: '-include "rte_config.h"'
+)
diff --git a/meson_options.txt b/meson_options.txt
new file mode 100644
index 000000000..c03b79fbd
--- /dev/null
+++ b/meson_options.txt
@@ -0,0 +1,6 @@
+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')
-- 
2.13.5

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

* [PATCH v3 02/17] eal: add eal library to meson build
  2017-09-13 14:12   ` [PATCH v3 " Bruce Richardson
  2017-09-13 14:12     ` [PATCH v3 01/17] build: add initial infrastructure for meson & ninja builds Bruce Richardson
@ 2017-09-13 14:12     ` Bruce Richardson
  2017-09-13 14:12     ` [PATCH v3 03/17] igb_uio: add igb_uio kmod " Bruce Richardson
                       ` (15 subsequent siblings)
  17 siblings, 0 replies; 107+ messages in thread
From: Bruce Richardson @ 2017-09-13 14:12 UTC (permalink / raw)
  To: dev
  Cc: nhorman, luca.boccassi, harry.van.haaren, keith.wiles, Bruce Richardson

Support building the EAL with meson and ninja. This involves a number of
different meson.build files for iterating through all the different
subdirectories in the EAL. The library itself will be compiled on build but
the header files are only copied from their initial location once "ninja
install" is run. Instead, we use meson dependency tracking to ensure that
other libraries which use the EAL headers can find them in their original
locations.

Note: this does not include building kernel modules on either BSD or Linux

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 config/rte_config.h                                | 11 ++++
 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/meson.build                | 32 ++++++++++
 lib/librte_eal/meson.build                         | 44 +++++++++++++
 lib/meson.build                                    | 32 ++++++++++
 meson.build                                        |  3 +-
 14 files changed, 580 insertions(+), 1 deletion(-)
 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/meson.build
 create mode 100644 lib/librte_eal/meson.build
 create mode 100644 lib/meson.build

diff --git a/config/rte_config.h b/config/rte_config.h
index 813c3a67d..c94704cfe 100644
--- a/config/rte_config.h
+++ b/config/rte_config.h
@@ -47,4 +47,15 @@
 
 #include <rte_build_config.h>
 
+/****** library defines ********/
+
+/* 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_ */
diff --git a/lib/librte_eal/bsdapp/eal/meson.build b/lib/librte_eal/bsdapp/eal/meson.build
new file mode 100644
index 000000000..00973122a
--- /dev/null
+++ b/lib/librte_eal/bsdapp/eal/meson.build
@@ -0,0 +1,67 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation.
+#   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')
+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_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'),
+			include_directories : eal_inc,
+			version: '@0@.1'.format(version),
+			c_args: '-D_GNU_SOURCE',
+			link_depends: version_map,
+			link_args: [eal_extra_link_arg,
+				'-Wl,--version-script=' + version_map],
+			install: true
+)
+
+dpdk_libraries += eal_lib
+dpdk_extra_ldflags += ['-pthread', eal_extra_link_arg]
+
+rte_eal = declare_dependency(link_with: eal_lib,
+		include_directories: eal_inc,
+		dependencies: dependency('threads'))
+set_variable('dep_rte_eal', rte_eal)
diff --git a/lib/librte_eal/bsdapp/meson.build b/lib/librte_eal/bsdapp/meson.build
new file mode 100644
index 000000000..bda974a9a
--- /dev/null
+++ b/lib/librte_eal/bsdapp/meson.build
@@ -0,0 +1,32 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation.
+#   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')
diff --git a/lib/librte_eal/common/arch/meson.build b/lib/librte_eal/common/arch/meson.build
new file mode 100644
index 000000000..9e2539fde
--- /dev/null
+++ b/lib/librte_eal/common/arch/meson.build
@@ -0,0 +1,33 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation.
+#   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)
diff --git a/lib/librte_eal/common/arch/x86/meson.build b/lib/librte_eal/common/arch/x86/meson.build
new file mode 100644
index 000000000..c007e57c9
--- /dev/null
+++ b/lib/librte_eal/common/arch/x86/meson.build
@@ -0,0 +1,32 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation.
+#   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')
diff --git a/lib/librte_eal/common/include/arch/meson.build b/lib/librte_eal/common/include/arch/meson.build
new file mode 100644
index 000000000..9e2539fde
--- /dev/null
+++ b/lib/librte_eal/common/include/arch/meson.build
@@ -0,0 +1,33 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation.
+#   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)
diff --git a/lib/librte_eal/common/include/arch/x86/meson.build b/lib/librte_eal/common/include/arch/x86/meson.build
new file mode 100644
index 000000000..80b5980c1
--- /dev/null
+++ b/lib/librte_eal/common/include/arch/x86/meson.build
@@ -0,0 +1,48 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation.
+#   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_atomic_32.h',
+	'rte_atomic_64.h',
+	'rte_atomic.h',
+	'rte_byteorder_32.h',
+	'rte_byteorder_64.h',
+	'rte_byteorder.h',
+	'rte_cpuflags.h',
+	'rte_cycles.h',
+	'rte_io.h',
+	'rte_memcpy.h',
+	'rte_prefetch.h',
+	'rte_pause.h',
+	'rte_rtm.h',
+	'rte_rwlock.h',
+	'rte_spinlock.h',
+	'rte_vect.h')
diff --git a/lib/librte_eal/common/include/meson.build b/lib/librte_eal/common/include/meson.build
new file mode 100644
index 000000000..d106d1a46
--- /dev/null
+++ b/lib/librte_eal/common/include/meson.build
@@ -0,0 +1,71 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation.
+#   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('.')
+
+common_headers = [
+	'rte_alarm.h',
+	'rte_branch_prediction.h',
+	'rte_bus.h',
+	'rte_common.h',
+	'rte_debug.h',
+	'rte_devargs.h',
+	'rte_dev.h',
+	'rte_eal.h',
+	'rte_eal_memconfig.h',
+	'rte_errno.h',
+	'rte_hexdump.h',
+	'rte_interrupts.h',
+	'rte_keepalive.h',
+	'rte_launch.h',
+	'rte_lcore.h',
+	'rte_log.h',
+	'rte_malloc.h',
+	'rte_malloc_heap.h',
+	'rte_memory.h',
+	'rte_memzone.h',
+	'rte_pci_dev_feature_defs.h',
+	'rte_pci_dev_features.h',
+	'rte_pci.h',
+	'rte_per_lcore.h',
+	'rte_random.h',
+	'rte_service.h',
+	'rte_service_component.h',
+	'rte_string_fns.h',
+	'rte_tailq.h',
+	'rte_time.h',
+	'rte_vdev.h',
+	'rte_version.h']
+
+install_headers(common_headers)
+install_subdir('generic', install_dir : 'include')
+
+subdir('arch')
diff --git a/lib/librte_eal/common/meson.build b/lib/librte_eal/common/meson.build
new file mode 100644
index 000000000..eeab002fe
--- /dev/null
+++ b/lib/librte_eal/common/meson.build
@@ -0,0 +1,71 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation.
+#   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('.')
+
+eal_common_sources = files(
+	'eal_common_bus.c',
+	'eal_common_cpuflags.c',
+	'eal_common_devargs.c',
+	'eal_common_dev.c',
+	'eal_common_errno.c',
+	'eal_common_hexdump.c',
+	'eal_common_launch.c',
+	'eal_common_lcore.c',
+	'eal_common_log.c',
+	'eal_common_memory.c',
+	'eal_common_memzone.c',
+	'eal_common_options.c',
+	'eal_common_pci.c',
+	'eal_common_pci_uio.c',
+	'eal_common_proc.c',
+	'eal_common_string_fns.c',
+	'eal_common_tailqs.c',
+	'eal_common_thread.c',
+	'eal_common_timer.c',
+	'eal_common_vdev.c',
+	'eal_filesystem.h',
+	'eal_hugepages.h',
+	'eal_internal_cfg.h',
+	'eal_options.h',
+	'eal_private.h',
+	'eal_thread.h',
+	'malloc_elem.c',
+	'malloc_elem.h',
+	'malloc_heap.c',
+	'malloc_heap.h',
+	'rte_keepalive.c',
+	'rte_malloc.c',
+	'rte_service.c'
+)
+
+subdir('arch')
+subdir('include')
diff --git a/lib/librte_eal/linuxapp/eal/meson.build b/lib/librte_eal/linuxapp/eal/meson.build
new file mode 100644
index 000000000..e7daed499
--- /dev/null
+++ b/lib/librte_eal/linuxapp/eal/meson.build
@@ -0,0 +1,72 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation.
+#   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')
+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_log.c',
+		'eal_pci_uio.c',
+		'eal_pci_vfio.c',
+		'eal_thread.c',
+		'eal_timer.c',
+		'eal_vfio.c',
+		'eal_vfio_mp_sync.c',
+		'eal.c',
+		'eal_memory.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'),
+			include_directories : eal_inc,
+			version: '@0@.1'.format(version),
+			c_args: '-D_GNU_SOURCE',
+			link_depends: version_map,
+			link_args: [eal_extra_link_arg,
+				'-Wl,--version-script=' + version_map],
+			install: true
+)
+
+dpdk_libraries += eal_lib
+dpdk_extra_ldflags += ['-pthread', eal_extra_link_arg]
+
+rte_eal = declare_dependency(link_with: eal_lib,
+		include_directories: eal_inc,
+		dependencies: dependency('threads'))
+set_variable('dep_rte_eal', rte_eal)
diff --git a/lib/librte_eal/linuxapp/meson.build b/lib/librte_eal/linuxapp/meson.build
new file mode 100644
index 000000000..bda974a9a
--- /dev/null
+++ b/lib/librte_eal/linuxapp/meson.build
@@ -0,0 +1,32 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation.
+#   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')
diff --git a/lib/librte_eal/meson.build b/lib/librte_eal/meson.build
new file mode 100644
index 000000000..2700fb04d
--- /dev/null
+++ b/lib/librte_eal/meson.build
@@ -0,0 +1,44 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation.
+#   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  # the version of the EAL API
+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()))
+endif
diff --git a/lib/meson.build b/lib/meson.build
new file mode 100644
index 000000000..7cafe6666
--- /dev/null
+++ b/lib/meson.build
@@ -0,0 +1,32 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation.
+#   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('librte_eal')
diff --git a/meson.build b/meson.build
index 972ef9701..f62f64c31 100644
--- a/meson.build
+++ b/meson.build
@@ -57,7 +57,8 @@ endif
 global_inc = include_directories('.', 'config')
 subdir('config')
 
-# TODO build libs and drivers
+# build libs and (TODO) drivers
+subdir('lib')
 
 # TODO build binaries and installable tools
 
-- 
2.13.5

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

* [PATCH v3 03/17] igb_uio: add igb_uio kmod to meson build
  2017-09-13 14:12   ` [PATCH v3 " Bruce Richardson
  2017-09-13 14:12     ` [PATCH v3 01/17] build: add initial infrastructure for meson & ninja builds Bruce Richardson
  2017-09-13 14:12     ` [PATCH v3 02/17] eal: add eal library to meson build Bruce Richardson
@ 2017-09-13 14:12     ` Bruce Richardson
  2017-09-13 14:12     ` [PATCH v3 04/17] build: add DPDK libraries to build Bruce Richardson
                       ` (14 subsequent siblings)
  17 siblings, 0 replies; 107+ messages in thread
From: Bruce Richardson @ 2017-09-13 14:12 UTC (permalink / raw)
  To: dev
  Cc: nhorman, luca.boccassi, harry.van.haaren, keith.wiles, Bruce Richardson

Support building igb_uio using meson and ninja. For this, we still use the
kernel's kbuild system, by calling out to make, since it's safer and easier
than trying to reproduce that in meson. A list of suitable file
dependencies is given so that we have a reasonable chance of a rebuild when
necessary.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 lib/librte_eal/linuxapp/igb_uio/Kbuild      |  1 +
 lib/librte_eal/linuxapp/igb_uio/meson.build | 46 +++++++++++++++++++++++++++++
 lib/librte_eal/linuxapp/meson.build         | 10 +++++++
 meson_options.txt                           |  2 ++
 4 files changed, 59 insertions(+)
 create mode 100644 lib/librte_eal/linuxapp/igb_uio/Kbuild
 create mode 100644 lib/librte_eal/linuxapp/igb_uio/meson.build

diff --git a/lib/librte_eal/linuxapp/igb_uio/Kbuild b/lib/librte_eal/linuxapp/igb_uio/Kbuild
new file mode 100644
index 000000000..98c98fe52
--- /dev/null
+++ b/lib/librte_eal/linuxapp/igb_uio/Kbuild
@@ -0,0 +1 @@
+obj-m := igb_uio.o
diff --git a/lib/librte_eal/linuxapp/igb_uio/meson.build b/lib/librte_eal/linuxapp/igb_uio/meson.build
new file mode 100644
index 000000000..4712756ea
--- /dev/null
+++ b/lib/librte_eal/linuxapp/igb_uio/meson.build
@@ -0,0 +1,46 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation.
+#   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.
+
+mkfile = custom_target('igb_uio_makefile',
+	output: 'Makefile',
+	command: ['touch', '@OUTPUT@'])
+
+custom_target('igb_uio',
+	input: ['igb_uio.c', 'Kbuild'],
+	output: 'igb_uio.ko',
+	command: ['make', '-C', kernel_dir,
+		'M=' + meson.current_build_dir(),
+		'src=' + meson.current_source_dir(),
+		'EXTRA_CFLAGS=-I' + meson.current_source_dir() +
+			'/../../common/include',
+		'modules'],
+	depends: mkfile,
+	build_by_default: true)
diff --git a/lib/librte_eal/linuxapp/meson.build b/lib/librte_eal/linuxapp/meson.build
index bda974a9a..16a3f6b8b 100644
--- a/lib/librte_eal/linuxapp/meson.build
+++ b/lib/librte_eal/linuxapp/meson.build
@@ -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
diff --git a/meson_options.txt b/meson_options.txt
index c03b79fbd..9c45b8159 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -4,3 +4,5 @@ option('max_numa_nodes', type: 'string', value: '4', description: 'maximum numbe
 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')
+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')
-- 
2.13.5

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

* [PATCH v3 04/17] build: add DPDK libraries to build
  2017-09-13 14:12   ` [PATCH v3 " Bruce Richardson
                       ` (2 preceding siblings ...)
  2017-09-13 14:12     ` [PATCH v3 03/17] igb_uio: add igb_uio kmod " Bruce Richardson
@ 2017-09-13 14:12     ` Bruce Richardson
  2017-09-13 14:12     ` [PATCH v3 05/17] build: add buildtools to meson build Bruce Richardson
                       ` (13 subsequent siblings)
  17 siblings, 0 replies; 107+ messages in thread
From: Bruce Richardson @ 2017-09-13 14:12 UTC (permalink / raw)
  To: dev
  Cc: nhorman, luca.boccassi, harry.van.haaren, keith.wiles, Bruce Richardson

Add non-EAL libraries to DPDK build. The compat lib is a special case,
along with the previously-added EAL, but all other libs can be build using
the same set of commands, where the individual meson.build files only need
to specify their dependencies, source files, header files and ABI versions.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 config/rte_config.h                 | 36 ++++++++++++++++++++
 lib/librte_acl/meson.build          | 59 ++++++++++++++++++++++++++++++++
 lib/librte_bitratestats/meson.build | 34 +++++++++++++++++++
 lib/librte_cfgfile/meson.build      | 34 +++++++++++++++++++
 lib/librte_cmdline/meson.build      | 55 ++++++++++++++++++++++++++++++
 lib/librte_compat/meson.build       | 36 ++++++++++++++++++++
 lib/librte_cryptodev/meson.build    | 40 ++++++++++++++++++++++
 lib/librte_distributor/meson.build  | 39 +++++++++++++++++++++
 lib/librte_efd/meson.build          | 34 +++++++++++++++++++
 lib/librte_ether/meson.build        | 45 +++++++++++++++++++++++++
 lib/librte_eventdev/meson.build     | 36 ++++++++++++++++++++
 lib/librte_gro/meson.build          | 34 +++++++++++++++++++
 lib/librte_hash/meson.build         | 45 +++++++++++++++++++++++++
 lib/librte_ip_frag/meson.build      | 39 +++++++++++++++++++++
 lib/librte_jobstats/meson.build     | 33 ++++++++++++++++++
 lib/librte_kni/meson.build          | 38 +++++++++++++++++++++
 lib/librte_kvargs/meson.build       | 34 +++++++++++++++++++
 lib/librte_latencystats/meson.build | 34 +++++++++++++++++++
 lib/librte_lpm/meson.build          | 35 +++++++++++++++++++
 lib/librte_mbuf/meson.build         | 35 +++++++++++++++++++
 lib/librte_mempool/meson.build      | 35 +++++++++++++++++++
 lib/librte_meter/meson.build        | 33 ++++++++++++++++++
 lib/librte_metrics/meson.build      | 33 ++++++++++++++++++
 lib/librte_net/meson.build          | 45 +++++++++++++++++++++++++
 lib/librte_pdump/meson.build        | 34 +++++++++++++++++++
 lib/librte_pipeline/meson.build     | 35 +++++++++++++++++++
 lib/librte_port/meson.build         | 58 ++++++++++++++++++++++++++++++++
 lib/librte_power/meson.build        | 37 ++++++++++++++++++++
 lib/librte_reorder/meson.build      | 34 +++++++++++++++++++
 lib/librte_ring/meson.build         | 33 ++++++++++++++++++
 lib/librte_sched/meson.build        | 36 ++++++++++++++++++++
 lib/librte_table/meson.build        | 52 ++++++++++++++++++++++++++++
 lib/librte_timer/meson.build        | 33 ++++++++++++++++++
 lib/librte_vhost/meson.build        | 39 +++++++++++++++++++++
 lib/meson.build                     | 67 +++++++++++++++++++++++++++++++++++++
 35 files changed, 1379 insertions(+)
 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_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
 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

diff --git a/config/rte_config.h b/config/rte_config.h
index c94704cfe..b47cfabae 100644
--- a/config/rte_config.h
+++ b/config/rte_config.h
@@ -58,4 +58,40 @@
 #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
+
+/* 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
+
 #endif /* _RTE_CONFIG_H_ */
diff --git a/lib/librte_acl/meson.build b/lib/librte_acl/meson.build
new file mode 100644
index 000000000..b81b74468
--- /dev/null
+++ b/lib/librte_acl/meson.build
@@ -0,0 +1,59 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation.
+#   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')
+
+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
diff --git a/lib/librte_bitratestats/meson.build b/lib/librte_bitratestats/meson.build
new file mode 100644
index 000000000..dcf6070bf
--- /dev/null
+++ b/lib/librte_bitratestats/meson.build
@@ -0,0 +1,34 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation.
+#   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 += ['ethdev', 'metrics']
diff --git a/lib/librte_cfgfile/meson.build b/lib/librte_cfgfile/meson.build
new file mode 100644
index 000000000..1a4992ff3
--- /dev/null
+++ b/lib/librte_cfgfile/meson.build
@@ -0,0 +1,34 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation.
+#   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')
diff --git a/lib/librte_cmdline/meson.build b/lib/librte_cmdline/meson.build
new file mode 100644
index 000000000..80fbe5d07
--- /dev/null
+++ b/lib/librte_cmdline/meson.build
@@ -0,0 +1,55 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation.
+#   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('cmdline.c',
+	'cmdline_cirbuf.c',
+	'cmdline_parse.c',
+	'cmdline_parse_etheraddr.c',
+	'cmdline_parse_ipaddr.c',
+	'cmdline_parse_num.c',
+	'cmdline_parse_portlist.c',
+	'cmdline_parse_string.c',
+	'cmdline_rdline.c',
+	'cmdline_socket.c',
+	'cmdline_vt100.c')
+
+headers = files('cmdline.h',
+	'cmdline_parse.h',
+	'cmdline_parse_num.h',
+	'cmdline_parse_ipaddr.h',
+	'cmdline_parse_etheraddr.h',
+	'cmdline_parse_string.h',
+	'cmdline_rdline.h',
+	'cmdline_vt100.h',
+	'cmdline_socket.h',
+	'cmdline_cirbuf.h',
+	'cmdline_parse_portlist.h')
diff --git a/lib/librte_compat/meson.build b/lib/librte_compat/meson.build
new file mode 100644
index 000000000..3b911dfff
--- /dev/null
+++ b/lib/librte_compat/meson.build
@@ -0,0 +1,36 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation.
+#   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')
+
+set_variable('dep_rte_compat',
+	declare_dependency(include_directories: include_directories('.')))
diff --git a/lib/librte_cryptodev/meson.build b/lib/librte_cryptodev/meson.build
new file mode 100644
index 000000000..e45e7098a
--- /dev/null
+++ b/lib/librte_cryptodev/meson.build
@@ -0,0 +1,40 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation.
+#   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_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 += ['kvargs', 'mbuf']
diff --git a/lib/librte_distributor/meson.build b/lib/librte_distributor/meson.build
new file mode 100644
index 000000000..6118c5f50
--- /dev/null
+++ b/lib/librte_distributor/meson.build
@@ -0,0 +1,39 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation.
+#   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 += ['mbuf', 'compat']
diff --git a/lib/librte_efd/meson.build b/lib/librte_efd/meson.build
new file mode 100644
index 000000000..73c004e70
--- /dev/null
+++ b/lib/librte_efd/meson.build
@@ -0,0 +1,34 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation.
+#   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 += ['ring', 'hash']
diff --git a/lib/librte_ether/meson.build b/lib/librte_ether/meson.build
new file mode 100644
index 000000000..d10bd37d5
--- /dev/null
+++ b/lib/librte_ether/meson.build
@@ -0,0 +1,45 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation.
+#   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.
+
+name = 'ethdev'
+version = 6
+sources = files('rte_ethdev.c', 'rte_flow.c', 'rte_tm.c')
+
+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_tm.h')
+
+deps += ['net']
diff --git a/lib/librte_eventdev/meson.build b/lib/librte_eventdev/meson.build
new file mode 100644
index 000000000..60d5f4e89
--- /dev/null
+++ b/lib/librte_eventdev/meson.build
@@ -0,0 +1,36 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation.
+#   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 += ['ring']
diff --git a/lib/librte_gro/meson.build b/lib/librte_gro/meson.build
new file mode 100644
index 000000000..f6848c42b
--- /dev/null
+++ b/lib/librte_gro/meson.build
@@ -0,0 +1,34 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation.
+#   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 += ['ethdev']
diff --git a/lib/librte_hash/meson.build b/lib/librte_hash/meson.build
new file mode 100644
index 000000000..1df383f4b
--- /dev/null
+++ b/lib/librte_hash/meson.build
@@ -0,0 +1,45 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation.
+#   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
+headers = files('rte_cmp_arm64.h',
+	'rte_cmp_x86.h',
+	'rte_crc_arm64.h',
+	'rte_cuckoo_hash.h',
+	'rte_cuckoo_hash_x86.h',
+	'rte_fbk_hash.h',
+	'rte_hash_crc.h',
+	'rte_hash.h',
+	'rte_jhash.h',
+	'rte_thash.h')
+
+sources = files('rte_cuckoo_hash.c', 'rte_fbk_hash.c')
+deps += ['ring', 'compat']
diff --git a/lib/librte_ip_frag/meson.build b/lib/librte_ip_frag/meson.build
new file mode 100644
index 000000000..11523badf
--- /dev/null
+++ b/lib/librte_ip_frag/meson.build
@@ -0,0 +1,39 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation.
+#   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 += ['ethdev', 'hash']
diff --git a/lib/librte_jobstats/meson.build b/lib/librte_jobstats/meson.build
new file mode 100644
index 000000000..97cf01cad
--- /dev/null
+++ b/lib/librte_jobstats/meson.build
@@ -0,0 +1,33 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation.
+#   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')
diff --git a/lib/librte_kni/meson.build b/lib/librte_kni/meson.build
new file mode 100644
index 000000000..25934a46d
--- /dev/null
+++ b/lib/librte_kni/meson.build
@@ -0,0 +1,38 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation.
+#   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
+version = 2
+sources = files('rte_kni.c')
+headers = files('rte_kni.h')
+deps += ['ethdev']
diff --git a/lib/librte_kvargs/meson.build b/lib/librte_kvargs/meson.build
new file mode 100644
index 000000000..2962fc370
--- /dev/null
+++ b/lib/librte_kvargs/meson.build
@@ -0,0 +1,34 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation.
+#   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 = 1
+sources = files('rte_kvargs.c')
+headers = files('rte_kvargs.h')
diff --git a/lib/librte_latencystats/meson.build b/lib/librte_latencystats/meson.build
new file mode 100644
index 000000000..10a778433
--- /dev/null
+++ b/lib/librte_latencystats/meson.build
@@ -0,0 +1,34 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation.
+#   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 += ['metrics', 'ethdev']
diff --git a/lib/librte_lpm/meson.build b/lib/librte_lpm/meson.build
new file mode 100644
index 000000000..af88a97ec
--- /dev/null
+++ b/lib/librte_lpm/meson.build
@@ -0,0 +1,35 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation.
+#   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 += ['compat']
diff --git a/lib/librte_mbuf/meson.build b/lib/librte_mbuf/meson.build
new file mode 100644
index 000000000..96856e231
--- /dev/null
+++ b/lib/librte_mbuf/meson.build
@@ -0,0 +1,35 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation.
+#   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_mbuf.c', 'rte_mbuf_ptype.c')
+headers = files('rte_mbuf.h', 'rte_mbuf_ptype.h')
+deps += ['mempool']
diff --git a/lib/librte_mempool/meson.build b/lib/librte_mempool/meson.build
new file mode 100644
index 000000000..96e582deb
--- /dev/null
+++ b/lib/librte_mempool/meson.build
@@ -0,0 +1,35 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation.
+#   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_mempool.c', 'rte_mempool_ops.c')
+headers = files('rte_mempool.h')
+deps += ['ring']
diff --git a/lib/librte_meter/meson.build b/lib/librte_meter/meson.build
new file mode 100644
index 000000000..debcebcc1
--- /dev/null
+++ b/lib/librte_meter/meson.build
@@ -0,0 +1,33 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation.
+#   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')
diff --git a/lib/librte_metrics/meson.build b/lib/librte_metrics/meson.build
new file mode 100644
index 000000000..c820503f0
--- /dev/null
+++ b/lib/librte_metrics/meson.build
@@ -0,0 +1,33 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation.
+#   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')
diff --git a/lib/librte_net/meson.build b/lib/librte_net/meson.build
new file mode 100644
index 000000000..62bbf4c22
--- /dev/null
+++ b/lib/librte_net/meson.build
@@ -0,0 +1,45 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation.
+#   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 = 1
+headers = files('rte_ip.h',
+	'rte_tcp.h',
+	'rte_udp.h',
+	'rte_sctp.h',
+	'rte_icmp.h',
+	'rte_arp.h',
+	'rte_ether.h',
+	'rte_gre.h',
+	'rte_net.h',
+	'rte_net_crc.h')
+
+sources = files('rte_net.c', 'rte_net_crc.c')
+deps += ['mbuf']
diff --git a/lib/librte_pdump/meson.build b/lib/librte_pdump/meson.build
new file mode 100644
index 000000000..94a92b677
--- /dev/null
+++ b/lib/librte_pdump/meson.build
@@ -0,0 +1,34 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation.
+#   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 += ['ethdev']
diff --git a/lib/librte_pipeline/meson.build b/lib/librte_pipeline/meson.build
new file mode 100644
index 000000000..54e34fc62
--- /dev/null
+++ b/lib/librte_pipeline/meson.build
@@ -0,0 +1,35 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation.
+#   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']
diff --git a/lib/librte_port/meson.build b/lib/librte_port/meson.build
new file mode 100644
index 000000000..a0d3a8c07
--- /dev/null
+++ b/lib/librte_port/meson.build
@@ -0,0 +1,58 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation.
+#   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_port_ethdev.c',
+	'rte_port_fd.c',
+	'rte_port_ring.c',
+	'rte_port_sched.c',
+	'rte_port_source_sink.c')
+headers = files(
+	'rte_port_ethdev.h',
+	'rte_port_fd.h',
+	'rte_port.h',
+	'rte_port_ring.h',
+	'rte_port_sched.h',
+	'rte_port_source_sink.h')
+deps += ['ethdev', 'sched']
+
+if dpdk_conf.has('RTE_LIBRTE_IP_FRAG')
+	sources += files('rte_port_frag.c', 'rte_port_ras.c')
+	headers += files('rte_port_frag.h', 'rte_port_ras.h')
+	deps += ['ip_frag']
+endif
+
+if dpdk_conf.has('RTE_LIBRTE_KNI')
+	sources += files('rte_port_kni.c')
+	headers += files('rte_port_kni.h')
+	deps += 'kni'
+endif
diff --git a/lib/librte_power/meson.build b/lib/librte_power/meson.build
new file mode 100644
index 000000000..541efa6a4
--- /dev/null
+++ b/lib/librte_power/meson.build
@@ -0,0 +1,37 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation.
+#   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('rte_power.c', 'rte_power_acpi_cpufreq.c',
+		'rte_power_kvm_vm.c', 'guest_channel.c')
+headers = files('rte_power.h')
diff --git a/lib/librte_reorder/meson.build b/lib/librte_reorder/meson.build
new file mode 100644
index 000000000..456e83f02
--- /dev/null
+++ b/lib/librte_reorder/meson.build
@@ -0,0 +1,34 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation.
+#   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 += ['mbuf']
diff --git a/lib/librte_ring/meson.build b/lib/librte_ring/meson.build
new file mode 100644
index 000000000..8c102fe6a
--- /dev/null
+++ b/lib/librte_ring/meson.build
@@ -0,0 +1,33 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation.
+#   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_ring.c')
+headers = files('rte_ring.h')
diff --git a/lib/librte_sched/meson.build b/lib/librte_sched/meson.build
new file mode 100644
index 000000000..c4badb211
--- /dev/null
+++ b/lib/librte_sched/meson.build
@@ -0,0 +1,36 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation.
+#   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']
diff --git a/lib/librte_table/meson.build b/lib/librte_table/meson.build
new file mode 100644
index 000000000..2fb3ec804
--- /dev/null
+++ b/lib/librte_table/meson.build
@@ -0,0 +1,52 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation.
+#   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_table_lpm.c', 'rte_table_lpm_ipv6.c',
+		'rte_table_hash_cuckoo.c', 'rte_table_hash_key8.c',
+		'rte_table_hash_key16.c', 'rte_table_hash_key32.c',
+		'rte_table_hash_ext.c', 'rte_table_hash_lru.c',
+		'rte_table_array.c', 'rte_table_stub.c')
+headers = files('rte_table.h', 'rte_table_lpm.h',
+		'rte_table_lpm_ipv6.h', 'rte_table_hash.h',
+		'rte_lru.h', 'rte_table_array.h',
+		'rte_table_stub.h')
+deps += ['mbuf', 'port', 'lpm', 'hash']
+
+if arch_subdir == 'x86'
+	headers += files('rte_lru_x86.h')
+endif
+
+if dpdk_conf.has('RTE_LIBRTE_ACL')
+	sources += files('rte_table_acl.c')
+	headers += files('rte_table_acl.h')
+	deps += ['acl']
+endif
diff --git a/lib/librte_timer/meson.build b/lib/librte_timer/meson.build
new file mode 100644
index 000000000..0edc45772
--- /dev/null
+++ b/lib/librte_timer/meson.build
@@ -0,0 +1,33 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation.
+#   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')
diff --git a/lib/librte_vhost/meson.build b/lib/librte_vhost/meson.build
new file mode 100644
index 000000000..5482169ca
--- /dev/null
+++ b/lib/librte_vhost/meson.build
@@ -0,0 +1,39 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation.
+#   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
+version = 4
+sources = files('fd_man.c', 'socket.c', 'vhost.c', 'vhost_user.c',
+		'virtio_net.c')
+headers = files('rte_vhost.h')
+deps += ['ethdev']
diff --git a/lib/meson.build b/lib/meson.build
index 7cafe6666..d814721de 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -29,4 +29,71 @@
 #   (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, and compat, just a header
 subdir('librte_eal')
+subdir('librte_compat')
+
+# process all libraries equally, as far as possible
+# "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.
+libraries = ['ring', 'mempool', 'mbuf', 'net', 'ether', # core
+	'metrics', # bitrate/latency stats depends on this
+	'hash',    # efd depends on this
+	'kvargs',  # cryptodev depends on this
+	'acl', 'bitratestats', 'cfgfile', 'cmdline', 'cryptodev',
+	'distributor', 'efd', 'eventdev', 'gro', 'ip_frag', 'jobstats',
+	'kni', 'latencystats', 'lpm', 'meter', 'power', 'pdump',
+	'reorder', 'sched', 'timer', 'vhost',
+	# add pkt framework libs which use other libs from above
+	'port', 'table', 'pipeline']
+
+foreach l:libraries
+	build = true
+	name = l
+	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 = ['eal']
+	ext_deps = []
+
+	dir_name = 'librte_' + l
+	subdir(dir_name)
+
+	if build
+		dpdk_conf.set('RTE_LIBRTE_' + name.to_upper(), 1)
+		install_headers(headers)
+
+		dep_objs = ext_deps
+		foreach d:deps
+			dep_objs += [get_variable('dep_rte_' + d)]
+		endforeach
+
+		version_map = '@0@/@1@/rte_@2@_version.map'.format(
+				meson.current_source_dir(), dir_name, name)
+		libname = 'rte_' + name
+		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,
+				link_depends: version_map,
+				version: '@0@.1'.format(version),
+				install: true)
+		dep = declare_dependency(link_with: lib,
+				include_directories: include_directories(dir_name),
+				dependencies: dep_objs)
+		set_variable('dep_' + libname, dep)
+
+		dpdk_libraries = [lib] + dpdk_libraries
+	endif
+endforeach
-- 
2.13.5

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

* [PATCH v3 05/17] build: add buildtools to meson build
  2017-09-13 14:12   ` [PATCH v3 " Bruce Richardson
                       ` (3 preceding siblings ...)
  2017-09-13 14:12     ` [PATCH v3 04/17] build: add DPDK libraries to build Bruce Richardson
@ 2017-09-13 14:12     ` Bruce Richardson
  2017-09-13 14:12     ` [PATCH v3 06/17] build: add infrastructure for building PMDs Bruce Richardson
                       ` (12 subsequent siblings)
  17 siblings, 0 replies; 107+ messages in thread
From: Bruce Richardson @ 2017-09-13 14:12 UTC (permalink / raw)
  To: dev
  Cc: nhorman, luca.boccassi, harry.van.haaren, keith.wiles, Bruce Richardson

Add the buildtools folder, and more specifically the pmdinfogen binary to
the meson and ninja build. This will be needed for building the PMDs in the
driver folder later, as the pmd info output from the tool needs to be
included in those libs.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 buildtools/gen-pmdinfo-cfile.sh   | 41 +++++++++++++++++++++++++++++++++++++++
 buildtools/meson.build            | 34 ++++++++++++++++++++++++++++++++
 buildtools/pmdinfogen/meson.build | 36 ++++++++++++++++++++++++++++++++++
 meson.build                       |  1 +
 4 files changed, 112 insertions(+)
 create mode 100755 buildtools/gen-pmdinfo-cfile.sh
 create mode 100644 buildtools/meson.build
 create mode 100644 buildtools/pmdinfogen/meson.build

diff --git a/buildtools/gen-pmdinfo-cfile.sh b/buildtools/gen-pmdinfo-cfile.sh
new file mode 100755
index 000000000..6441613ac
--- /dev/null
+++ b/buildtools/gen-pmdinfo-cfile.sh
@@ -0,0 +1,41 @@
+#! /bin/sh
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation.
+#   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.
+
+
+arfile=$1
+output=$2
+pmdinfogen=$3
+
+tmp_o=${output%.c.pmd.c}.tmp.o
+
+ar p $arfile > $tmp_o && \
+		$pmdinfogen $tmp_o $output
diff --git a/buildtools/meson.build b/buildtools/meson.build
new file mode 100644
index 000000000..4537e4d3b
--- /dev/null
+++ b/buildtools/meson.build
@@ -0,0 +1,34 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation.
+#   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')
+
+pmdinfo = find_program('gen-pmdinfo-cfile.sh')
diff --git a/buildtools/pmdinfogen/meson.build b/buildtools/pmdinfogen/meson.build
new file mode 100644
index 000000000..843afba7c
--- /dev/null
+++ b/buildtools/pmdinfogen/meson.build
@@ -0,0 +1,36 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation.
+#   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.
+
+pmdinfogen = executable('pmdinfogen',
+	'pmdinfogen.c',
+	include_directories: eal_inc,
+	native: true,
+	c_args: cflags)
diff --git a/meson.build b/meson.build
index f62f64c31..db9c1631f 100644
--- a/meson.build
+++ b/meson.build
@@ -59,6 +59,7 @@ subdir('config')
 
 # build libs and (TODO) drivers
 subdir('lib')
+subdir('buildtools')
 
 # TODO build binaries and installable tools
 
-- 
2.13.5

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

* [PATCH v3 06/17] build: add infrastructure for building PMDs
  2017-09-13 14:12   ` [PATCH v3 " Bruce Richardson
                       ` (4 preceding siblings ...)
  2017-09-13 14:12     ` [PATCH v3 05/17] build: add buildtools to meson build Bruce Richardson
@ 2017-09-13 14:12     ` Bruce Richardson
  2017-09-13 14:12     ` [PATCH v3 07/17] drivers/mempool: add SW mempool drivers to meson build Bruce Richardson
                       ` (11 subsequent siblings)
  17 siblings, 0 replies; 107+ messages in thread
From: Bruce Richardson @ 2017-09-13 14:12 UTC (permalink / raw)
  To: dev
  Cc: nhorman, luca.boccassi, harry.van.haaren, keith.wiles, Bruce Richardson

Add in the top-level drivers meson.build file to start adding in building
of PMDs. Since all PMDs are built in pretty much the same way, the logic
for building each PMD, including extracting the pmdinfo, is included in the
top level build file. This means that each individual driver class only
needs to specify its default dependencies and a few naming conventions, and
each driver only needs to specify it's source files, headers, etc.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 drivers/meson.build | 121 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 meson.build         |   3 +-
 2 files changed, 123 insertions(+), 1 deletion(-)
 create mode 100644 drivers/meson.build

diff --git a/drivers/meson.build b/drivers/meson.build
new file mode 100644
index 000000000..3e5046fe1
--- /dev/null
+++ b/drivers/meson.build
@@ -0,0 +1,121 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation.
+#   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.
+
+driver_classes = []
+
+foreach class:driver_classes
+	drivers = []
+	std_deps = []
+	config_flag_fmt = '' # format string used to set the value in dpdk_conf
+	driver_name_fmt = '' # format string for driver name, used to name
+	                     # the library, the dependency and to find the
+	                     # version file for linking
+
+	subdir(class)
+
+	foreach drv:drivers
+		drv_path = join_paths(class, drv)
+
+		# 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_path)]
+		# 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 = []
+		pkgconfig_extra_libs = []
+
+		# pull in driver directory which should assign to each of the above
+		subdir(drv_path)
+
+		if build
+			dpdk_conf.set(config_flag_fmt.format(drv.to_upper()),1)
+
+			# get dependency objs from strings
+			dep_objs = []
+			foreach d:deps
+				dep_objs += [get_variable('dep_rte_' + d)]
+			endforeach
+			dep_objs += ext_deps
+			dpdk_extra_ldflags += pkgconfig_extra_libs
+
+			# generate pmdinfo sources
+			pmdinfogen_srcs = run_command('grep', '--files-with-matches',
+				'RTE_PMD_REGISTER_.*(.*)', sources).stdout().strip().split()
+			foreach src: pmdinfogen_srcs
+				out_filename = '@0@.pmd.c'.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 = driver_name_fmt.format(drv)
+			version_map = '@0@/@1@/@2@_version.map'.format(
+					meson.current_source_dir(),
+					drv_path, drv_name)
+			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: '@0@.1'.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_@0@'.format(drv_name),
+					declare_dependency(link_with: lib,
+					include_directories: includes,
+					dependencies: dep_objs))
+		endif # build
+	endforeach
+endforeach
diff --git a/meson.build b/meson.build
index db9c1631f..ec4f1391a 100644
--- a/meson.build
+++ b/meson.build
@@ -57,9 +57,10 @@ endif
 global_inc = include_directories('.', 'config')
 subdir('config')
 
-# build libs and (TODO) drivers
+# build libs and drivers
 subdir('lib')
 subdir('buildtools')
+subdir('drivers')
 
 # TODO build binaries and installable tools
 
-- 
2.13.5

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

* [PATCH v3 07/17] drivers/mempool: add SW mempool drivers to meson build
  2017-09-13 14:12   ` [PATCH v3 " Bruce Richardson
                       ` (5 preceding siblings ...)
  2017-09-13 14:12     ` [PATCH v3 06/17] build: add infrastructure for building PMDs Bruce Richardson
@ 2017-09-13 14:12     ` Bruce Richardson
  2017-09-13 14:12     ` [PATCH v3 08/17] drivers/crypto: add crypto drv class and null PMD to meson Bruce Richardson
                       ` (10 subsequent siblings)
  17 siblings, 0 replies; 107+ messages in thread
From: Bruce Richardson @ 2017-09-13 14:12 UTC (permalink / raw)
  To: dev
  Cc: nhorman, luca.boccassi, harry.van.haaren, keith.wiles, Bruce Richardson

With build infrastructure in place, add in mempool drivers to the build.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 drivers/mempool/meson.build       | 35 +++++++++++++++++++++++++++++++++++
 drivers/mempool/ring/meson.build  | 32 ++++++++++++++++++++++++++++++++
 drivers/mempool/stack/meson.build | 32 ++++++++++++++++++++++++++++++++
 drivers/meson.build               |  2 +-
 4 files changed, 100 insertions(+), 1 deletion(-)
 create mode 100644 drivers/mempool/meson.build
 create mode 100644 drivers/mempool/ring/meson.build
 create mode 100644 drivers/mempool/stack/meson.build

diff --git a/drivers/mempool/meson.build b/drivers/mempool/meson.build
new file mode 100644
index 000000000..c1bda9783
--- /dev/null
+++ b/drivers/mempool/meson.build
@@ -0,0 +1,35 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation.
+#   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.
+
+drivers = ['ring', 'stack']
+std_deps = ['mempool']
+config_flag_fmt = 'RTE_LIBRTE_@0@_MEMPOOL'
+driver_name_fmt = 'rte_mempool_@0@'
diff --git a/drivers/mempool/ring/meson.build b/drivers/mempool/ring/meson.build
new file mode 100644
index 000000000..7a988f0a2
--- /dev/null
+++ b/drivers/mempool/ring/meson.build
@@ -0,0 +1,32 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation.
+#   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')
diff --git a/drivers/mempool/stack/meson.build b/drivers/mempool/stack/meson.build
new file mode 100644
index 000000000..7b690b68d
--- /dev/null
+++ b/drivers/mempool/stack/meson.build
@@ -0,0 +1,32 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation.
+#   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')
diff --git a/drivers/meson.build b/drivers/meson.build
index 3e5046fe1..d8f11aa68 100644
--- a/drivers/meson.build
+++ b/drivers/meson.build
@@ -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.
 
-driver_classes = []
+driver_classes = ['mempool']
 
 foreach class:driver_classes
 	drivers = []
-- 
2.13.5

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

* [PATCH v3 08/17] drivers/crypto: add crypto drv class and null PMD to meson
  2017-09-13 14:12   ` [PATCH v3 " Bruce Richardson
                       ` (6 preceding siblings ...)
  2017-09-13 14:12     ` [PATCH v3 07/17] drivers/mempool: add SW mempool drivers to meson build Bruce Richardson
@ 2017-09-13 14:12     ` Bruce Richardson
  2017-09-13 14:12     ` [PATCH v3 09/17] crypto/openssl: add driver to meson build Bruce Richardson
                       ` (9 subsequent siblings)
  17 siblings, 0 replies; 107+ messages in thread
From: Bruce Richardson @ 2017-09-13 14:12 UTC (permalink / raw)
  To: dev
  Cc: nhorman, luca.boccassi, harry.van.haaren, keith.wiles, Bruce Richardson

Add in a crypto driver class, and implement compiling the null crypto
instance.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 drivers/crypto/meson.build      | 35 +++++++++++++++++++++++++++++++++++
 drivers/crypto/null/meson.build | 33 +++++++++++++++++++++++++++++++++
 drivers/meson.build             | 13 +++++++------
 3 files changed, 75 insertions(+), 6 deletions(-)
 create mode 100644 drivers/crypto/meson.build
 create mode 100644 drivers/crypto/null/meson.build

diff --git a/drivers/crypto/meson.build b/drivers/crypto/meson.build
new file mode 100644
index 000000000..c84a9d522
--- /dev/null
+++ b/drivers/crypto/meson.build
@@ -0,0 +1,35 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation.
+#   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.
+
+drivers = ['null']
+std_deps = ['cryptodev'] # cryptodev pulls in all other needed deps
+config_flag_fmt = 'RTE_LIBRTE_@0@_PMD'
+driver_name_fmt = 'rte_pmd_@0@'
diff --git a/drivers/crypto/null/meson.build b/drivers/crypto/null/meson.build
new file mode 100644
index 000000000..ea08f783c
--- /dev/null
+++ b/drivers/crypto/null/meson.build
@@ -0,0 +1,33 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation.
+#   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.
+
+name = 'null_crypto'
+sources = files('null_crypto_pmd.c', 'null_crypto_pmd_ops.c')
diff --git a/drivers/meson.build b/drivers/meson.build
index d8f11aa68..be87918b2 100644
--- a/drivers/meson.build
+++ b/drivers/meson.build
@@ -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.
 
-driver_classes = ['mempool']
+driver_classes = ['crypto', 'mempool']
 
 foreach class:driver_classes
 	drivers = []
@@ -46,6 +46,7 @@ foreach class:driver_classes
 
 		# set up empty variables used for build
 		build = true # set to false to disable, e.g. missing deps
+		name = drv
 		version = 1
 		sources = []
 		objs = []
@@ -65,7 +66,7 @@ foreach class:driver_classes
 		subdir(drv_path)
 
 		if build
-			dpdk_conf.set(config_flag_fmt.format(drv.to_upper()),1)
+			dpdk_conf.set(config_flag_fmt.format(name.to_upper()),1)
 
 			# get dependency objs from strings
 			dep_objs = []
@@ -92,11 +93,11 @@ foreach class:driver_classes
 			endforeach
 
 			# now build the driver itself, and add to the drivers list
-			drv_name = driver_name_fmt.format(drv)
+			lib_name = driver_name_fmt.format(name)
 			version_map = '@0@/@1@/@2@_version.map'.format(
 					meson.current_source_dir(),
-					drv_path, drv_name)
-			lib = library(drv_name,
+					drv_path, lib_name)
+			lib = library(lib_name,
 				sources,
 				objects: objs,
 				include_directories: includes,
@@ -112,7 +113,7 @@ foreach class:driver_classes
 
 			# 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_@0@'.format(drv_name),
+			set_variable('dep_@0@'.format(lib_name),
 					declare_dependency(link_with: lib,
 					include_directories: includes,
 					dependencies: dep_objs))
-- 
2.13.5

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

* [PATCH v3 09/17] crypto/openssl: add driver to meson build
  2017-09-13 14:12   ` [PATCH v3 " Bruce Richardson
                       ` (7 preceding siblings ...)
  2017-09-13 14:12     ` [PATCH v3 08/17] drivers/crypto: add crypto drv class and null PMD to meson Bruce Richardson
@ 2017-09-13 14:12     ` Bruce Richardson
  2017-09-13 14:12     ` [PATCH v3 10/17] crypto/qat: " Bruce Richardson
                       ` (8 subsequent siblings)
  17 siblings, 0 replies; 107+ messages in thread
From: Bruce Richardson @ 2017-09-13 14:12 UTC (permalink / raw)
  To: dev
  Cc: nhorman, luca.boccassi, harry.van.haaren, keith.wiles, Bruce Richardson

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 drivers/crypto/meson.build         |  2 +-
 drivers/crypto/openssl/meson.build | 38 ++++++++++++++++++++++++++++++++++++++
 2 files changed, 39 insertions(+), 1 deletion(-)
 create mode 100644 drivers/crypto/openssl/meson.build

diff --git a/drivers/crypto/meson.build b/drivers/crypto/meson.build
index c84a9d522..b9488e761 100644
--- a/drivers/crypto/meson.build
+++ b/drivers/crypto/meson.build
@@ -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 = ['null']
+drivers = ['null', 'openssl']
 std_deps = ['cryptodev'] # cryptodev pulls in all other needed deps
 config_flag_fmt = 'RTE_LIBRTE_@0@_PMD'
 driver_name_fmt = 'rte_pmd_@0@'
diff --git a/drivers/crypto/openssl/meson.build b/drivers/crypto/openssl/meson.build
new file mode 100644
index 000000000..677d16742
--- /dev/null
+++ b/drivers/crypto/openssl/meson.build
@@ -0,0 +1,38 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation.
+#   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.
+
+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 += dep
+pkgconfig_extra_libs += '-lcrypto'
-- 
2.13.5

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

* [PATCH v3 10/17] crypto/qat: add driver to meson build
  2017-09-13 14:12   ` [PATCH v3 " Bruce Richardson
                       ` (8 preceding siblings ...)
  2017-09-13 14:12     ` [PATCH v3 09/17] crypto/openssl: add driver to meson build Bruce Richardson
@ 2017-09-13 14:12     ` Bruce Richardson
  2017-09-13 14:12     ` [PATCH v3 11/17] drivers/net: add net driver support " Bruce Richardson
                       ` (7 subsequent siblings)
  17 siblings, 0 replies; 107+ messages in thread
From: Bruce Richardson @ 2017-09-13 14:12 UTC (permalink / raw)
  To: dev
  Cc: nhorman, luca.boccassi, harry.van.haaren, keith.wiles, Bruce Richardson

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 config/rte_config.h            |  8 ++++++++
 drivers/crypto/meson.build     |  2 +-
 drivers/crypto/qat/meson.build | 41 +++++++++++++++++++++++++++++++++++++++++
 3 files changed, 50 insertions(+), 1 deletion(-)
 create mode 100644 drivers/crypto/qat/meson.build

diff --git a/config/rte_config.h b/config/rte_config.h
index b47cfabae..f2009ac79 100644
--- a/config/rte_config.h
+++ b/config/rte_config.h
@@ -94,4 +94,12 @@
 #define RTE_SCHED_PORT_N_GRINDERS 8
 #undef RTE_SCHED_VECTOR
 
+/****** driver defines ********/
+
+/*
+ * 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_ */
diff --git a/drivers/crypto/meson.build b/drivers/crypto/meson.build
index b9488e761..cacef1c17 100644
--- a/drivers/crypto/meson.build
+++ b/drivers/crypto/meson.build
@@ -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 = ['null', 'openssl']
+drivers = ['qat', 'null', 'openssl']
 std_deps = ['cryptodev'] # cryptodev pulls in all other needed deps
 config_flag_fmt = 'RTE_LIBRTE_@0@_PMD'
 driver_name_fmt = 'rte_pmd_@0@'
diff --git a/drivers/crypto/qat/meson.build b/drivers/crypto/qat/meson.build
new file mode 100644
index 000000000..0ff431064
--- /dev/null
+++ b/drivers/crypto/qat/meson.build
@@ -0,0 +1,41 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation.
+#   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.
+
+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 += dep
+pkgconfig_extra_libs += '-lcrypto'
-- 
2.13.5

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

* [PATCH v3 11/17] drivers/net: add net driver support to meson build
  2017-09-13 14:12   ` [PATCH v3 " Bruce Richardson
                       ` (9 preceding siblings ...)
  2017-09-13 14:12     ` [PATCH v3 10/17] crypto/qat: " Bruce Richardson
@ 2017-09-13 14:12     ` Bruce Richardson
  2017-09-13 14:12     ` [PATCH v3 12/17] drivers/net: add set of vdev PMDs to build Bruce Richardson
                       ` (6 subsequent siblings)
  17 siblings, 0 replies; 107+ messages in thread
From: Bruce Richardson @ 2017-09-13 14:12 UTC (permalink / raw)
  To: dev
  Cc: nhorman, luca.boccassi, harry.van.haaren, keith.wiles, Bruce Richardson

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 drivers/meson.build     |  2 +-
 drivers/net/meson.build | 35 +++++++++++++++++++++++++++++++++++
 2 files changed, 36 insertions(+), 1 deletion(-)
 create mode 100644 drivers/net/meson.build

diff --git a/drivers/meson.build b/drivers/meson.build
index be87918b2..f19da16fb 100644
--- a/drivers/meson.build
+++ b/drivers/meson.build
@@ -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.
 
-driver_classes = ['crypto', 'mempool']
+driver_classes = ['crypto', 'mempool', 'net']
 
 foreach class:driver_classes
 	drivers = []
diff --git a/drivers/net/meson.build b/drivers/net/meson.build
new file mode 100644
index 000000000..d760069fb
--- /dev/null
+++ b/drivers/net/meson.build
@@ -0,0 +1,35 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation.
+#   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.
+
+drivers = []
+std_deps = ['ethdev', 'kvargs'] # 'ethdev' also pulls in mbuf, net, eal etc
+config_flag_fmt = 'RTE_LIBRTE_@0@_PMD'
+driver_name_fmt = 'rte_pmd_@0@'
-- 
2.13.5

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

* [PATCH v3 12/17] drivers/net: add set of vdev PMDs to build
  2017-09-13 14:12   ` [PATCH v3 " Bruce Richardson
                       ` (10 preceding siblings ...)
  2017-09-13 14:12     ` [PATCH v3 11/17] drivers/net: add net driver support " Bruce Richardson
@ 2017-09-13 14:12     ` Bruce Richardson
  2017-09-13 14:12     ` [PATCH v3 13/17] drivers/net: add drivers for Intel NICs to meson build Bruce Richardson
                       ` (5 subsequent siblings)
  17 siblings, 0 replies; 107+ messages in thread
From: Bruce Richardson @ 2017-09-13 14:12 UTC (permalink / raw)
  To: dev
  Cc: nhorman, luca.boccassi, harry.van.haaren, keith.wiles, Bruce Richardson

Add the af_packet, null, pcap and ring PMDs to the meson build.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 config/rte_config.h               |  4 ++++
 drivers/net/af_packet/meson.build | 35 +++++++++++++++++++++++++++++++++
 drivers/net/meson.build           |  2 +-
 drivers/net/null/meson.build      | 32 ++++++++++++++++++++++++++++++
 drivers/net/pcap/meson.build      | 41 +++++++++++++++++++++++++++++++++++++++
 drivers/net/ring/meson.build      | 33 +++++++++++++++++++++++++++++++
 6 files changed, 146 insertions(+), 1 deletion(-)
 create mode 100644 drivers/net/af_packet/meson.build
 create mode 100644 drivers/net/null/meson.build
 create mode 100644 drivers/net/pcap/meson.build
 create mode 100644 drivers/net/ring/meson.build

diff --git a/config/rte_config.h b/config/rte_config.h
index f2009ac79..79d7e26d9 100644
--- a/config/rte_config.h
+++ b/config/rte_config.h
@@ -102,4 +102,8 @@
  */
 #define RTE_QAT_PMD_MAX_NB_SESSIONS 2048
 
+/* Ring net PMD settings */
+#define RTE_PMD_RING_MAX_RX_RINGS 16
+#define RTE_PMD_RING_MAX_TX_RINGS 16
+
 #endif /* _RTE_CONFIG_H_ */
diff --git a/drivers/net/af_packet/meson.build b/drivers/net/af_packet/meson.build
new file mode 100644
index 000000000..f3607d768
--- /dev/null
+++ b/drivers/net/af_packet/meson.build
@@ -0,0 +1,35 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation.
+#   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('rte_eth_af_packet.c')
diff --git a/drivers/net/meson.build b/drivers/net/meson.build
index d760069fb..9a24bae43 100644
--- a/drivers/net/meson.build
+++ b/drivers/net/meson.build
@@ -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 = []
+drivers = ['af_packet', 'null', 'pcap', 'ring']
 std_deps = ['ethdev', 'kvargs'] # 'ethdev' also pulls in mbuf, net, eal etc
 config_flag_fmt = 'RTE_LIBRTE_@0@_PMD'
 driver_name_fmt = 'rte_pmd_@0@'
diff --git a/drivers/net/null/meson.build b/drivers/net/null/meson.build
new file mode 100644
index 000000000..e90b5c5c7
--- /dev/null
+++ b/drivers/net/null/meson.build
@@ -0,0 +1,32 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation.
+#   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_null.c')
diff --git a/drivers/net/pcap/meson.build b/drivers/net/pcap/meson.build
new file mode 100644
index 000000000..2051ccab0
--- /dev/null
+++ b/drivers/net/pcap/meson.build
@@ -0,0 +1,41 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation.
+#   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.
+
+pcap_dep = dependency('pcap', required: false)
+if pcap_dep.found() == true
+	ext_deps += pcap_dep
+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'
diff --git a/drivers/net/ring/meson.build b/drivers/net/ring/meson.build
new file mode 100644
index 000000000..1ac2c90e7
--- /dev/null
+++ b/drivers/net/ring/meson.build
@@ -0,0 +1,33 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation.
+#   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_ring.c')
+install_headers('rte_eth_ring.h')
-- 
2.13.5

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

* [PATCH v3 13/17] drivers/net: add drivers for Intel NICs to meson build
  2017-09-13 14:12   ` [PATCH v3 " Bruce Richardson
                       ` (11 preceding siblings ...)
  2017-09-13 14:12     ` [PATCH v3 12/17] drivers/net: add set of vdev PMDs to build Bruce Richardson
@ 2017-09-13 14:12     ` Bruce Richardson
  2017-09-13 14:12     ` [PATCH v3 14/17] app/test-pmd: add test-pmd " Bruce Richardson
                       ` (4 subsequent siblings)
  17 siblings, 0 replies; 107+ messages in thread
From: Bruce Richardson @ 2017-09-13 14:12 UTC (permalink / raw)
  To: dev
  Cc: nhorman, luca.boccassi, harry.van.haaren, keith.wiles, Bruce Richardson

Add the e1000, fm10k, i40e and ixgbe drivers to the meson & ninja build.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 config/rte_config.h                | 12 +++++++
 drivers/net/e1000/base/meson.build | 65 ++++++++++++++++++++++++++++++++++++++
 drivers/net/e1000/meson.build      | 44 ++++++++++++++++++++++++++
 drivers/net/fm10k/base/meson.build | 55 ++++++++++++++++++++++++++++++++
 drivers/net/fm10k/meson.build      | 44 ++++++++++++++++++++++++++
 drivers/net/i40e/base/meson.build  | 56 ++++++++++++++++++++++++++++++++
 drivers/net/i40e/meson.build       | 60 +++++++++++++++++++++++++++++++++++
 drivers/net/ixgbe/base/meson.build | 60 +++++++++++++++++++++++++++++++++++
 drivers/net/ixgbe/meson.build      | 58 ++++++++++++++++++++++++++++++++++
 drivers/net/meson.build            |  3 +-
 10 files changed, 456 insertions(+), 1 deletion(-)
 create mode 100644 drivers/net/e1000/base/meson.build
 create mode 100644 drivers/net/e1000/meson.build
 create mode 100644 drivers/net/fm10k/base/meson.build
 create mode 100644 drivers/net/fm10k/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

diff --git a/config/rte_config.h b/config/rte_config.h
index 79d7e26d9..3e26d5118 100644
--- a/config/rte_config.h
+++ b/config/rte_config.h
@@ -102,6 +102,18 @@
  */
 #define RTE_QAT_PMD_MAX_NB_SESSIONS 2048
 
+/* fm10k defines */
+#define RTE_LIBRTE_FM10K_RX_OLFLAGS_ENABLE 1
+
+/* i40e defines */
+#define RTE_LIBRTE_I40E_RX_ALLOW_BULK_ALLOC 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
+
 /* Ring net PMD settings */
 #define RTE_PMD_RING_MAX_RX_RINGS 16
 #define RTE_PMD_RING_MAX_TX_RINGS 16
diff --git a/drivers/net/e1000/base/meson.build b/drivers/net/e1000/base/meson.build
new file mode 100644
index 000000000..9592762c9
--- /dev/null
+++ b/drivers/net/e1000/base/meson.build
@@ -0,0 +1,65 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation.
+#   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 = [
+	'e1000_80003es2lan.c',
+	'e1000_82540.c',
+	'e1000_82541.c',
+	'e1000_82542.c',
+	'e1000_82543.c',
+	'e1000_82571.c',
+	'e1000_82575.c',
+	'e1000_api.c',
+	'e1000_i210.c',
+	'e1000_ich8lan.c',
+	'e1000_mac.c',
+	'e1000_manage.c',
+	'e1000_mbx.c',
+	'e1000_nvm.c',
+	'e1000_osdep.c',
+	'e1000_phy.c',
+	'e1000_vf.c'
+]
+
+error_cflags = ['-Wno-uninitialized', '-Wno-unused-parameter',
+	'-Wno-unused-variable', '-Wno-misleading-indentation',
+	'-Wno-implicit-fallthrough']
+c_args = cflags
+foreach flag: error_cflags
+	if cc.has_argument(flag)
+		c_args += flag
+	endif
+endforeach
+
+base_lib = static_library('e1000_base', sources,
+	dependencies: rte_eal,
+	c_args: c_args)
+base_objs = base_lib.extract_all_objects()
diff --git a/drivers/net/e1000/meson.build b/drivers/net/e1000/meson.build
new file mode 100644
index 000000000..1775e1ba0
--- /dev/null
+++ b/drivers/net/e1000/meson.build
@@ -0,0 +1,44 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation.
+#   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('base')
+objs = [base_objs]
+
+sources = files(
+	'em_ethdev.c',
+	'em_rxtx.c',
+	'igb_ethdev.c',
+	'igb_flow.c',
+	'igb_pf.c',
+	'igb_rxtx.c'
+)
+
+includes += include_directories('base')
diff --git a/drivers/net/fm10k/base/meson.build b/drivers/net/fm10k/base/meson.build
new file mode 100644
index 000000000..e351f96da
--- /dev/null
+++ b/drivers/net/fm10k/base/meson.build
@@ -0,0 +1,55 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation.
+#   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 = [
+	'fm10k_api.c',
+	'fm10k_common.c',
+	'fm10k_mbx.c',
+	'fm10k_pf.c',
+	'fm10k_tlv.c',
+	'fm10k_vf.c'
+]
+
+error_cflags = ['-Wno-unused-parameter', '-Wno-unused-value',
+	'-Wno-strict-aliasing', '-Wno-format-extra-args',
+	'-Wno-unused-variable', '-Wno-missing-field-initializers'
+]
+c_args = cflags
+foreach flag: error_cflags
+	if cc.has_argument(flag)
+		c_args += flag
+	endif
+endforeach
+
+base_lib = static_library('fm10k_base', sources,
+	dependencies: rte_eal,
+	c_args: c_args)
+base_objs = base_lib.extract_all_objects()
diff --git a/drivers/net/fm10k/meson.build b/drivers/net/fm10k/meson.build
new file mode 100644
index 000000000..ebfdd1fb9
--- /dev/null
+++ b/drivers/net/fm10k/meson.build
@@ -0,0 +1,44 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation.
+#   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('base')
+objs = [base_objs]
+
+sources = files(
+	'fm10k_ethdev.c',
+	'fm10k_rxtx.c',
+)
+if arch_subdir == 'x86'
+	dpdk_conf.set('RTE_LIBRTE_FM10K_INC_VECTOR', 1)
+	sources += files('fm10k_rxtx_vec.c')
+endif
+
+includes += include_directories('base')
diff --git a/drivers/net/i40e/base/meson.build b/drivers/net/i40e/base/meson.build
new file mode 100644
index 000000000..2eae30fc7
--- /dev/null
+++ b/drivers/net/i40e/base/meson.build
@@ -0,0 +1,56 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation.
+#   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 = [
+	'i40e_adminq.c',
+	'i40e_common.c',
+	'i40e_dcb.c',
+	'i40e_diag.c',
+	'i40e_hmc.c',
+	'i40e_lan_hmc.c',
+	'i40e_nvm.c'
+]
+
+error_cflags = ['-Wno-sign-compare', '-Wno-unused-value',
+		'-Wno-format', '-Wno-unused-but-set-variable',
+		'-Wno-strict-aliasing'
+]
+c_args = cflags
+foreach flag: error_cflags
+	if cc.has_argument(flag)
+		c_args += flag
+	endif
+endforeach
+
+base_lib = static_library('i40e_base', sources,
+	dependencies: rte_eal,
+	c_args: c_args)
+base_objs = base_lib.extract_all_objects()
diff --git a/drivers/net/i40e/meson.build b/drivers/net/i40e/meson.build
new file mode 100644
index 000000000..dc5e59d19
--- /dev/null
+++ b/drivers/net/i40e/meson.build
@@ -0,0 +1,60 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation.
+#   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.
+
+cflags = ['-DPF_DRIVER',
+	'-DVF_DRIVER',
+	'-DINTEGRATED_VF',
+	'-DX722_A0_SUPPORT']
+
+subdir('base')
+objs = [base_objs]
+
+sources = files(
+	'i40e_ethdev.c',
+	'i40e_rxtx.c',
+	'i40e_ethdev_vf.c',
+	'i40e_pf.c',
+	'i40e_fdir.c',
+	'i40e_flow.c',
+	'i40e_tm.c',
+	'rte_pmd_i40e.c'
+	)
+
+deps += ['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')
+
+install_headers('rte_pmd_i40e.h')
diff --git a/drivers/net/ixgbe/base/meson.build b/drivers/net/ixgbe/base/meson.build
new file mode 100644
index 000000000..5a3d73311
--- /dev/null
+++ b/drivers/net/ixgbe/base/meson.build
@@ -0,0 +1,60 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation.
+#   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)
+base_objs = base_lib.extract_all_objects()
diff --git a/drivers/net/ixgbe/meson.build b/drivers/net/ixgbe/meson.build
new file mode 100644
index 000000000..8de42d56d
--- /dev/null
+++ b/drivers/net/ixgbe/meson.build
@@ -0,0 +1,58 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation.
+#   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.
+
+cflags = ['-DRTE_LIBRTE_IXGBE_BYPASS']
+
+subdir('base')
+objs = [base_objs]
+
+sources = files(
+	'ixgbe_82599_bypass.c',
+	'ixgbe_bypass.c',
+	'ixgbe_ethdev.c',
+	'ixgbe_fdir.c',
+	'ixgbe_flow.c',
+	'ixgbe_pf.c',
+	'ixgbe_rxtx.c',
+	'ixgbe_tm.c',
+	'rte_pmd_ixgbe.c'
+)
+
+deps += ['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')
+
+install_headers('rte_pmd_ixgbe.h')
diff --git a/drivers/net/meson.build b/drivers/net/meson.build
index 9a24bae43..d07b38b19 100644
--- a/drivers/net/meson.build
+++ b/drivers/net/meson.build
@@ -29,7 +29,8 @@
 #   (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 = ['af_packet', 'null', 'pcap', 'ring']
+drivers = ['af_packet', 'e1000', 'fm10k', 'i40e', 'ixgbe',
+	'null', 'pcap', 'ring']
 std_deps = ['ethdev', 'kvargs'] # 'ethdev' also pulls in mbuf, net, eal etc
 config_flag_fmt = 'RTE_LIBRTE_@0@_PMD'
 driver_name_fmt = 'rte_pmd_@0@'
-- 
2.13.5

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

* [PATCH v3 14/17] app/test-pmd: add test-pmd to meson build
  2017-09-13 14:12   ` [PATCH v3 " Bruce Richardson
                       ` (12 preceding siblings ...)
  2017-09-13 14:12     ` [PATCH v3 13/17] drivers/net: add drivers for Intel NICs to meson build Bruce Richardson
@ 2017-09-13 14:12     ` Bruce Richardson
  2017-09-13 14:12     ` [PATCH v3 15/17] usertools: add usertools installation " Bruce Richardson
                       ` (3 subsequent siblings)
  17 siblings, 0 replies; 107+ messages in thread
From: Bruce Richardson @ 2017-09-13 14:12 UTC (permalink / raw)
  To: dev
  Cc: nhorman, luca.boccassi, harry.van.haaren, keith.wiles, Bruce Richardson

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 app/meson.build          | 32 +++++++++++++++++++++
 app/test-pmd/meson.build | 74 ++++++++++++++++++++++++++++++++++++++++++++++++
 meson.build              |  3 +-
 3 files changed, 108 insertions(+), 1 deletion(-)
 create mode 100644 app/meson.build
 create mode 100644 app/test-pmd/meson.build

diff --git a/app/meson.build b/app/meson.build
new file mode 100644
index 000000000..da8b631f4
--- /dev/null
+++ b/app/meson.build
@@ -0,0 +1,32 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation.
+#   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')
diff --git a/app/test-pmd/meson.build b/app/test-pmd/meson.build
new file mode 100644
index 000000000..a374771bf
--- /dev/null
+++ b/app/test-pmd/meson.build
@@ -0,0 +1,74 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation.
+#   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('cmdline.c',
+	'cmdline_flow.c',
+	'config.c',
+	'csumonly.c',
+	'flowgen.c',
+	'icmpecho.c',
+	'ieee1588fwd.c',
+	'iofwd.c',
+	'macfwd.c',
+	'macswap.c',
+	'parameters.c',
+	'rxonly.c',
+	'testpmd.c',
+	'txonly.c')
+
+deps = ['ethdev', 'gro', 'cmdline', 'metrics']
+if dpdk_conf.has('RTE_LIBRTE_PDUMP')
+	deps += 'pdump'
+endif
+if dpdk_conf.has('RTE_LIBRTE_I40E_PMD')
+	deps += 'pmd_i40e'
+endif
+if dpdk_conf.has('RTE_LIBRTE_IXGBE_PMD')
+	deps += 'pmd_ixgbe'
+endif
+
+dep_objs = []
+foreach d:deps
+	dep_objs += get_variable('dep_rte_' + d)
+endforeach
+
+link_libs = []
+if get_option('default_library') == 'static'
+	link_libs = dpdk_drivers
+endif
+
+executable('dpdk-testpmd',
+	sources,
+	link_whole: link_libs,
+	dependencies: dep_objs,
+	link_args: eal_extra_link_arg, # add -ldl for linux, -lexecinfo for BSD
+	install_rpath: driver_install_path,
+	install: true)
diff --git a/meson.build b/meson.build
index ec4f1391a..0476c4711 100644
--- a/meson.build
+++ b/meson.build
@@ -62,7 +62,8 @@ subdir('lib')
 subdir('buildtools')
 subdir('drivers')
 
-# TODO build binaries and installable tools
+# build binaries and (TODO) installable tools
+subdir('app')
 
 # write the build config
 build_cfg = 'rte_build_config.h'
-- 
2.13.5

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

* [PATCH v3 15/17] usertools: add usertools installation to meson build
  2017-09-13 14:12   ` [PATCH v3 " Bruce Richardson
                       ` (13 preceding siblings ...)
  2017-09-13 14:12     ` [PATCH v3 14/17] app/test-pmd: add test-pmd " Bruce Richardson
@ 2017-09-13 14:12     ` Bruce Richardson
  2017-09-13 14:12     ` [PATCH v3 16/17] build: add option to version libs using DPDK version Bruce Richardson
                       ` (2 subsequent siblings)
  17 siblings, 0 replies; 107+ messages in thread
From: Bruce Richardson @ 2017-09-13 14:12 UTC (permalink / raw)
  To: dev
  Cc: nhorman, luca.boccassi, harry.van.haaren, keith.wiles, Bruce Richardson

Have the "usertools" scripts installed when doing a DPDK install using
ninja. They will be copies to $prefix/bin, generally /usr/local/bin,
alongside testpmd.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 meson.build           |  3 ++-
 usertools/meson.build | 32 ++++++++++++++++++++++++++++++++
 2 files changed, 34 insertions(+), 1 deletion(-)
 create mode 100644 usertools/meson.build

diff --git a/meson.build b/meson.build
index 0476c4711..6ad3e8053 100644
--- a/meson.build
+++ b/meson.build
@@ -62,7 +62,8 @@ subdir('lib')
 subdir('buildtools')
 subdir('drivers')
 
-# build binaries and (TODO) installable tools
+# build binaries and installable tools
+subdir('usertools')
 subdir('app')
 
 # write the build config
diff --git a/usertools/meson.build b/usertools/meson.build
new file mode 100644
index 000000000..c5452e3fc
--- /dev/null
+++ b/usertools/meson.build
@@ -0,0 +1,32 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 Intel Corporation.
+#   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')
-- 
2.13.5

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

* [PATCH v3 16/17] build: add option to version libs using DPDK version
  2017-09-13 14:12   ` [PATCH v3 " Bruce Richardson
                       ` (14 preceding siblings ...)
  2017-09-13 14:12     ` [PATCH v3 15/17] usertools: add usertools installation " Bruce Richardson
@ 2017-09-13 14:12     ` Bruce Richardson
  2017-09-13 14:12     ` [PATCH v3 17/17] doc: add documentation on how to add new components to DPDK Bruce Richardson
  2017-09-13 17:01     ` [PATCH v3 00/17] build DPDK libs and some drivers with meson/ninja Luca Boccassi
  17 siblings, 0 replies; 107+ messages in thread
From: Bruce Richardson @ 2017-09-13 14:12 UTC (permalink / raw)
  To: dev
  Cc: nhorman, luca.boccassi, harry.van.haaren, keith.wiles, Bruce Richardson

Normally, each library has it's own version number based on the ABI.
Add an option to have all libs just use the DPDK version number as the
.so version.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 drivers/meson.build                     | 13 ++++++++++++-
 lib/librte_eal/bsdapp/eal/meson.build   | 12 +++++++++++-
 lib/librte_eal/linuxapp/eal/meson.build | 12 +++++++++++-
 lib/meson.build                         | 12 +++++++++++-
 meson_options.txt                       |  1 +
 5 files changed, 46 insertions(+), 4 deletions(-)

diff --git a/drivers/meson.build b/drivers/meson.build
index f19da16fb..3ea42b04b 100644
--- a/drivers/meson.build
+++ b/drivers/meson.build
@@ -92,6 +92,16 @@ foreach class:driver_classes
 						depends: [pmdinfogen, tmp_lib])
 			endforeach
 
+			if get_option('per_library_versions')
+				lib_version = '@0@.1'.format(version)
+				so_version = '@0@'.format(version)
+			else
+				pver = meson.project_version().split('.')
+				lib_version = '@0@.@1@'.format(pver.get(0),
+						pver.get(1))
+				so_version = lib_version
+			endif
+
 			# now build the driver itself, and add to the drivers list
 			lib_name = driver_name_fmt.format(name)
 			version_map = '@0@/@1@/@2@_version.map'.format(
@@ -105,7 +115,8 @@ foreach class:driver_classes
 				c_args: cflags,
 				link_args: '-Wl,--version-script=' + version_map,
 				link_depends: version_map,
-				version: '@0@.1'.format(version),
+				version: lib_version,
+				soversion: so_version,
 				install: true,
 				install_dir: driver_install_path)
 
diff --git a/lib/librte_eal/bsdapp/eal/meson.build b/lib/librte_eal/bsdapp/eal/meson.build
index 00973122a..f6c43fd44 100644
--- a/lib/librte_eal/bsdapp/eal/meson.build
+++ b/lib/librte_eal/bsdapp/eal/meson.build
@@ -46,11 +46,21 @@ sources = ['eal_alarm.c',
 
 eal_extra_link_arg = '-lexecinfo'
 
+if get_option('per_library_versions')
+	lib_version = '@0@.1'.format(version)
+	so_version = '@0@'.format(version)
+else
+	pver = meson.project_version().split('.')
+	lib_version = '@0@.@1@'.format(pver.get(0), pver.get(1))
+	so_version = lib_version
+endif
+
 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: '@0@.1'.format(version),
+			version: lib_version,
+			soversion: so_version,
 			c_args: '-D_GNU_SOURCE',
 			link_depends: version_map,
 			link_args: [eal_extra_link_arg,
diff --git a/lib/librte_eal/linuxapp/eal/meson.build b/lib/librte_eal/linuxapp/eal/meson.build
index e7daed499..bffbd7e66 100644
--- a/lib/librte_eal/linuxapp/eal/meson.build
+++ b/lib/librte_eal/linuxapp/eal/meson.build
@@ -51,11 +51,21 @@ sources = ['eal_alarm.c',
 
 eal_extra_link_arg = '-ldl'
 
+if get_option('per_library_versions')
+	lib_version = '@0@.1'.format(version)
+	so_version = '@0@'.format(version)
+else
+	pver = meson.project_version().split('.')
+	lib_version = '@0@.@1@'.format(pver.get(0), pver.get(1))
+	so_version = lib_version
+endif
+
 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: '@0@.1'.format(version),
+			version: lib_version,
+			soversion: so_version,
 			c_args: '-D_GNU_SOURCE',
 			link_depends: version_map,
 			link_args: [eal_extra_link_arg,
diff --git a/lib/meson.build b/lib/meson.build
index d814721de..5244fe4a5 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -76,6 +76,15 @@ foreach l:libraries
 			dep_objs += [get_variable('dep_rte_' + d)]
 		endforeach
 
+		if get_option('per_library_versions')
+			lib_version = '@0@.1'.format(version)
+			so_version = '@0@'.format(version)
+		else
+			pver = meson.project_version().split('.')
+			lib_version = '@0@.@1@'.format(pver.get(0), pver.get(1))
+			so_version = lib_version
+		endif
+
 		version_map = '@0@/@1@/rte_@2@_version.map'.format(
 				meson.current_source_dir(), dir_name, name)
 		libname = 'rte_' + name
@@ -87,7 +96,8 @@ foreach l:libraries
 				include_directories: include_directories(dir_name),
 				link_args: '-Wl,--version-script=' + version_map,
 				link_depends: version_map,
-				version: '@0@.1'.format(version),
+				version: lib_version,
+				soversion: so_version,
 				install: true)
 		dep = declare_dependency(link_with: lib,
 				include_directories: include_directories(dir_name),
diff --git a/meson_options.txt b/meson_options.txt
index 9c45b8159..636226ce8 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -6,3 +6,4 @@ 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')
 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')
+option('per_library_versions', type: 'boolean', value: true, description: 'true: each lib gets its own version number, false: DPDK version used for each lib')
-- 
2.13.5

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

* [PATCH v3 17/17] doc: add documentation on how to add new components to DPDK
  2017-09-13 14:12   ` [PATCH v3 " Bruce Richardson
                       ` (15 preceding siblings ...)
  2017-09-13 14:12     ` [PATCH v3 16/17] build: add option to version libs using DPDK version Bruce Richardson
@ 2017-09-13 14:12     ` Bruce Richardson
  2017-09-13 17:01     ` [PATCH v3 00/17] build DPDK libs and some drivers with meson/ninja Luca Boccassi
  17 siblings, 0 replies; 107+ messages in thread
From: Bruce Richardson @ 2017-09-13 14:12 UTC (permalink / raw)
  To: dev
  Cc: nhorman, luca.boccassi, harry.van.haaren, keith.wiles, Bruce Richardson

Add to the contributors guide details on how to add libraries and drivers
and integrate them with the DPDK build system(s).

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 doc/guides/contributing/coding_style.rst | 214 +++++++++++++++++++++++++++++++
 1 file changed, 214 insertions(+)

diff --git a/doc/guides/contributing/coding_style.rst b/doc/guides/contributing/coding_style.rst
index d8e4a0f9c..3c59cbca5 100644
--- a/doc/guides/contributing/coding_style.rst
+++ b/doc/guides/contributing/coding_style.rst
@@ -702,3 +702,217 @@ All Python code should work with Python 2.7+ and 3.2+ and be compliant with
 `PEP8 (Style Guide for Python Code) <https://www.python.org/dev/peps/pep-0008/>`_.
 
 The ``pep8`` tool can be used for testing compliance with the guidelines.
+
+Integrating with the Build System
+---------------------------------
+
+DPDK supports being built in two different ways:
+
+* using ``make`` - or more specifically "GNU make", i.e. ``gmake`` on FreeBSD
+* using the tools ``meson`` and ``ninja``
+
+Any new library or driver to be integrated into DPDK should support being
+built with both systems. While building using ``make`` is a legacy approach, and
+most build-system enhancements are being done using ``meson`` and ``ninja``
+there are no plans at this time to deprecate the legacy ``make`` build system.
+
+Therefore all new component additions should include both a ``Makefile`` and a
+``meson.build`` file, and should be added to the component lists in both the
+``Makefile`` and ``meson.build`` files in the relevant top-level directory:
+either ``lib`` directory or a ``driver`` subdirectory.
+
+Makefile Contents
+~~~~~~~~~~~~~~~~~
+
+The ``Makefile`` for the component should be of the following format, where
+``<name>`` corresponds to the name of the library in question, e.g. hash,
+lpm, etc. For drivers, the same format of Makefile is used.
+
+.. code-block:: makefile
+
+	# pull in basic DPDK definitions, including whether library is to be
+	# built or not
+	include $(RTE_SDK)/mk/rte.vars.mk
+
+	# library name
+	LIB = librte_<name>.a
+
+	# any library cflags needed. Generally add "-O3 $(WERROR_FLAGS)"
+	CFLAGS += -O3
+	CFLAGS += $(WERROR_FLAGS)
+
+	# the symbol version information for the library, and .so version
+	EXPORT_MAP := rte_<name>_version.map
+	LIBABIVER := 1
+
+	# all source filenames are stored in SRCS-y
+	SRCS-$(CONFIG_RTE_LIBRTE_<NAME>) += rte_<name>.c
+
+	# install includes
+	SYMLINK-$(CONFIG_RTE_LIBRTE_<NAME>)-include += rte_<name>.h
+
+	# pull in rules to build the library
+	include $(RTE_SDK)/mk/rte.lib.mk
+
+Meson Build File Contents - Libraries
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+The ``meson.build`` file for a new DPDK library should be of the following basic
+format.
+
+.. code-block:: python
+
+	sources = files('file1.c', ...)
+	headers = files('file1.c', ...)
+
+
+The will build based on a number of conventions and assumptions within the DPDK
+itself, for example, that the library name is the same as the directory name in
+which the files are stored.
+
+For a library ``meson.build`` file, there are number of variables which can be
+set, some mandatory, others optional. The mandatory fields are:
+
+sources
+	**Default Value = []**.
+	This variable should list out the files to be compiled up to create the
+	library. Files must be specified using the meson ``files()`` function.
+
+
+The optional fields are:
+
+build
+	**Default Value = true.**
+	Used to optionally compile a library, based on its dependencies or
+	environment. A simple example of use would be:
+
+.. code-block:: python
+
+	if host_machine.system() != 'linux'
+	        build = false
+	endif
+
+
+cflags
+	**Default Value = []**.
+	Used to specify any additional cflags that need to be passed to compile
+	the sources in the library.
+
+deps
+	**Default Value = ['eal']**.
+	Used to list the internal library dependencies of the library. It should
+	be assigned to using ``+=`` rather than overwriting using ``=``.  The
+	dependencies should be specified as strings, each one giving the name of
+	a DPDK library, without the ``librte_`` prefix. Dependencies are handled
+	recursively, so specifying e.g. ``mempool``, will automatically also
+	make the library depend upon the mempool library's dependencies too -
+	``ring`` and ``eal``. For libraries that only depend upon EAL, this
+	variable may be omitted from the ``meson.build`` file.  For example:
+
+.. code-block:: python
+
+	deps += ['ethdev']
+
+
+ext_deps
+	**Default Value = []**.
+	Used to specify external dependencies of this library. They should be
+	returned as dependency objects, as returned from the meson
+	``dependency()`` or ``find_library()`` functions. Before returning
+	these, they should be checked to ensure the dependencies have been
+	found, and, if not, the ``build`` variable should be set to ``false``.
+	For example:
+
+.. code-block:: python
+
+	my_dep = dependency('libX', required: 'false')
+	if my_dep.found()
+		ext_deps += my_dep
+	else
+		build = false
+	endif
+
+
+headers
+	**Default Value = []**.
+	Used to return the list of header files for the library that should be
+	installed to $PREFIX/include when ``ninja install`` is run. As with
+	source files, these should be specified using the meson ``files()``
+	function.
+
+name
+	**Default Value = library name derived from the directory name**.
+	If a library's .so or .a file differs from that given in the directory
+	name, the name should be specified using this variable. In practice,
+	since the convention is that for a library called ``librte_xyz.so``, the
+	sources are stored in a directory ``lib/librte_xyz``, this value should
+	never be needed for new libraries.
+
+.. note::
+
+	The name value also provides the name used to find the function version
+	map file, as part of the build process, so if the directory name and
+	library names differ, the ``version.map`` file should be named
+	consistently with the library, not the directory
+
+objs
+	**Default Value = []**.
+	This variable can be used to pass to the library build some pre-built
+	objects that were compiled up as part of another target given in the
+	included library ``meson.build`` file.
+
+version
+	**Default Value = 1**.
+	Specifies the ABI version of the library, and is used as the major
+	version number of the resulting ``.so`` library.
+
+Meson Build File Contents - Drivers
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+For drivers, the values are largely the same as for libraries. The variables
+supported are:
+
+build
+	As above.
+
+cflags
+	As above.
+
+deps
+	As above.
+
+ext_deps
+	As above.
+
+includes
+	**Default Value = <driver directory>** Some drivers include a base
+	directory for additional source files and headers, so we have this
+	variable to allow the headers from that base directory to be found when
+	compiling driver sources. Should be appended to using ``+=`` rather than
+	overwritten using ``=``.  The values appended should be meson include
+	objects got using the ``include_directories()`` function. For example:
+
+.. code-block:: python
+
+	includes += include_directories('base')
+
+name
+	As above, though note that each driver class can define it's own naming
+	scheme for the resulting ``.so`` files.
+
+objs
+	As above, generally used for the contents of the ``base`` directory.
+
+pkgconfig_extra_libs
+	**Default Value = []**
+	This variable is used to pass additional library link flags through to
+	the DPDK pkgconfig file generated, for example, to track any additional
+	libraries that may need to be linked into the build - especially when
+	using static libraries. Anything added here will be appended to the end
+	of the ``pkgconfig --libs`` output.
+
+sources [mandatory]
+	As above
+
+version
+	As above
-- 
2.13.5

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

* Re: [PATCH v3 00/17] build DPDK libs and some drivers with meson/ninja
  2017-09-13 14:12   ` [PATCH v3 " Bruce Richardson
                       ` (16 preceding siblings ...)
  2017-09-13 14:12     ` [PATCH v3 17/17] doc: add documentation on how to add new components to DPDK Bruce Richardson
@ 2017-09-13 17:01     ` Luca Boccassi
  2017-09-14 13:57       ` Bruce Richardson
  17 siblings, 1 reply; 107+ messages in thread
From: Luca Boccassi @ 2017-09-13 17:01 UTC (permalink / raw)
  To: Bruce Richardson, dev; +Cc: nhorman, harry.van.haaren, keith.wiles

On Wed, 2017-09-13 at 15:12 +0100, Bruce Richardson wrote:
> V3 changes:
> * used two-digit version numbers when globally versioning
> libs+drivers
> * removed symlinks with single-digit version numbers in same case
> * moved driver install location from $prefix/dpdk to
> $prefix/share/dpdk
> 
> V2 changes:
> * fixed copyright notices, updated 2016 to 2017
> * removed dependency on kconfig file in kernel build tree
> * marked pmdinfogen as a "native" binary, in preparation for future
> cross-
>   compilation work
> * added in additional warning flags for compatibility with existing
> system
> ---
> 
> Following on from the two previous RFCs [1] [2], here is a cleaned up
> patchset to serve as a start-point for getting all of DPDK building
> with
> meson and ninja.
> 
> What's covered:
> * Basic infrastructure for feature detection and DPDK compilation
> * Building of all DPDK libraries - as either static or shared
> * Compilation of igb_uio driver for Linux
> * Building a number of mempool, crypto and net drivers.
> * Installation of compiled libraries and headers
> * Installation of usertools scripts
> * Compilation of testpmd as dpdk-testpmd and install of same
> * Generation and installation of pkgconfig file for DPDK
> * Contributors guide document addition describing how to add build
> scripts
> 
> What's not implemented:
> * Just about everything else :-), including
> * Support for non-x86 architectures, including cross-compilation
> * Lots of PMDs
> * Support for building and running the unit tests
> 
> Some key differences from RFC2:
> * Removed duplication between the different driver meson files by
> moving
>   the build logic up one level to the driver/meson.build file.
> * Added a build option to allow versioning the libraries using the
> DPDK
>   version number, rather than individual .so versions.
> * Made EAL a default dependency for libs, to simplify meson.build
> files for
>   a number of them.
> * Made the build variables used for libraries and drivers more
> consistent.
> * Moved responsibility for determining if a given driver or library
> should
>   be built to the driver/library's own build file, giving a single
> place
>   where all details about that component are placed, and saving
> having lots
>   of environment detection logic in higher-level build files.
> * Begun adding in developer documentation to make it easier for
> driver
>   authors/maintainers to contribute.
> 
> Meson 0.41 and ninja are needed, and ideally meson 0.42 is
> recommended.
> Ninja is available in most distributions, and meson - if an updated
> version
> is not available on your distro of choice - can be easily got using 
> 	"pip3 install meson"
> 
> To build and install then use:
> 
> 	meson build # use default compiler and shared libs
> 	cd build
> 	ninja
> 	sudo ninja install
> 
> Thereafter to use DPDK in other build systems one can use:
> 
> 	pkg-config --cflags DPDK
> 	pkt-config --libs DPDK
> 
> to query the needed DPDK build parameters.
> 
> Once reviewed and tested a bit, I hope to apply this set - or a new
> revision of it - to the build-next tree, to serve as a baseline for
> others
> to use and to add the missing functionality to.
> 
> Regards,
> /Bruce
> 
> [1] http://dpdk.org/ml/archives/dev/2017-June/067429.html
> [2] http://dpdk.org/ml/archives/dev/2017-August/072818.html
> 
> Bruce Richardson (17):
>   build: add initial infrastructure for meson & ninja builds
>   eal: add eal library to meson build
>   igb_uio: add igb_uio kmod to meson build
>   build: add DPDK libraries to build
>   build: add buildtools to meson build
>   build: add infrastructure for building PMDs
>   drivers/mempool: add SW mempool drivers to meson build
>   drivers/crypto: add crypto drv class and null PMD to meson
>   crypto/openssl: add driver to meson build
>   crypto/qat: add driver to meson build
>   drivers/net: add net driver support to meson build
>   drivers/net: add set of vdev PMDs to build
>   drivers/net: add drivers for Intel NICs to meson build
>   app/test-pmd: add test-pmd to meson build
>   usertools: add usertools installation to meson build
>   build: add option to version libs using DPDK version
>   doc: add documentation on how to add new components to DPDK
> 
>  app/meson.build                                    |  32 +++
>  app/test-pmd/meson.build                           |  74 +++++++
>  buildtools/gen-pmdinfo-cfile.sh                    |  41 ++++
>  buildtools/meson.build                             |  34 ++++
>  buildtools/pmdinfogen/meson.build                  |  36 ++++
>  config/meson.build                                 |  72 +++++++
>  config/rte_config.h                                | 121
> ++++++++++++
>  config/x86/meson.build                             |  70 +++++++
>  doc/guides/contributing/coding_style.rst           | 214
> +++++++++++++++++++++
>  drivers/crypto/meson.build                         |  35 ++++
>  drivers/crypto/null/meson.build                    |  33 ++++
>  drivers/crypto/openssl/meson.build                 |  38 ++++
>  drivers/crypto/qat/meson.build                     |  41 ++++
>  drivers/mempool/meson.build                        |  35 ++++
>  drivers/mempool/ring/meson.build                   |  32 +++
>  drivers/mempool/stack/meson.build                  |  32 +++
>  drivers/meson.build                                | 133
> +++++++++++++
>  drivers/net/af_packet/meson.build                  |  35 ++++
>  drivers/net/e1000/base/meson.build                 |  65 +++++++
>  drivers/net/e1000/meson.build                      |  44 +++++
>  drivers/net/fm10k/base/meson.build                 |  55 ++++++
>  drivers/net/fm10k/meson.build                      |  44 +++++
>  drivers/net/i40e/base/meson.build                  |  56 ++++++
>  drivers/net/i40e/meson.build                       |  60 ++++++
>  drivers/net/ixgbe/base/meson.build                 |  60 ++++++
>  drivers/net/ixgbe/meson.build                      |  58 ++++++
>  drivers/net/meson.build                            |  36 ++++
>  drivers/net/null/meson.build                       |  32 +++
>  drivers/net/pcap/meson.build                       |  41 ++++
>  drivers/net/ring/meson.build                       |  33 ++++
>  lib/librte_acl/meson.build                         |  59 ++++++
>  lib/librte_bitratestats/meson.build                |  34 ++++
>  lib/librte_cfgfile/meson.build                     |  34 ++++
>  lib/librte_cmdline/meson.build                     |  55 ++++++
>  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              |  77 ++++++++
>  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            |  82 ++++++++
>  lib/librte_eal/linuxapp/igb_uio/Kbuild             |   1 +
>  lib/librte_eal/linuxapp/igb_uio/meson.build        |  46 +++++
>  lib/librte_eal/linuxapp/meson.build                |  42 ++++
>  lib/librte_eal/meson.build                         |  44 +++++
>  lib/librte_efd/meson.build                         |  34 ++++
>  lib/librte_ether/meson.build                       |  45 +++++
>  lib/librte_eventdev/meson.build                    |  36 ++++
>  lib/librte_gro/meson.build                         |  34 ++++
>  lib/librte_hash/meson.build                        |  45 +++++
>  lib/librte_ip_frag/meson.build                     |  39 ++++
>  lib/librte_jobstats/meson.build                    |  33 ++++
>  lib/librte_kni/meson.build                         |  38 ++++
>  lib/librte_kvargs/meson.build                      |  34 ++++
>  lib/librte_latencystats/meson.build                |  34 ++++
>  lib/librte_lpm/meson.build                         |  35 ++++
>  lib/librte_mbuf/meson.build                        |  35 ++++
>  lib/librte_mempool/meson.build                     |  35 ++++
>  lib/librte_meter/meson.build                       |  33 ++++
>  lib/librte_metrics/meson.build                     |  33 ++++
>  lib/librte_net/meson.build                         |  45 +++++
>  lib/librte_pdump/meson.build                       |  34 ++++
>  lib/librte_pipeline/meson.build                    |  35 ++++
>  lib/librte_port/meson.build                        |  58 ++++++
>  lib/librte_power/meson.build                       |  37 ++++
>  lib/librte_reorder/meson.build                     |  34 ++++
>  lib/librte_ring/meson.build                        |  33 ++++
>  lib/librte_sched/meson.build                       |  36 ++++
>  lib/librte_table/meson.build                       |  52 +++++
>  lib/librte_timer/meson.build                       |  33 ++++
>  lib/librte_vhost/meson.build                       |  39 ++++
>  lib/meson.build                                    | 109 +++++++++++
>  meson.build                                        |  88 +++++++++
>  meson_options.txt                                  |   9 +
>  usertools/meson.build                              |  32 +++
>  80 files changed, 3818 insertions(+)
>  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
>  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/e1000/base/meson.build
>  create mode 100644 drivers/net/e1000/meson.build
>  create mode 100644 drivers/net/fm10k/base/meson.build
>  create mode 100644 drivers/net/fm10k/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/null/meson.build
>  create mode 100644 drivers/net/pcap/meson.build
>  create mode 100644 drivers/net/ring/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
>  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

Acked-by: Luca Boccassi <luca.boccassi@gmail.com>

-- 
Kind regards,
Luca Boccassi

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

* Re: [PATCH v2 16/17] build: add option to version libs using DPDK version
  2017-09-13 13:11       ` Bruce Richardson
@ 2017-09-13 17:02         ` Luca Boccassi
  0 siblings, 0 replies; 107+ messages in thread
From: Luca Boccassi @ 2017-09-13 17:02 UTC (permalink / raw)
  To: Bruce Richardson; +Cc: dev, nhorman, harry.van.haaren, Christian Ehrhardt

On Wed, 2017-09-13 at 14:11 +0100, Bruce Richardson wrote:
> On Wed, Sep 13, 2017 at 12:32:24PM +0100, Luca Boccassi wrote:
> > On Tue, 2017-09-12 at 11:38 +0100, Bruce Richardson wrote:
> > > Normally, each library has it's own version number based on the
> > > ABI.
> > > Add an option to have all libs just use the DPDK version number
> > > as
> > > the
> > > .so version.
> > > 
> > > Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> > > Reviewed-by: Harry van Haaren <harry.van.haaren@intel.com>
> > > ---
> > >  drivers/meson.build | 8 +++++++-
> > >  lib/meson.build     | 8 +++++++-
> > >  meson_options.txt   | 1 +
> > >  3 files changed, 15 insertions(+), 2 deletions(-)
> > > 
> > > diff --git a/drivers/meson.build b/drivers/meson.build
> > > index f19da16fb..0c251bd61 100644
> > > --- a/drivers/meson.build
> > > +++ b/drivers/meson.build
> > > @@ -92,6 +92,12 @@ foreach class:driver_classes
> > >  						depends:
> > > [pmdinfogen, tmp_lib])
> > >  			endforeach
> > >  
> > > +			if get_option('per_library_versions')
> > > +				so_version = '@0@.1'.format(vers
> > > ion)
> > > +			else
> > > +				so_version =
> > > meson.project_version()
> > > +			endif
> > > +
> > >  			# now build the driver itself, and add
> > > to
> > > the drivers list
> > >  			lib_name = driver_name_fmt.format(name)
> > >  			version_map = '@0@/@1@/@2@_version.map'.
> > > form
> > > at(
> > > @@ -105,7 +111,7 @@ foreach class:driver_classes
> > >  				c_args: cflags,
> > >  				link_args: '-Wl,--version-
> > > script=' +
> > > version_map,
> > >  				link_depends: version_map,
> > > -				version: '@0@.1'.format(version)
> > > ,
> > > +				version: so_version,
> > >  				install: true,
> > >  				install_dir:
> > > driver_install_path)
> > >  
> > > diff --git a/lib/meson.build b/lib/meson.build
> > > index d814721de..36652cfe1 100644
> > > --- a/lib/meson.build
> > > +++ b/lib/meson.build
> > > @@ -76,6 +76,12 @@ foreach l:libraries
> > >  			dep_objs += [get_variable('dep_rte_' +
> > > d)]
> > >  		endforeach
> > >  
> > > +		if get_option('per_library_versions')
> > > +			so_version = '@0@.1'.format(version)
> > > +		else
> > > +			so_version = meson.project_version()
> > > +		endif
> > > +
> > >  		version_map = '@0@/@1@/rte_@2@_version.map'.form
> > > at(
> > >  				meson.current_source_dir(),
> > > dir_name, name)
> > >  		libname = 'rte_' + name
> > > @@ -87,7 +93,7 @@ foreach l:libraries
> > >  				include_directories:
> > > include_directories(dir_name),
> > >  				link_args: '-Wl,--version-
> > > script=' +
> > > version_map,
> > >  				link_depends: version_map,
> > > -				version: '@0@.1'.format(version)
> > > ,
> > > +				version: so_version,
> > >  				install: true)
> > >  		dep = declare_dependency(link_with: lib,
> > >  				include_directories:
> > > include_directories(dir_name),
> > > diff --git a/meson_options.txt b/meson_options.txt
> > > index 9c45b8159..636226ce8 100644
> > > --- a/meson_options.txt
> > > +++ b/meson_options.txt
> > > @@ -6,3 +6,4 @@ 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')
> > >  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')
> > > +option('per_library_versions', type: 'boolean', value: true,
> > > description: 'true: each lib gets its own version number, false:
> > > DPDK
> > > version used for each lib')
> > 
> > Hi Bruce,
> > 
> > First of all thanks for implementing this option, and sorry for the
> > delay.
> > 
> > A couple of minor things:
> > 
> > 1) The project version has 3 digits, but the ABI version should
> > have 2
> > - eg: should be 17.08 but right now it's 17.08.0 - given point
> > releases
> > will be ABI compatible so they must not change the ABI version. In
> > the
> > packaging code we use cut to chop it off:
> > 
> > DPDK_ABI := $(shell echo $(DEB_VERSION_UPSTREAM) | cut -d '.'  -f1-
> > 2)
> > 
> > Not sure how to achieve the same in a Meson script though (can it
> > shell
> > out? or are there string manipulation built-ins?), sorry - just
> > starting to look at it.
> > 
> 
> That should be easy enough to do. It's 3-digits because I'm just
> pulling
> the project version unmodified from the initial project definition.
> I'd
> say I can manage to strip off one digit as part of the build.
> 
> > Right now the rte_config option allows the user to completely
> > override
> > the version - I'm fine with having a single boolean provided this
> > change is applied, it simplifies packaging a bit, but if it's
> > easier
> > for you to just accepted a version instead of a boolean it's fine
> > as
> > well, as you prefer
> 
> If there is a case where we might want to provide a particular
> version,
> I'm happy to edit the option, but if not I'll keep it as-is, because
> it
> will ensure all users of the option get the exact same behaviour, and
> means I only have two possibilities to test.

I agree, it looks fine as it is right now - I'm not aware of any other
use case at the moment.

> > 
> > 2) When the option is true, it should not generate a symlink with
> > the
> > ABI "revision", as the first digit is really not the revision, so
> > it
> > does not make much sense. Worse, it will stop 2 versions being co-
> > installable (which was the whole point :-) ), as, eg, 17.02, 17.05
> > and
> > 17.08 will all ship a libfoo.so.17 symlink. I can fix it in the
> > packaging, but I don't think it should be generated upstream at all
> > when this option is enabled.
> 
> Not exactly sure how to fix this, but I think it may work by using
> soversion as well as version in the library() calls.
> 
> > 
> > IOW, the following is the current result:
> > 
> > $ ls -l debian/librte-ethdev17.08/usr/lib/x86_64-linux-gnu/
> > total 72
> > lrwxrwxrwx 1 lboccass lboccass    24 Sep 13 11:50
> > librte_ethdev.so.17 -> librte_ethdev.so.17.08.0
> > -rw-r--r-- 1 lboccass lboccass 71672 Sep 13 11:50
> > librte_ethdev.so.17.08.0
> > 
> > The expected result would be to create a single file
> > "librte_ethdev.so.17.08" instead.
> > 
> 
> Let me see what I can do :-)
> 
> /Bruce

Now it works as expected, thanks!

-- 
Kind regards,
Luca Boccassi

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

* Re: [PATCH v3 00/17] build DPDK libs and some drivers with meson/ninja
  2017-09-13 17:01     ` [PATCH v3 00/17] build DPDK libs and some drivers with meson/ninja Luca Boccassi
@ 2017-09-14 13:57       ` Bruce Richardson
  0 siblings, 0 replies; 107+ messages in thread
From: Bruce Richardson @ 2017-09-14 13:57 UTC (permalink / raw)
  To: Luca Boccassi; +Cc: dev, nhorman, harry.van.haaren, keith.wiles

On Wed, Sep 13, 2017 at 06:01:25PM +0100, Luca Boccassi wrote:
> On Wed, 2017-09-13 at 15:12 +0100, Bruce Richardson wrote:
> > V3 changes:
> > * used two-digit version numbers when globally versioning
> > libs+drivers
> > * removed symlinks with single-digit version numbers in same case
> > * moved driver install location from $prefix/dpdk to
> > $prefix/share/dpdk
> > 
> > V2 changes:
> > * fixed copyright notices, updated 2016 to 2017
> > * removed dependency on kconfig file in kernel build tree
> > * marked pmdinfogen as a "native" binary, in preparation for future
> > cross-
> >   compilation work
> > * added in additional warning flags for compatibility with existing
> > system
> > ---
> > 
> > Following on from the two previous RFCs [1] [2], here is a cleaned up
> > patchset to serve as a start-point for getting all of DPDK building
> > with
> > meson and ninja.
> > 
> > What's covered:
> > * Basic infrastructure for feature detection and DPDK compilation
> > * Building of all DPDK libraries - as either static or shared
> > * Compilation of igb_uio driver for Linux
> > * Building a number of mempool, crypto and net drivers.
> > * Installation of compiled libraries and headers
> > * Installation of usertools scripts
> > * Compilation of testpmd as dpdk-testpmd and install of same
> > * Generation and installation of pkgconfig file for DPDK
> > * Contributors guide document addition describing how to add build
> > scripts
> > 
> > What's not implemented:
> > * Just about everything else :-), including
> > * Support for non-x86 architectures, including cross-compilation
> > * Lots of PMDs
> > * Support for building and running the unit tests
> > 
> > Some key differences from RFC2:
> > * Removed duplication between the different driver meson files by
> > moving
> >   the build logic up one level to the driver/meson.build file.
> > * Added a build option to allow versioning the libraries using the
> > DPDK
> >   version number, rather than individual .so versions.
> > * Made EAL a default dependency for libs, to simplify meson.build
> > files for
> >   a number of them.
> > * Made the build variables used for libraries and drivers more
> > consistent.
> > * Moved responsibility for determining if a given driver or library
> > should
> >   be built to the driver/library's own build file, giving a single
> > place
> >   where all details about that component are placed, and saving
> > having lots
> >   of environment detection logic in higher-level build files.
> > * Begun adding in developer documentation to make it easier for
> > driver
> >   authors/maintainers to contribute.
> > 
> > Meson 0.41 and ninja are needed, and ideally meson 0.42 is
> > recommended.
> > Ninja is available in most distributions, and meson - if an updated
> > version
> > is not available on your distro of choice - can be easily got using 
> > 	"pip3 install meson"
> > 
> > To build and install then use:
> > 
> > 	meson build # use default compiler and shared libs
> > 	cd build
> > 	ninja
> > 	sudo ninja install
> > 
> > Thereafter to use DPDK in other build systems one can use:
> > 
> > 	pkg-config --cflags DPDK
> > 	pkt-config --libs DPDK
> > 
> > to query the needed DPDK build parameters.
> > 
> > Once reviewed and tested a bit, I hope to apply this set - or a new
> > revision of it - to the build-next tree, to serve as a baseline for
> > others
> > to use and to add the missing functionality to.
> > 
> > Regards,
> > /Bruce
> > 
> > [1] http://dpdk.org/ml/archives/dev/2017-June/067429.html
> > [2] http://dpdk.org/ml/archives/dev/2017-August/072818.html
> > 
> > Bruce Richardson (17):
> >   build: add initial infrastructure for meson & ninja builds
> >   eal: add eal library to meson build
> >   igb_uio: add igb_uio kmod to meson build
> >   build: add DPDK libraries to build
> >   build: add buildtools to meson build
> >   build: add infrastructure for building PMDs
> >   drivers/mempool: add SW mempool drivers to meson build
> >   drivers/crypto: add crypto drv class and null PMD to meson
> >   crypto/openssl: add driver to meson build
> >   crypto/qat: add driver to meson build
> >   drivers/net: add net driver support to meson build
> >   drivers/net: add set of vdev PMDs to build
> >   drivers/net: add drivers for Intel NICs to meson build
> >   app/test-pmd: add test-pmd to meson build
> >   usertools: add usertools installation to meson build
> >   build: add option to version libs using DPDK version
> >   doc: add documentation on how to add new components to DPDK
> > 
> 
> Acked-by: Luca Boccassi <luca.boccassi@gmail.com>
> 
Pushed to dpdk-next-build.

Thanks to all for the reviews and acks.

/Bruce

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

* Re: [PATCH v3 01/17] build: add initial infrastructure for meson & ninja builds
  2017-09-13 14:12     ` [PATCH v3 01/17] build: add initial infrastructure for meson & ninja builds Bruce Richardson
@ 2017-09-20 10:10       ` Timothy M. Redaelli
  2017-09-20 10:24         ` Bruce Richardson
  0 siblings, 1 reply; 107+ messages in thread
From: Timothy M. Redaelli @ 2017-09-20 10:10 UTC (permalink / raw)
  To: Bruce Richardson, dev
  Cc: nhorman, luca.boccassi, harry.van.haaren, keith.wiles

On 09/13/2017 04:12 PM, Bruce Richardson wrote:
[...]
> +
> +# for static libs, treat the drivers as regular libraries, otherwise
> +# for shared libs, put them in a driver folder
> +if get_option('default_library') == 'static'
> +	driver_install_path = get_option('libdir')
> +else
> +	driver_install_path = join_paths(get_option('datadir'), 'dpdk/drivers')
> +endif

This is against hier, since:
"This directory contains subdirectories with specific application data,
that can be shared among different architectures of the same OS."
(from man 7 hier)

Please consider to use a subdirectory of libdir like the actual dpdk
instead.

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

* Re: [PATCH v3 01/17] build: add initial infrastructure for meson & ninja builds
  2017-09-20 10:10       ` Timothy M. Redaelli
@ 2017-09-20 10:24         ` Bruce Richardson
  2017-09-20 10:33           ` Timothy M. Redaelli
  0 siblings, 1 reply; 107+ messages in thread
From: Bruce Richardson @ 2017-09-20 10:24 UTC (permalink / raw)
  To: Timothy M. Redaelli
  Cc: dev, nhorman, luca.boccassi, harry.van.haaren, keith.wiles

On Wed, Sep 20, 2017 at 12:10:19PM +0200, Timothy M. Redaelli wrote:
> On 09/13/2017 04:12 PM, Bruce Richardson wrote:
> [...]
> > +
> > +# for static libs, treat the drivers as regular libraries, otherwise
> > +# for shared libs, put them in a driver folder
> > +if get_option('default_library') == 'static'
> > +	driver_install_path = get_option('libdir')
> > +else
> > +	driver_install_path = join_paths(get_option('datadir'), 'dpdk/drivers')
> > +endif
> 
> This is against hier, since:
> "This directory contains subdirectories with specific application data,
> that can be shared among different architectures of the same OS."
> (from man 7 hier)
> 
> Please consider to use a subdirectory of libdir like the actual dpdk
> instead.

Sure. Using "$libdir/dpdk/drivers" work well, or is there a better choice?

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

* Re: [PATCH v3 01/17] build: add initial infrastructure for meson & ninja builds
  2017-09-20 10:24         ` Bruce Richardson
@ 2017-09-20 10:33           ` Timothy M. Redaelli
  0 siblings, 0 replies; 107+ messages in thread
From: Timothy M. Redaelli @ 2017-09-20 10:33 UTC (permalink / raw)
  To: Bruce Richardson
  Cc: dev, nhorman, luca.boccassi, harry.van.haaren, keith.wiles

On September 20, 2017 12:24:15 PM GMT+02:00, Bruce Richardson <bruce.richardson@intel.com> wrote:
>On Wed, Sep 20, 2017 at 12:10:19PM +0200, Timothy M. Redaelli wrote:
>> On 09/13/2017 04:12 PM, Bruce Richardson wrote:
>> [...]
>> > +
>> > +# for static libs, treat the drivers as regular libraries,
>otherwise
>> > +# for shared libs, put them in a driver folder
>> > +if get_option('default_library') == 'static'
>> > +	driver_install_path = get_option('libdir')
>> > +else
>> > +	driver_install_path = join_paths(get_option('datadir'),
>'dpdk/drivers')
>> > +endif
>> 
>> This is against hier, since:
>> "This directory contains subdirectories with specific application
>data,
>> that can be shared among different architectures of the same OS."
>> (from man 7 hier)
>> 
>> Please consider to use a subdirectory of libdir like the actual dpdk
>> instead.
>
>Sure. Using "$libdir/dpdk/drivers" work well, or is there a better
>choice?

Sounds good, thank you

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

end of thread, other threads:[~2017-09-20 10:33 UTC | newest]

Thread overview: 107+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-01 10:03 [PATCH 00/17] build DPDK libs and some drivers with meson/ninja Bruce Richardson
2017-09-01 10:04 ` [PATCH 01/17] build: add initial infrastructure for meson & ninja builds Bruce Richardson
2017-09-04 13:36   ` Van Haaren, Harry
2017-09-04 13:51     ` Bruce Richardson
2017-09-06 16:18       ` Bruce Richardson
2017-09-07 13:52         ` Bruce Richardson
2017-09-07 16:21   ` [dpdk-dev, " Neil Horman
2017-09-07 16:47     ` Wiles, Keith
2017-09-07 17:12       ` Neil Horman
2017-09-08  8:50     ` Bruce Richardson
2017-09-08 11:57       ` Neil Horman
2017-09-08 13:55         ` Bruce Richardson
2017-09-08 14:00           ` Bruce Richardson
2017-09-08 16:03   ` [PATCH " Van Haaren, Harry
2017-09-08 16:13     ` Richardson, Bruce
2017-09-12  9:56       ` Bruce Richardson
2017-09-01 10:04 ` [PATCH 02/17] eal: add eal library to meson build Bruce Richardson
2017-09-04 13:53   ` Van Haaren, Harry
2017-09-07 16:25   ` [dpdk-dev, " Neil Horman
2017-09-08  8:51     ` Bruce Richardson
2017-09-01 10:04 ` [PATCH 03/17] igb_uio: add igb_uio kmod " Bruce Richardson
2017-09-01 13:32   ` Luca Boccassi
2017-09-01 13:55     ` Bruce Richardson
2017-09-01 14:27       ` Luca Boccassi
2017-09-04 13:57   ` Van Haaren, Harry
2017-09-01 10:04 ` [PATCH 04/17] build: add DPDK libraries to build Bruce Richardson
2017-09-04 14:08   ` Van Haaren, Harry
2017-09-04 14:55     ` Bruce Richardson
2017-09-01 10:04 ` [PATCH 05/17] build: add buildtools to meson build Bruce Richardson
2017-09-04 14:24   ` Van Haaren, Harry
2017-09-01 10:04 ` [PATCH 06/17] build: add infrastructure for building PMDs Bruce Richardson
2017-09-04 14:27   ` Van Haaren, Harry
2017-09-01 10:04 ` [PATCH 07/17] drivers/mempool: add SW mempool drivers to meson build Bruce Richardson
2017-09-04 14:28   ` Van Haaren, Harry
2017-09-04 14:29   ` Van Haaren, Harry
2017-09-01 10:04 ` [PATCH 08/17] drivers/crypto: add crypto drv class and null PMD to meson Bruce Richardson
2017-09-04 14:30   ` Van Haaren, Harry
2017-09-01 10:04 ` [PATCH 09/17] crypto/openssl: add driver to meson build Bruce Richardson
2017-09-04 14:30   ` Van Haaren, Harry
2017-09-04 14:31   ` Van Haaren, Harry
2017-09-01 10:04 ` [PATCH 10/17] crypto/qat: " Bruce Richardson
2017-09-04 14:32   ` Van Haaren, Harry
2017-09-01 10:04 ` [PATCH 11/17] drivers/net: add net driver support " Bruce Richardson
2017-09-04 14:32   ` Van Haaren, Harry
2017-09-01 10:04 ` [PATCH 12/17] drivers/net: add set of vdev PMDs to build Bruce Richardson
2017-09-04 14:34   ` Van Haaren, Harry
2017-09-01 10:04 ` [PATCH 13/17] drivers/net: add drivers for Intel NICs to meson build Bruce Richardson
2017-09-01 10:04 ` [PATCH 14/17] app/test-pmd: add test-pmd " Bruce Richardson
2017-09-04 15:01   ` Van Haaren, Harry
2017-09-01 10:04 ` [PATCH 15/17] usertools: add usertools installation " Bruce Richardson
2017-09-04 15:00   ` Van Haaren, Harry
2017-09-01 10:04 ` [PATCH 16/17] build: add option to version libs using DPDK version Bruce Richardson
2017-09-07 17:07   ` [dpdk-dev, " Neil Horman
2017-09-08  8:58     ` Bruce Richardson
2017-09-01 10:04 ` [PATCH 17/17] doc: add documentation on how to add new components to DPDK Bruce Richardson
2017-09-01 10:38 ` [PATCH 00/17] build DPDK libs and some drivers with meson/ninja Bruce Richardson
2017-09-12 10:37 ` [PATCH v2 " Bruce Richardson
2017-09-12 10:37   ` [PATCH v2 01/17] build: add initial infrastructure for meson & ninja builds Bruce Richardson
2017-09-12 10:37   ` [PATCH v2 02/17] eal: add eal library to meson build Bruce Richardson
2017-09-12 10:37   ` [PATCH v2 03/17] igb_uio: add igb_uio kmod " Bruce Richardson
2017-09-12 10:37   ` [PATCH v2 04/17] build: add DPDK libraries to build Bruce Richardson
2017-09-12 10:37   ` [PATCH v2 05/17] build: add buildtools to meson build Bruce Richardson
2017-09-12 10:37   ` [PATCH v2 06/17] build: add infrastructure for building PMDs Bruce Richardson
2017-09-12 10:37   ` [PATCH v2 07/17] drivers/mempool: add SW mempool drivers to meson build Bruce Richardson
2017-09-12 10:38   ` [PATCH v2 08/17] drivers/crypto: add crypto drv class and null PMD to meson Bruce Richardson
2017-09-12 10:38   ` [PATCH v2 09/17] crypto/openssl: add driver to meson build Bruce Richardson
2017-09-12 10:38   ` [PATCH v2 10/17] crypto/qat: " Bruce Richardson
2017-09-12 10:38   ` [PATCH v2 11/17] drivers/net: add net driver support " Bruce Richardson
2017-09-12 10:38   ` [PATCH v2 12/17] drivers/net: add set of vdev PMDs to build Bruce Richardson
2017-09-12 10:38   ` [PATCH v2 13/17] drivers/net: add drivers for Intel NICs to meson build Bruce Richardson
2017-09-12 10:38   ` [PATCH v2 14/17] app/test-pmd: add test-pmd " Bruce Richardson
2017-09-12 10:38   ` [PATCH v2 15/17] usertools: add usertools installation " Bruce Richardson
2017-09-12 10:38   ` [PATCH v2 16/17] build: add option to version libs using DPDK version Bruce Richardson
2017-09-13 11:32     ` Luca Boccassi
2017-09-13 13:11       ` Bruce Richardson
2017-09-13 17:02         ` Luca Boccassi
2017-09-12 10:38   ` [PATCH v2 17/17] doc: add documentation on how to add new components to DPDK Bruce Richardson
2017-09-12 13:21   ` [PATCH v2 00/17] build DPDK libs and some drivers with meson/ninja Wiles, Keith
2017-09-12 13:24     ` Bruce Richardson
2017-09-12 13:26       ` Wiles, Keith
2017-09-12 14:00         ` Wiles, Keith
2017-09-12 15:46           ` Bruce Richardson
2017-09-12 19:19         ` Neil Horman
2017-09-12 20:36           ` Wiles, Keith
2017-09-13 14:12   ` [PATCH v3 " Bruce Richardson
2017-09-13 14:12     ` [PATCH v3 01/17] build: add initial infrastructure for meson & ninja builds Bruce Richardson
2017-09-20 10:10       ` Timothy M. Redaelli
2017-09-20 10:24         ` Bruce Richardson
2017-09-20 10:33           ` Timothy M. Redaelli
2017-09-13 14:12     ` [PATCH v3 02/17] eal: add eal library to meson build Bruce Richardson
2017-09-13 14:12     ` [PATCH v3 03/17] igb_uio: add igb_uio kmod " Bruce Richardson
2017-09-13 14:12     ` [PATCH v3 04/17] build: add DPDK libraries to build Bruce Richardson
2017-09-13 14:12     ` [PATCH v3 05/17] build: add buildtools to meson build Bruce Richardson
2017-09-13 14:12     ` [PATCH v3 06/17] build: add infrastructure for building PMDs Bruce Richardson
2017-09-13 14:12     ` [PATCH v3 07/17] drivers/mempool: add SW mempool drivers to meson build Bruce Richardson
2017-09-13 14:12     ` [PATCH v3 08/17] drivers/crypto: add crypto drv class and null PMD to meson Bruce Richardson
2017-09-13 14:12     ` [PATCH v3 09/17] crypto/openssl: add driver to meson build Bruce Richardson
2017-09-13 14:12     ` [PATCH v3 10/17] crypto/qat: " Bruce Richardson
2017-09-13 14:12     ` [PATCH v3 11/17] drivers/net: add net driver support " Bruce Richardson
2017-09-13 14:12     ` [PATCH v3 12/17] drivers/net: add set of vdev PMDs to build Bruce Richardson
2017-09-13 14:12     ` [PATCH v3 13/17] drivers/net: add drivers for Intel NICs to meson build Bruce Richardson
2017-09-13 14:12     ` [PATCH v3 14/17] app/test-pmd: add test-pmd " Bruce Richardson
2017-09-13 14:12     ` [PATCH v3 15/17] usertools: add usertools installation " Bruce Richardson
2017-09-13 14:12     ` [PATCH v3 16/17] build: add option to version libs using DPDK version Bruce Richardson
2017-09-13 14:12     ` [PATCH v3 17/17] doc: add documentation on how to add new components to DPDK Bruce Richardson
2017-09-13 17:01     ` [PATCH v3 00/17] build DPDK libs and some drivers with meson/ninja Luca Boccassi
2017-09-14 13:57       ` Bruce Richardson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.