DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] build: add meson.build for kni kernel module
@ 2018-10-11 19:46 Luca Boccassi
  2018-10-12 14:09 ` Bruce Richardson
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Luca Boccassi @ 2018-10-11 19:46 UTC (permalink / raw)
  To: dev; +Cc: bruce.richardson, ferruh.yigit, Luca Boccassi

A Kbuild is also included to allow users to use DKMS natively without
additional code.

Signed-off-by: Luca Boccassi <bluca@debian.org>
---
build-tested on debian sid am64

 kernel/linux/kni/Kbuild      |  8 ++++++
 kernel/linux/kni/meson.build | 51 ++++++++++++++++++++++++++++++++++++
 kernel/linux/meson.build     |  2 +-
 3 files changed, 60 insertions(+), 1 deletion(-)
 create mode 100644 kernel/linux/kni/Kbuild
 create mode 100644 kernel/linux/kni/meson.build

diff --git a/kernel/linux/kni/Kbuild b/kernel/linux/kni/Kbuild
new file mode 100644
index 0000000000..de5c27f328
--- /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/meson.build b/kernel/linux/kni/meson.build
new file mode 100644
index 0000000000..cf881b1c1f
--- /dev/null
+++ b/kernel/linux/kni/meson.build
@@ -0,0 +1,51 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright(c) 2018 Luca Boccassi <bluca@debian.org>
+
+kni_mkfile = custom_target('rte_kni_makefile',
+	output: 'Makefile',
+	command: ['touch', '@OUTPUT@'])
+
+kni_sources = [
+	'kni_ethtool.c',
+	'kni_misc.c',
+	'kni_net.c',
+	'ethtool/igb/e1000_82575.c',
+	'ethtool/igb/e1000_api.c',
+	'ethtool/igb/e1000_i210.c',
+	'ethtool/igb/e1000_mac.c',
+	'ethtool/igb/e1000_manage.c',
+	'ethtool/igb/e1000_mbx.c',
+	'ethtool/igb/e1000_nvm.c',
+	'ethtool/igb/e1000_phy.c',
+	'ethtool/igb/igb_ethtool.c',
+	'ethtool/igb/igb_main.c',
+	'ethtool/igb/igb_param.c',
+	'ethtool/igb/igb_vmdq.c',
+	'ethtool/ixgbe/ixgbe_82598.c',
+	'ethtool/ixgbe/ixgbe_82599.c',
+	'ethtool/ixgbe/ixgbe_api.c',
+	'ethtool/ixgbe/ixgbe_common.c',
+	'ethtool/ixgbe/ixgbe_ethtool.c',
+	'ethtool/ixgbe/ixgbe_main.c',
+	'ethtool/ixgbe/ixgbe_phy.c',
+	'ethtool/ixgbe/ixgbe_x540.c',
+	'ethtool/ixgbe/kcompat.c',
+	'Kbuild']
+
+custom_target('rte_kni',
+	input: kni_sources,
+	output: 'rte_kni.ko',
+	command: ['make', '-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() + '/ethtool/ixgbe' +
+		' -I' + meson.current_source_dir() + '/ethtool/igb',
+		'modules'],
+	depends: kni_mkfile,
+	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 a924c7b6fb..5b7ec06e1d 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?'
-- 
2.19.1

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

* Re: [dpdk-dev] [PATCH] build: add meson.build for kni kernel module
  2018-10-11 19:46 [dpdk-dev] [PATCH] build: add meson.build for kni kernel module Luca Boccassi
@ 2018-10-12 14:09 ` Bruce Richardson
  2018-10-12 15:13   ` Luca Boccassi
  2018-10-12 15:12 ` [dpdk-dev] [PATCH v2] " Luca Boccassi
  2018-10-12 17:05 ` [dpdk-dev] [PATCH v3] " Luca Boccassi
  2 siblings, 1 reply; 11+ messages in thread
From: Bruce Richardson @ 2018-10-12 14:09 UTC (permalink / raw)
  To: Luca Boccassi; +Cc: dev, ferruh.yigit

On Thu, Oct 11, 2018 at 08:46:29PM +0100, Luca Boccassi wrote:
> A Kbuild is also included to allow users to use DKMS natively without
> additional code.
> 
> Signed-off-by: Luca Boccassi <bluca@debian.org>
> ---
> build-tested on debian sid am64
> 
>  kernel/linux/kni/Kbuild      |  8 ++++++
>  kernel/linux/kni/meson.build | 51 ++++++++++++++++++++++++++++++++++++
>  kernel/linux/meson.build     |  2 +-
>  3 files changed, 60 insertions(+), 1 deletion(-)
>  create mode 100644 kernel/linux/kni/Kbuild
>  create mode 100644 kernel/linux/kni/meson.build
> 
I get a couple of errors building this on Fedora 28. First problem is that
I get a compilation error for a missing rte_fifo.h. The fix for that error
is to ensure the current dir is on the include list:

                ' -I' + meson.build_root() +
+               ' -I' + meson.current_source_dir() +
                ' -I' + meson.current_source_dir() + '/ethtool/ixgbe' +

Then I hit a second error, where the compile fails because the output
directory for the ethdev files does not exist. 

Fatal error: can't create /home/bruce/dpdk-clean/build-gcc-static/kernel/linux/kni/ethtool/ixgbe/ixgbe_ethtool.o: No such file or directory
make[1]: *** [scripts/Makefile.build:318: /home/bruce/dpdk-clean/build-gcc-static/kernel/linux/kni/ethtool/ixgbe/ixgbe_ethtool.o] Error 2

I haven't fixed this, but I think the easiest fix is probably to split the
file lists so that each file is listed in a meson.build in its own
subdirectory. Then using subdir to build up the file list rather than
having it all at one gom should cause meson to create the subdirectory
structure in the build directory.
There may be other, better solutions, though.

/Bruce

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

* [dpdk-dev] [PATCH v2] build: add meson.build for kni kernel module
  2018-10-11 19:46 [dpdk-dev] [PATCH] build: add meson.build for kni kernel module Luca Boccassi
  2018-10-12 14:09 ` Bruce Richardson
@ 2018-10-12 15:12 ` Luca Boccassi
  2018-10-12 16:29   ` Bruce Richardson
  2018-10-12 17:05 ` [dpdk-dev] [PATCH v3] " Luca Boccassi
  2 siblings, 1 reply; 11+ messages in thread
From: Luca Boccassi @ 2018-10-12 15:12 UTC (permalink / raw)
  To: dev; +Cc: bruce.richardson, ferruh.yigit, Luca Boccassi

A Kbuild is also included to allow users to use DKMS natively without
additional code.

Signed-off-by: Luca Boccassi <bluca@debian.org>
---
v2: add local directory to -I and build sources list recursively to
    fix build on Fedora

 kernel/linux/kni/Kbuild                    |  8 ++++++
 kernel/linux/kni/ethtool/igb/meson.build   | 16 +++++++++++
 kernel/linux/kni/ethtool/ixgbe/meson.build | 13 +++++++++
 kernel/linux/kni/ethtool/meson.build       |  5 ++++
 kernel/linux/kni/meson.build               | 33 ++++++++++++++++++++++
 kernel/linux/meson.build                   |  2 +-
 6 files changed, 76 insertions(+), 1 deletion(-)
 create mode 100644 kernel/linux/kni/Kbuild
 create mode 100644 kernel/linux/kni/ethtool/igb/meson.build
 create mode 100644 kernel/linux/kni/ethtool/ixgbe/meson.build
 create mode 100644 kernel/linux/kni/ethtool/meson.build
 create mode 100644 kernel/linux/kni/meson.build

diff --git a/kernel/linux/kni/Kbuild b/kernel/linux/kni/Kbuild
new file mode 100644
index 0000000000..de5c27f328
--- /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 0000000000..2f796ac0b2
--- /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 0000000000..73248b13e4
--- /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 0000000000..7a8458ddcd
--- /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 0000000000..87469c6ca3
--- /dev/null
+++ b/kernel/linux/kni/meson.build
@@ -0,0 +1,33 @@
+# 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', '-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,
+	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 a924c7b6fb..5b7ec06e1d 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?'
-- 
2.19.1

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

* Re: [dpdk-dev] [PATCH] build: add meson.build for kni kernel module
  2018-10-12 14:09 ` Bruce Richardson
@ 2018-10-12 15:13   ` Luca Boccassi
  0 siblings, 0 replies; 11+ messages in thread
From: Luca Boccassi @ 2018-10-12 15:13 UTC (permalink / raw)
  To: Bruce Richardson; +Cc: dev, ferruh.yigit

On Fri, 2018-10-12 at 15:09 +0100, Bruce Richardson wrote:
> On Thu, Oct 11, 2018 at 08:46:29PM +0100, Luca Boccassi wrote:
> > A Kbuild is also included to allow users to use DKMS natively
> > without
> > additional code.
> > 
> > Signed-off-by: Luca Boccassi <bluca@debian.org>
> > ---
> > build-tested on debian sid am64
> > 
> >  kernel/linux/kni/Kbuild      |  8 ++++++
> >  kernel/linux/kni/meson.build | 51
> > ++++++++++++++++++++++++++++++++++++
> >  kernel/linux/meson.build     |  2 +-
> >  3 files changed, 60 insertions(+), 1 deletion(-)
> >  create mode 100644 kernel/linux/kni/Kbuild
> >  create mode 100644 kernel/linux/kni/meson.build
> > 
> 
> I get a couple of errors building this on Fedora 28. First problem is
> that
> I get a compilation error for a missing rte_fifo.h. The fix for that
> error
> is to ensure the current dir is on the include list:
> 
>                 ' -I' + meson.build_root() +
> +               ' -I' + meson.current_source_dir() +
>                 ' -I' + meson.current_source_dir() + '/ethtool/ixgbe'
> +
> 
> Then I hit a second error, where the compile fails because the output
> directory for the ethdev files does not exist. 
> 
> Fatal error: can't create /home/bruce/dpdk-clean/build-gcc-
> static/kernel/linux/kni/ethtool/ixgbe/ixgbe_ethtool.o: No such file
> or directory
> make[1]: *** [scripts/Makefile.build:318: /home/bruce/dpdk-
> clean/build-gcc-
> static/kernel/linux/kni/ethtool/ixgbe/ixgbe_ethtool.o] Error 2
> 
> I haven't fixed this, but I think the easiest fix is probably to
> split the
> file lists so that each file is listed in a meson.build in its own
> subdirectory. Then using subdir to build up the file list rather than
> having it all at one gom should cause meson to create the
> subdirectory
> structure in the build directory.
> There may be other, better solutions, though.
> 
> /Bruce

Hi,

Interesting, I guess it's down to differences between the kernel
makefiles in Debian and Fedora? Although the include one is strange.

I've sent a v2 with your suggestions, please give it a run when you've
got a sec.

-- 
Kind regards,
Luca Boccassi

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

* Re: [dpdk-dev] [PATCH v2] build: add meson.build for kni kernel module
  2018-10-12 15:12 ` [dpdk-dev] [PATCH v2] " Luca Boccassi
@ 2018-10-12 16:29   ` Bruce Richardson
  2018-10-12 17:06     ` Luca Boccassi
  0 siblings, 1 reply; 11+ messages in thread
From: Bruce Richardson @ 2018-10-12 16:29 UTC (permalink / raw)
  To: Luca Boccassi; +Cc: dev, ferruh.yigit

On Fri, Oct 12, 2018 at 04:12:21PM +0100, Luca Boccassi wrote:
> A Kbuild is also included to allow users to use DKMS natively without
> additional code.
> 
> Signed-off-by: Luca Boccassi <bluca@debian.org>
> ---
> v2: add local directory to -I and build sources list recursively to
>     fix build on Fedora
> 
Yep, now seems to build for me on Fedora. One minor suggestion is to look
to use the "console" keyword on the custom_target if possible. It should
help prevent noticable stalls as make runs in the background.
[Unfortunately, it's meson 0.48 onward only, so if conditionals are needed,
just ignore this suggestion]

Also, do we want to use "make -j" for this, given the number of files?
[Maybe -j4 just?]

Tested-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>

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

* [dpdk-dev] [PATCH v3] build: add meson.build for kni kernel module
  2018-10-11 19:46 [dpdk-dev] [PATCH] build: add meson.build for kni kernel module Luca Boccassi
  2018-10-12 14:09 ` Bruce Richardson
  2018-10-12 15:12 ` [dpdk-dev] [PATCH v2] " Luca Boccassi
@ 2018-10-12 17:05 ` Luca Boccassi
  2018-10-31 10:33   ` Thomas Monjalon
  2 siblings, 1 reply; 11+ messages in thread
From: Luca Boccassi @ 2018-10-12 17:05 UTC (permalink / raw)
  To: dev; +Cc: bruce.richardson, ferruh.yigit, Luca Boccassi

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>
---
v2: add local directory to -I and build sources list recursively to
    fix build on Fedora
v3: add console: true so that output is not buffered, given it takes a
    few seconds to build, and -j4 to the make call, given there are
    more than a few source files.

 kernel/linux/kni/Kbuild                    |  8 +++++
 kernel/linux/kni/ethtool/igb/meson.build   | 16 ++++++++++
 kernel/linux/kni/ethtool/ixgbe/meson.build | 13 +++++++++
 kernel/linux/kni/ethtool/meson.build       |  5 ++++
 kernel/linux/kni/meson.build               | 34 ++++++++++++++++++++++
 kernel/linux/meson.build                   |  2 +-
 6 files changed, 77 insertions(+), 1 deletion(-)
 create mode 100644 kernel/linux/kni/Kbuild
 create mode 100644 kernel/linux/kni/ethtool/igb/meson.build
 create mode 100644 kernel/linux/kni/ethtool/ixgbe/meson.build
 create mode 100644 kernel/linux/kni/ethtool/meson.build
 create mode 100644 kernel/linux/kni/meson.build

diff --git a/kernel/linux/kni/Kbuild b/kernel/linux/kni/Kbuild
new file mode 100644
index 0000000000..de5c27f328
--- /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 0000000000..2f796ac0b2
--- /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 0000000000..73248b13e4
--- /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 0000000000..7a8458ddcd
--- /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 0000000000..a09af5aa5f
--- /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 a924c7b6fb..5b7ec06e1d 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?'
-- 
2.19.1

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

* Re: [dpdk-dev] [PATCH v2] build: add meson.build for kni kernel module
  2018-10-12 16:29   ` Bruce Richardson
@ 2018-10-12 17:06     ` Luca Boccassi
       [not found]       ` <CGME20181029140903eucas1p1021673ecc6c9d40c31dd21ca52dbb114@eucas1p1.samsung.com>
  0 siblings, 1 reply; 11+ messages in thread
From: Luca Boccassi @ 2018-10-12 17:06 UTC (permalink / raw)
  To: Bruce Richardson; +Cc: dev, ferruh.yigit

On Fri, 2018-10-12 at 17:29 +0100, Bruce Richardson wrote:
> On Fri, Oct 12, 2018 at 04:12:21PM +0100, Luca Boccassi wrote:
> > A Kbuild is also included to allow users to use DKMS natively
> > without
> > additional code.
> > 
> > Signed-off-by: Luca Boccassi <bluca@debian.org>
> > ---
> > v2: add local directory to -I and build sources list recursively to
> >     fix build on Fedora
> > 
> 
> Yep, now seems to build for me on Fedora. One minor suggestion is to
> look
> to use the "console" keyword on the custom_target if possible. It
> should
> help prevent noticable stalls as make runs in the background.
> [Unfortunately, it's meson 0.48 onward only, so if conditionals are
> needed,
> just ignore this suggestion]

Good idea, I just with 0.48, 0.47 and 0.41 and in all cases there are
no complaints or errors, it's simply ignored in the older versions.

> Also, do we want to use "make -j" for this, given the number of
> files?
> [Maybe -j4 just?]

Yeah makes sense, added j4.

Sent v3 with both changes and the ack, thanks.

-- 
Kind regards,
Luca Boccassi

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

* Re: [dpdk-dev] [PATCH v2] build: add meson.build for kni kernel module
       [not found]       ` <CGME20181029140903eucas1p1021673ecc6c9d40c31dd21ca52dbb114@eucas1p1.samsung.com>
@ 2018-10-29 14:09         ` Ilya Maximets
  2018-10-29 15:33           ` Luca Boccassi
  0 siblings, 1 reply; 11+ messages in thread
From: Ilya Maximets @ 2018-10-29 14:09 UTC (permalink / raw)
  To: dev, Bruce Richardson, Luca Boccassi

> On Fri, 2018-10-12 at 17:29 +0100, Bruce Richardson wrote:
>> On Fri, Oct 12, 2018 at 04:12:21PM +0100, Luca Boccassi wrote:
>> > A Kbuild is also included to allow users to use DKMS natively
>> > without
>> > additional code.
>> > 
>> > Signed-off-by: Luca Boccassi <bluca at debian.org>
>> > ---
>> > v2: add local directory to -I and build sources list recursively to
>> >     fix build on Fedora
>> > 
>> 
>> Yep, now seems to build for me on Fedora. One minor suggestion is to
>> look
>> to use the "console" keyword on the custom_target if possible. It
>> should
>> help prevent noticable stalls as make runs in the background.
>> [Unfortunately, it's meson 0.48 onward only, so if conditionals are
>> needed,
>> just ignore this suggestion]
> 
> Good idea, I just with 0.48, 0.47 and 0.41 and in all cases there are
> no complaints or errors, it's simply ignored in the older versions.

Hmm.
I have following on my Ubuntu 18.04 with dpdk v18.11-rc1:

$ meson --version
0.45.1

$ meson build
<...>
kernel/linux/kni/meson.build:16: WARNING: Passed invalid keyword argument "console".
WARNING: This will become a hard error in the future.
WARNING: Unknown keyword arguments in target rte_kni: console
<...>

It builds, but prints above warning.

Best regards, Ilya Maximets.

> 
>> Also, do we want to use "make -j" for this, given the number of
>> files?
>> [Maybe -j4 just?]
> 
> Yeah makes sense, added j4.
> 
> Sent v3 with both changes and the ack, thanks.
> 
> -- 
> Kind regards,
> Luca Boccassi

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

* Re: [dpdk-dev] [PATCH v2] build: add meson.build for kni kernel module
  2018-10-29 14:09         ` Ilya Maximets
@ 2018-10-29 15:33           ` Luca Boccassi
  2018-10-30 10:38             ` Bruce Richardson
  0 siblings, 1 reply; 11+ messages in thread
From: Luca Boccassi @ 2018-10-29 15:33 UTC (permalink / raw)
  To: Ilya Maximets, dev, Bruce Richardson

On Mon, 2018-10-29 at 17:09 +0300, Ilya Maximets wrote:
> > On Fri, 2018-10-12 at 17:29 +0100, Bruce Richardson wrote:
> > > On Fri, Oct 12, 2018 at 04:12:21PM +0100, Luca Boccassi wrote:
> > > > A Kbuild is also included to allow users to use DKMS natively
> > > > without
> > > > additional code.
> > > > 
> > > > Signed-off-by: Luca Boccassi <bluca at debian.org>
> > > > ---
> > > > v2: add local directory to -I and build sources list
> > > > recursively to
> > > >     fix build on Fedora
> > > > 
> > > 
> > > Yep, now seems to build for me on Fedora. One minor suggestion is
> > > to
> > > look
> > > to use the "console" keyword on the custom_target if possible. It
> > > should
> > > help prevent noticable stalls as make runs in the background.
> > > [Unfortunately, it's meson 0.48 onward only, so if conditionals
> > > are
> > > needed,
> > > just ignore this suggestion]
> > 
> > Good idea, I just with 0.48, 0.47 and 0.41 and in all cases there
> > are
> > no complaints or errors, it's simply ignored in the older versions.
> 
> Hmm.
> I have following on my Ubuntu 18.04 with dpdk v18.11-rc1:
> 
> $ meson --version
> 0.45.1
> 
> $ meson build
> <...>
> kernel/linux/kni/meson.build:16: WARNING: Passed invalid keyword
> argument "console".
> WARNING: This will become a hard error in the future.
> WARNING: Unknown keyword arguments in target rte_kni: console
> <...>
> 
> It builds, but prints above warning.
> 
> Best regards, Ilya Maximets.

Interesting, wonder why I didn't see that on 0.41! Anyway those
warnings are fine to ignore, especially in this case.

-- 
Kind regards,
Luca Boccassi

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

* Re: [dpdk-dev] [PATCH v2] build: add meson.build for kni kernel module
  2018-10-29 15:33           ` Luca Boccassi
@ 2018-10-30 10:38             ` Bruce Richardson
  0 siblings, 0 replies; 11+ messages in thread
From: Bruce Richardson @ 2018-10-30 10:38 UTC (permalink / raw)
  To: Luca Boccassi; +Cc: Ilya Maximets, dev

On Mon, Oct 29, 2018 at 03:33:47PM +0000, Luca Boccassi wrote:
> On Mon, 2018-10-29 at 17:09 +0300, Ilya Maximets wrote:
> > > On Fri, 2018-10-12 at 17:29 +0100, Bruce Richardson wrote:
> > > > On Fri, Oct 12, 2018 at 04:12:21PM +0100, Luca Boccassi wrote:
> > > > > A Kbuild is also included to allow users to use DKMS natively
> > > > > without
> > > > > additional code.
> > > > > 
> > > > > Signed-off-by: Luca Boccassi <bluca at debian.org>
> > > > > ---
> > > > > v2: add local directory to -I and build sources list
> > > > > recursively to
> > > > >     fix build on Fedora
> > > > > 
> > > > 
> > > > Yep, now seems to build for me on Fedora. One minor suggestion is
> > > > to
> > > > look
> > > > to use the "console" keyword on the custom_target if possible. It
> > > > should
> > > > help prevent noticable stalls as make runs in the background.
> > > > [Unfortunately, it's meson 0.48 onward only, so if conditionals
> > > > are
> > > > needed,
> > > > just ignore this suggestion]
> > > 
> > > Good idea, I just with 0.48, 0.47 and 0.41 and in all cases there
> > > are
> > > no complaints or errors, it's simply ignored in the older versions.
> > 
> > Hmm.
> > I have following on my Ubuntu 18.04 with dpdk v18.11-rc1:
> > 
> > $ meson --version
> > 0.45.1
> > 
> > $ meson build
> > <...>
> > kernel/linux/kni/meson.build:16: WARNING: Passed invalid keyword
> > argument "console".
> > WARNING: This will become a hard error in the future.
> > WARNING: Unknown keyword arguments in target rte_kni: console
> > <...>
> > 
> > It builds, but prints above warning.
> > 
> > Best regards, Ilya Maximets.
> 
> Interesting, wonder why I didn't see that on 0.41! Anyway those
> warnings are fine to ignore, especially in this case.
> 
Probably because the warnings about unknown parameters only came in a later
version of meson. Earlier versions just ignored them without warning.

/Bruce

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

* Re: [dpdk-dev] [PATCH v3] build: add meson.build for kni kernel module
  2018-10-12 17:05 ` [dpdk-dev] [PATCH v3] " Luca Boccassi
@ 2018-10-31 10:33   ` Thomas Monjalon
  0 siblings, 0 replies; 11+ messages in thread
From: Thomas Monjalon @ 2018-10-31 10:33 UTC (permalink / raw)
  To: Luca Boccassi; +Cc: dev, bruce.richardson, ferruh.yigit

12/10/2018 19:05, Luca Boccassi:
> 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>

Was applied in 18.11-rc1.

Thanks Ferruh for catching the miss of notification :)

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

end of thread, other threads:[~2018-10-31 10:33 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-11 19:46 [dpdk-dev] [PATCH] build: add meson.build for kni kernel module Luca Boccassi
2018-10-12 14:09 ` Bruce Richardson
2018-10-12 15:13   ` Luca Boccassi
2018-10-12 15:12 ` [dpdk-dev] [PATCH v2] " Luca Boccassi
2018-10-12 16:29   ` Bruce Richardson
2018-10-12 17:06     ` Luca Boccassi
     [not found]       ` <CGME20181029140903eucas1p1021673ecc6c9d40c31dd21ca52dbb114@eucas1p1.samsung.com>
2018-10-29 14:09         ` Ilya Maximets
2018-10-29 15:33           ` Luca Boccassi
2018-10-30 10:38             ` Bruce Richardson
2018-10-12 17:05 ` [dpdk-dev] [PATCH v3] " Luca Boccassi
2018-10-31 10:33   ` Thomas Monjalon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).