]> git.droids-corp.org - dpdk.git/commitdiff
build: update meson for Marvell Armada drivers
authorLiron Himi <lironh@marvell.com>
Wed, 16 Dec 2020 21:36:52 +0000 (23:36 +0200)
committerFerruh Yigit <ferruh.yigit@intel.com>
Fri, 8 Jan 2021 15:03:05 +0000 (16:03 +0100)
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: Ferruh Yigit <ferruh.yigit@intel.com>
doc/guides/nics/mvneta.rst
doc/guides/nics/mvpp2.rst
drivers/common/mvep/meson.build
drivers/crypto/mvsam/meson.build
drivers/net/mvneta/meson.build
drivers/net/mvpp2/meson.build
meson_options.txt

index 4238b0006635007896f811614c4d582ba4d350f1..b7f279c3cb16d7d62772817554b9169c82165541 100644 (file)
@@ -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,8 +94,8 @@ 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,16 @@ 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
index 17e8e347bb1c5b3ed8aa1b2f0db78f4f75070c60..e1246efae117edd5d79c4c20fa9cd5ea5b226339 100644 (file)
@@ -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,8 +108,8 @@ Prerequisites
   DPDK environment.
 
 
-Building DPDK
--------------
+Building MUSDK
+--------------
 
 Driver needs precompiled MUSDK library during compilation.
 
@@ -123,14 +123,18 @@ 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
index 8df4bc6e0b24d224fc5f238d5bb7ea9c2018bfef..863a20ab90daa7363b7e50f670e4c4372e97f51b 100644 (file)
@@ -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')
index 6d97dc8a23f2c151187f96151b7105099f99ed47..384eacff0343755ffc06e0708197914766c58121 100644 (file)
@@ -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']
index 8d72027883498aa68827e67353448a72a8836b75..c887ddc104f3e9040de504267bdb0177c0b400ca 100644 (file)
@@ -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'
index e06eddaac247195adeef5bfc89105e7fa86e5b0e..3015a5559c60546eca6f89b0582097781c41cefc 100644 (file)
@@ -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',
index e384e6dbb29ebbcd9a236b6605c1d8c4c1e243ce..4604328224986eead5c0e63891b48c8ecf073b64 100644 (file)
@@ -18,8 +18,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,