DPDK patches and discussions
 help / color / mirror / Atom feed
From: <lironh@marvell.com>
To: <ferruh.yigit@intel.com>
Cc: <dev@dpdk.org>, Liron Himi <lironh@marvell.com>
Subject: [dpdk-dev] [PATCH v2] meson: update meson build for armada drivers
Date: Wed, 16 Dec 2020 00:19:35 +0200
Message-ID: <20201215221935.13760-1-lironh@marvell.com> (raw)
In-Reply-To: <20201202130529.7332-2-lironh@marvell.com>

From: Liron Himi <lironh@marvell.com>

With pkg-config support available within musdk library
(from musdk-release-SDK-10.3.5.0-PR2 version),
meson option 'lib_musdk_dir' can be removed.
PKG_CONFIG_PATH environment variable should be set appropriately
to use the musdk library.

docs are updated with new musdk version and meson instructions.

Signed-off-by: Liron Himi <lironh@marvell.com>
Reviewed-by: Liron Himi <lironh@marvell.com>
---
 doc/guides/nics/mvneta.rst         | 13 ++++++++-----
 doc/guides/nics/mvpp2.rst          | 15 +++++++++------
 drivers/common/mvep/meson.build    | 14 +++++---------
 drivers/crypto/mvsam/meson.build   | 15 +++++----------
 drivers/net/mvneta/meson.build     | 19 +++++--------------
 drivers/net/mvneta/mvneta_ethdev.h |  1 +
 drivers/net/mvpp2/meson.build      | 15 +++++----------
 meson_options.txt                  |  2 --
 8 files changed, 38 insertions(+), 56 deletions(-)

diff --git a/doc/guides/nics/mvneta.rst b/doc/guides/nics/mvneta.rst
index e8abde42d..56a555bd2 100644
--- a/doc/guides/nics/mvneta.rst
+++ b/doc/guides/nics/mvneta.rst
@@ -56,7 +56,7 @@ Prerequisites
 
   .. code-block:: console
 
-     git clone https://github.com/MarvellEmbeddedProcessors/musdk-marvell.git -b musdk-armada-18.09
+     git clone https://github.com/MarvellEmbeddedProcessors/musdk-marvell.git -b musdk-release-SDK-10.3.5.0-PR2
 
   MUSDK is a light-weight library that provides direct access to Marvell's
   NETA. Alternatively prebuilt MUSDK library can be
@@ -94,7 +94,7 @@ be passed as part of EAL arguments.
     -c 3 -- -i --p 3 -a
 
 
-Building DPDK
+Building MUSDK
 -------------
 
 Driver needs precompiled MUSDK library during compilation.
@@ -109,12 +109,15 @@ Driver needs precompiled MUSDK library during compilation.
 MUSDK will be installed to `usr/local` under current directory.
 For the detailed build instructions please consult ``doc/musdk_get_started.txt``.
 
-The path to the MUSDK installation directory needs to set in meson, shown in the
-following command:
+Building DPDK:
+
+Add path to libmusdk.pc in PKG_CONFIG_PATH environment variable.
 
 .. code-block:: console
 
-   meson -Dlib_musdk_dir=/path/to/musdk build ninja -C build
+   export PKG_CONFIG_PATH=$<musdk_install_dir>/lib/pkgconfig/:$PKG_CONFIG_PATH
+   meson build --cross-file config/arm/arm64_armada_linux_gcc
+   ninja -C build
 
 
 Usage Example
diff --git a/doc/guides/nics/mvpp2.rst b/doc/guides/nics/mvpp2.rst
index 6fbce8358..69724bdf9 100644
--- a/doc/guides/nics/mvpp2.rst
+++ b/doc/guides/nics/mvpp2.rst
@@ -91,7 +91,7 @@ Prerequisites
 
   .. code-block:: console
 
-     git clone https://github.com/MarvellEmbeddedProcessors/musdk-marvell.git -b musdk-armada-18.09
+     git clone https://github.com/MarvellEmbeddedProcessors/musdk-marvell.git -b musdk-release-SDK-10.3.5.0-PR2
 
   MUSDK is a light-weight library that provides direct access to Marvell's
   PPv2 (Packet Processor v2). Alternatively prebuilt MUSDK library can be
@@ -108,7 +108,7 @@ Prerequisites
   DPDK environment.
 
 
-Building DPDK
+Building MUSDK
 -------------
 
 Driver needs precompiled MUSDK library during compilation.
@@ -123,14 +123,17 @@ Driver needs precompiled MUSDK library during compilation.
 MUSDK will be installed to `usr/local` under current directory.
 For the detailed build instructions please consult ``doc/musdk_get_started.txt``.
 
-The path to the MUSDK installation directory needs to set in meson, shown in the
-command below.
 
-For additional instructions regarding DPDK cross compilation please refer to :doc:`Cross compile DPDK for ARM64 <../linux_gsg/cross_build_dpdk_for_arm64>`.
+Building DPDK:
+
+Add path to libmusdk.pc in PKG_CONFIG_PATH environment variable.
 
 .. code-block:: console
 
-   meson -Dlib_musdk_dir=/path/to/musdk build ninja -C build
+   export PKG_CONFIG_PATH=$<musdk_install_dir>/lib/pkgconfig/:$PKG_CONFIG_PATH
+
+   meson build --cross-file config/arm/arm64_armada_linux_gcc
+   ninja -C build
 
 
 Usage Example
diff --git a/drivers/common/mvep/meson.build b/drivers/common/mvep/meson.build
index 8df4bc6e0..863a20ab9 100644
--- a/drivers/common/mvep/meson.build
+++ b/drivers/common/mvep/meson.build
@@ -3,18 +3,14 @@
 # Copyright(c) 2018 Semihalf.
 # All rights reserved.
 #
-path = get_option('lib_musdk_dir')
-lib_dir = path + '/lib'
-inc_dir = path + '/include'
 
-lib = cc.find_library('libmusdk', dirs: [lib_dir], required: false)
-if not lib.found()
+dep = dependency('libmusdk', required: false)
+if not dep.found()
 	build = false
 	reason = 'missing dependency, "libmusdk"'
-else
-	ext_deps += lib
-	includes += include_directories(inc_dir)
-	cflags += ['-DMVCONF_TYPES_PUBLIC', '-DMVCONF_DMA_PHYS_ADDR_T_PUBLIC']
+	subdir_done()
 endif
 
+ext_deps += dep
+
 sources = files('mvep_common.c')
diff --git a/drivers/crypto/mvsam/meson.build b/drivers/crypto/mvsam/meson.build
index 6d97dc8a2..384eacff0 100644
--- a/drivers/crypto/mvsam/meson.build
+++ b/drivers/crypto/mvsam/meson.build
@@ -3,20 +3,15 @@
 # Copyright(c) 2018 Semihalf.
 # All rights reserved.
 
-path = get_option('lib_musdk_dir')
-lib_dir = path + '/lib'
-inc_dir = path + '/include'
-
-lib = cc.find_library('libmusdk', dirs: [lib_dir], required: false)
-if not lib.found()
+dep = dependency('libmusdk', required: false)
+if not dep.found()
 	build = false
 	reason = 'missing dependency, "libmusdk"'
-else
-	ext_deps += lib
-	includes += include_directories(inc_dir)
-	cflags += ['-DMVCONF_TYPES_PUBLIC', '-DMVCONF_DMA_PHYS_ADDR_T_PUBLIC']
+	subdir_done()
 endif
 
+ext_deps += dep
+
 sources = files('rte_mrvl_pmd.c', 'rte_mrvl_pmd_ops.c')
 
 deps += ['bus_vdev', 'common_mvep']
diff --git a/drivers/net/mvneta/meson.build b/drivers/net/mvneta/meson.build
index 8d7202788..c887ddc10 100644
--- a/drivers/net/mvneta/meson.build
+++ b/drivers/net/mvneta/meson.build
@@ -3,24 +3,15 @@
 # Copyright(c) 2018 Semihalf.
 # All rights reserved.
 
-path = get_option('lib_musdk_dir')
-lib_dir = path + '/lib'
-inc_dir = path + '/include'
-
-lib = cc.find_library('libmusdk', dirs : [lib_dir], required: false)
-if not lib.found()
+dep = dependency('libmusdk', required: false)
+if not dep.found()
 	build = false
 	reason = 'missing dependency, "libmusdk"'
-else
-	ext_deps += lib
-	includes += include_directories(inc_dir)
-	cflags += [
-	  '-DMVCONF_TYPES_PUBLIC',
-	  '-DMVCONF_DMA_PHYS_ADDR_T_PUBLIC',
-	  '-DMVCONF_DMA_PHYS_ADDR_T_SIZE=64'
-	]
+	subdir_done()
 endif
 
+ext_deps += dep
+
 sources = files(
 	'mvneta_ethdev.c',
 	'mvneta_rxtx.c'
diff --git a/drivers/net/mvneta/mvneta_ethdev.h b/drivers/net/mvneta/mvneta_ethdev.h
index ef8067790..e090abc25 100644
--- a/drivers/net/mvneta/mvneta_ethdev.h
+++ b/drivers/net/mvneta/mvneta_ethdev.h
@@ -21,6 +21,7 @@
 #undef container_of
 #endif
 
+#include <env/mv_autogen_comp_flags.h>
 #include <drivers/mv_neta.h>
 #include <drivers/mv_neta_ppio.h>
 
diff --git a/drivers/net/mvpp2/meson.build b/drivers/net/mvpp2/meson.build
index e06eddaac..3015a5559 100644
--- a/drivers/net/mvpp2/meson.build
+++ b/drivers/net/mvpp2/meson.build
@@ -3,20 +3,15 @@
 # Copyright(c) 2018 Semihalf.
 # All rights reserved.
 
-path = get_option('lib_musdk_dir')
-lib_dir = path + '/lib'
-inc_dir = path + '/include'
-
-lib = cc.find_library('libmusdk', dirs : [lib_dir], required: false)
-if not lib.found()
+dep = dependency('libmusdk', required: false)
+if not dep.found()
 	build = false
 	reason = 'missing dependency, "libmusdk"'
-else
-	ext_deps += lib
-	includes += include_directories(inc_dir)
-	cflags += ['-DMVCONF_TYPES_PUBLIC', '-DMVCONF_DMA_PHYS_ADDR_T_PUBLIC']
+	subdir_done()
 endif
 
+ext_deps += dep
+
 sources = files(
 	'mrvl_ethdev.c',
 	'mrvl_flow.c',
diff --git a/meson_options.txt b/meson_options.txt
index 9bf18ab6b..63245b95d 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -20,8 +20,6 @@ option('include_subdir_arch', type: 'string', value: '',
 	description: 'subdirectory where to install arch-dependent headers')
 option('kernel_dir', type: 'string', value: '',
 	description: 'Path to the kernel for building kernel modules. Headers must be in $kernel_dir/build. Modules will be installed in $DEST_DIR/$kernel_dir/extra/dpdk.')
-option('lib_musdk_dir', type: 'string', value: '',
-	description: 'path to the MUSDK library installation directory')
 option('machine', type: 'string', value: 'native',
 	description: 'set the target machine type')
 option('max_ethports', type: 'integer', value: 32,
-- 
2.28.0


  parent reply	other threads:[~2020-12-15 22:19 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-02 13:05 [dpdk-dev] [PATCH v1 0/2] armada: introduce musdk pkg-config lironh
2020-12-02 13:05 ` [dpdk-dev] [PATCH v1 1/2] meson: update meson build for armada drivers lironh
2020-12-09 10:49   ` Ferruh Yigit
2020-12-13 20:06     ` [dpdk-dev] [EXT] " Liron Himi
2020-12-14  9:57       ` Ferruh Yigit
2020-12-15 10:04         ` Liron Himi
2020-12-15 10:29           ` Ferruh Yigit
2020-12-15 22:19   ` lironh [this message]
2020-12-15 22:23   ` [dpdk-dev] [PATCH v2] " lironh
2020-12-16 13:37     ` Ferruh Yigit
2020-12-16 13:41       ` [dpdk-dev] [EXT] " Liron Himi
2020-12-16 13:48         ` Ferruh Yigit
2020-12-16 21:15           ` Liron Himi
2020-12-16 13:52         ` Ferruh Yigit
2020-12-17 10:06           ` Luca Boccassi
2020-12-17 10:16             ` Ferruh Yigit
2020-12-16 21:36     ` [dpdk-dev] [PATCH v3] " lironh
2020-12-17 12:15       ` Ferruh Yigit
2021-01-11 11:28       ` Thomas Monjalon
2021-01-11 15:29         ` [dpdk-dev] [EXT] " Liron Himi
2021-01-11 16:05           ` Thomas Monjalon
2021-01-11 16:08             ` Liron Himi
2021-01-11 16:17               ` Thomas Monjalon
2021-01-11 17:07                 ` Bruce Richardson
2021-01-11 17:30                   ` Thomas Monjalon
2021-01-11 18:01                   ` Luca Boccassi
2021-01-11 17:04             ` Bruce Richardson
2021-01-11 17:06               ` Thomas Monjalon
2020-12-02 13:05 ` [dpdk-dev] [PATCH v1 2/2] doc: update armada docs lironh
2020-12-09 10:45   ` Ferruh Yigit

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201215221935.13760-1-lironh@marvell.com \
    --to=lironh@marvell.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

DPDK patches and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ https://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git