summaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorLuca Boccassi <bluca@debian.org>2018-10-12 18:05:17 +0100
committerThomas Monjalon <thomas@monjalon.net>2018-10-26 15:52:05 +0200
commitb78f32cff94d0fc2a0a6de9a21318d7fb49f394e (patch)
tree87e9f7edec6ed14581ebd1aaf27505fc4b7372d4 /kernel
parenta9460a0b2efb80a913d8770dc188e816b227622f (diff)
downloaddpdk-draft-windows-b78f32cff94d0fc2a0a6de9a21318d7fb49f394e.zip
dpdk-draft-windows-b78f32cff94d0fc2a0a6de9a21318d7fb49f394e.tar.gz
dpdk-draft-windows-b78f32cff94d0fc2a0a6de9a21318d7fb49f394e.tar.xz
kni: support meson build
A Kbuild is also included to allow users to use DKMS natively without additional code. Signed-off-by: Luca Boccassi <bluca@debian.org> Tested-by: Bruce Richardson <bruce.richardson@intel.com> Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/linux/kni/Kbuild8
-rw-r--r--kernel/linux/kni/ethtool/igb/meson.build16
-rw-r--r--kernel/linux/kni/ethtool/ixgbe/meson.build13
-rw-r--r--kernel/linux/kni/ethtool/meson.build5
-rw-r--r--kernel/linux/kni/meson.build34
-rw-r--r--kernel/linux/meson.build2
6 files changed, 77 insertions, 1 deletions
diff --git a/kernel/linux/kni/Kbuild b/kernel/linux/kni/Kbuild
new file mode 100644
index 0000000..de5c27f
--- /dev/null
+++ b/kernel/linux/kni/Kbuild
@@ -0,0 +1,8 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright(c) 2018 Luca Boccassi <bluca@debian.org>
+
+ccflags-y := $(MODULE_CFLAGS)
+obj-m := rte_kni.o
+rte_kni-y := $(patsubst $(src)/%.c,%.o,$(wildcard $(src)/*.c)) \
+ $(patsubst $(src)/%.c,%.o,$(wildcard $(src)/ethtool/ixgbe/*.c)) \
+ $(patsubst $(src)/%.c,%.o,$(wildcard $(src)/ethtool/igb/*.c))
diff --git a/kernel/linux/kni/ethtool/igb/meson.build b/kernel/linux/kni/ethtool/igb/meson.build
new file mode 100644
index 0000000..2f796ac
--- /dev/null
+++ b/kernel/linux/kni/ethtool/igb/meson.build
@@ -0,0 +1,16 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright(c) 2018 Luca Boccassi <bluca@debian.org>
+
+kni_igb_sources = files(
+ 'e1000_82575.c',
+ 'e1000_api.c',
+ 'e1000_i210.c',
+ 'e1000_mac.c',
+ 'e1000_manage.c',
+ 'e1000_mbx.c',
+ 'e1000_nvm.c',
+ 'e1000_phy.c',
+ 'igb_ethtool.c',
+ 'igb_main.c',
+ 'igb_param.c',
+ 'igb_vmdq.c')
diff --git a/kernel/linux/kni/ethtool/ixgbe/meson.build b/kernel/linux/kni/ethtool/ixgbe/meson.build
new file mode 100644
index 0000000..73248b1
--- /dev/null
+++ b/kernel/linux/kni/ethtool/ixgbe/meson.build
@@ -0,0 +1,13 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright(c) 2018 Luca Boccassi <bluca@debian.org>
+
+kni_ixgbe_sources = files(
+ 'ixgbe_82598.c',
+ 'ixgbe_82599.c',
+ 'ixgbe_api.c',
+ 'ixgbe_common.c',
+ 'ixgbe_ethtool.c',
+ 'ixgbe_main.c',
+ 'ixgbe_phy.c',
+ 'ixgbe_x540.c',
+ 'kcompat.c')
diff --git a/kernel/linux/kni/ethtool/meson.build b/kernel/linux/kni/ethtool/meson.build
new file mode 100644
index 0000000..7a8458d
--- /dev/null
+++ b/kernel/linux/kni/ethtool/meson.build
@@ -0,0 +1,5 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright(c) 2018 Luca Boccassi <bluca@debian.org>
+
+subdir('igb')
+subdir('ixgbe')
diff --git a/kernel/linux/kni/meson.build b/kernel/linux/kni/meson.build
new file mode 100644
index 0000000..a09af5a
--- /dev/null
+++ b/kernel/linux/kni/meson.build
@@ -0,0 +1,34 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright(c) 2018 Luca Boccassi <bluca@debian.org>
+
+subdir('ethtool')
+
+kni_mkfile = custom_target('rte_kni_makefile',
+ output: 'Makefile',
+ command: ['touch', '@OUTPUT@'])
+
+kni_sources = files(
+ 'kni_ethtool.c',
+ 'kni_misc.c',
+ 'kni_net.c',
+ 'Kbuild')
+
+custom_target('rte_kni',
+ input: kni_sources + kni_igb_sources + kni_ixgbe_sources,
+ output: 'rte_kni.ko',
+ command: ['make', '-j4', '-C', kernel_dir,
+ 'M=' + meson.current_build_dir(),
+ 'src=' + meson.current_source_dir(),
+ 'MODULE_CFLAGS=-include ' + meson.source_root() + '/config/rte_config.h' +
+ ' -I' + meson.source_root() + '/lib/librte_eal/common/include' +
+ ' -I' + meson.source_root() + '/lib/librte_eal/linuxapp/eal/include' +
+ ' -I' + meson.build_root() +
+ ' -I' + meson.current_source_dir() +
+ ' -I' + meson.current_source_dir() + '/ethtool/ixgbe' +
+ ' -I' + meson.current_source_dir() + '/ethtool/igb',
+ 'modules'],
+ depends: kni_mkfile,
+ console: true,
+ install: true,
+ install_dir: kernel_dir + '/../extra/dpdk',
+ build_by_default: get_option('enable_kmods'))
diff --git a/kernel/linux/meson.build b/kernel/linux/meson.build
index a924c7b..5b7ec06 100644
--- a/kernel/linux/meson.build
+++ b/kernel/linux/meson.build
@@ -1,7 +1,7 @@
# SPDX-License-Identifier: BSD-3-Clause
# Copyright(c) 2018 Intel Corporation
-subdirs = ['igb_uio']
+subdirs = ['igb_uio', 'kni']
WARN_CROSS_COMPILE='Need "kernel_dir" option for kmod compilation when cross-compiling'
WARN_NO_HEADERS='Cannot compile kernel modules as requested - are kernel headers installed?'