* [dpdk-dev] [PATCH] kni: resolve build issue for OpenSuse15.3
@ 2021-10-13 14:33 Aman Singh
2021-10-13 16:52 ` Ferruh Yigit
2021-10-19 10:48 ` [dpdk-dev] [PATCH v2] kni: fix build for SLES15-SP3 Ferruh Yigit
0 siblings, 2 replies; 5+ messages in thread
From: Aman Singh @ 2021-10-13 14:33 UTC (permalink / raw)
To: dev; +Cc: ferruh.yigit, stable
As suse version numbering is inconsistent to determine Linux kernel
API to be used. In this patch we check parameter of 'ndo_tx_timeout'
API directly from the kernel source. This is done only for suse build.
Bugzilla ID: 812
Cc: stable@dpdk.org
Signed-off-by: Aman Singh <aman.deep.singh@intel.com>
---
kernel/linux/kni/compat.h | 3 ++-
kernel/linux/kni/meson.build | 14 +++++++++++++-
2 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/kernel/linux/kni/compat.h b/kernel/linux/kni/compat.h
index 5f65640d5e..664785674f 100644
--- a/kernel/linux/kni/compat.h
+++ b/kernel/linux/kni/compat.h
@@ -133,7 +133,8 @@
#if KERNEL_VERSION(5, 6, 0) <= LINUX_VERSION_CODE || \
(defined(RHEL_RELEASE_CODE) && \
- RHEL_RELEASE_VERSION(8, 3) <= RHEL_RELEASE_CODE)
+ RHEL_RELEASE_VERSION(8, 3) <= RHEL_RELEASE_CODE) || \
+ (defined(CONFIG_SUSE_KERNEL) && defined(HAVE_ARG_TX_QUEUE))
#define HAVE_TX_TIMEOUT_TXQUEUE
#endif
diff --git a/kernel/linux/kni/meson.build b/kernel/linux/kni/meson.build
index c15c78b0b4..32533fe932 100644
--- a/kernel/linux/kni/meson.build
+++ b/kernel/linux/kni/meson.build
@@ -1,6 +1,17 @@
# SPDX-License-Identifier: BSD-3-Clause
# Copyright(c) 2018 Luca Boccassi <bluca@debian.org>
+# For SUSE build check function arguments of ndo_tx_timeout API
+# Ref: https://jira.devtools.intel.com/browse/DPDK-29263
+kmod_cflags = ''
+file_path = kernel_build_dir + '/include/linux/netdevice.h'
+run_cmd = run_command('grep', 'ndo_tx_timeout', file_path)
+
+if run_cmd.stdout().contains('txqueue') == true
+ kmod_cflags = '-DHAVE_ARG_TX_QUEUE'
+endif
+
+
kni_mkfile = custom_target('rte_kni_makefile',
output: 'Makefile',
command: ['touch', '@OUTPUT@'])
@@ -17,7 +28,8 @@ custom_target('rte_kni',
command: ['make', '-j4', '-C', kernel_build_dir,
'M=' + meson.current_build_dir(),
'src=' + meson.current_source_dir(),
- 'MODULE_CFLAGS=-include ' + meson.source_root() + '/config/rte_config.h' +
+ ' '.join(['MODULE_CFLAGS=', kmod_cflags,'-include '])
+ + meson.source_root() + '/config/rte_config.h' +
' -I' + meson.source_root() + '/lib/eal/include' +
' -I' + meson.source_root() + '/lib/kni' +
' -I' + meson.build_root() +
--
2.17.1
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [dpdk-dev] [PATCH] kni: resolve build issue for OpenSuse15.3
2021-10-13 14:33 [dpdk-dev] [PATCH] kni: resolve build issue for OpenSuse15.3 Aman Singh
@ 2021-10-13 16:52 ` Ferruh Yigit
2021-10-19 10:48 ` [dpdk-dev] [PATCH v2] kni: fix build for SLES15-SP3 Ferruh Yigit
1 sibling, 0 replies; 5+ messages in thread
From: Ferruh Yigit @ 2021-10-13 16:52 UTC (permalink / raw)
To: Aman Singh, dev
Cc: stable, longfengx.liang, Christian Ehrhardt, Luca Boccassi
On 10/13/2021 3:33 PM, Aman Singh wrote:
> As suse version numbering is inconsistent to determine Linux kernel
> API to be used. In this patch we check parameter of 'ndo_tx_timeout'
> API directly from the kernel source. This is done only for suse build.
>
> Bugzilla ID: 812
> Cc: stable@dpdk.org
>
> Signed-off-by: Aman Singh <aman.deep.singh@intel.com>
> ---
> kernel/linux/kni/compat.h | 3 ++-
> kernel/linux/kni/meson.build | 14 +++++++++++++-
> 2 files changed, 15 insertions(+), 2 deletions(-)
>
> diff --git a/kernel/linux/kni/compat.h b/kernel/linux/kni/compat.h
> index 5f65640d5e..664785674f 100644
> --- a/kernel/linux/kni/compat.h
> +++ b/kernel/linux/kni/compat.h
> @@ -133,7 +133,8 @@
>
> #if KERNEL_VERSION(5, 6, 0) <= LINUX_VERSION_CODE || \
> (defined(RHEL_RELEASE_CODE) && \
> - RHEL_RELEASE_VERSION(8, 3) <= RHEL_RELEASE_CODE)
> + RHEL_RELEASE_VERSION(8, 3) <= RHEL_RELEASE_CODE) || \
> + (defined(CONFIG_SUSE_KERNEL) && defined(HAVE_ARG_TX_QUEUE))
> #define HAVE_TX_TIMEOUT_TXQUEUE
> #endif
>
> diff --git a/kernel/linux/kni/meson.build b/kernel/linux/kni/meson.build
> index c15c78b0b4..32533fe932 100644
> --- a/kernel/linux/kni/meson.build
> +++ b/kernel/linux/kni/meson.build
> @@ -1,6 +1,17 @@
> # SPDX-License-Identifier: BSD-3-Clause
> # Copyright(c) 2018 Luca Boccassi <bluca@debian.org>
>
> +# For SUSE build check function arguments of ndo_tx_timeout API
> +# Ref: https://jira.devtools.intel.com/browse/DPDK-29263
> +kmod_cflags = ''
> +file_path = kernel_build_dir + '/include/linux/netdevice.h'
> +run_cmd = run_command('grep', 'ndo_tx_timeout', file_path)
> +
> +if run_cmd.stdout().contains('txqueue') == true
> + kmod_cflags = '-DHAVE_ARG_TX_QUEUE'
> +endif
> +
> +
> kni_mkfile = custom_target('rte_kni_makefile',
> output: 'Makefile',
> command: ['touch', '@OUTPUT@'])
> @@ -17,7 +28,8 @@ custom_target('rte_kni',
> command: ['make', '-j4', '-C', kernel_build_dir,
> 'M=' + meson.current_build_dir(),
> 'src=' + meson.current_source_dir(),
> - 'MODULE_CFLAGS=-include ' + meson.source_root() + '/config/rte_config.h' +
> + ' '.join(['MODULE_CFLAGS=', kmod_cflags,'-include '])
> + + meson.source_root() + '/config/rte_config.h' +
> ' -I' + meson.source_root() + '/lib/eal/include' +
> ' -I' + meson.source_root() + '/lib/kni' +
> ' -I' + meson.build_root() +
>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
I didn't check on the SUSE, but _unconventional_ detection method
is not causing any problem in my test environment.
^ permalink raw reply [flat|nested] 5+ messages in thread
* [dpdk-dev] [PATCH v2] kni: fix build for SLES15-SP3
2021-10-13 14:33 [dpdk-dev] [PATCH] kni: resolve build issue for OpenSuse15.3 Aman Singh
2021-10-13 16:52 ` Ferruh Yigit
@ 2021-10-19 10:48 ` Ferruh Yigit
2021-10-20 7:14 ` Jiang, YuX
1 sibling, 1 reply; 5+ messages in thread
From: Ferruh Yigit @ 2021-10-19 10:48 UTC (permalink / raw)
To: dev; +Cc: Ferruh Yigit, Aman Singh, stable, Christian Ehrhardt, Marco Varlese
From: Aman Singh <aman.deep.singh@intel.com>
As suse version numbering is inconsistent to determine Linux kernel
API to be used. In this patch we check parameter of 'ndo_tx_timeout'
API directly from the kernel source. This is done only for suse build.
Bugzilla ID: 812
Cc: stable@dpdk.org
Signed-off-by: Aman Singh <aman.deep.singh@intel.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
Cc: Christian Ehrhardt <christian.ehrhardt@canonical.com>
Cc: Marco Varlese <mvarlese@suse.de>
v2:
* Use explicit 'source' folder for header path. In SUSE 'source' is not
link to 'build' folder.
---
kernel/linux/kni/compat.h | 3 ++-
kernel/linux/kni/meson.build | 14 +++++++++++++-
kernel/linux/meson.build | 5 +++++
3 files changed, 20 insertions(+), 2 deletions(-)
diff --git a/kernel/linux/kni/compat.h b/kernel/linux/kni/compat.h
index 5f65640d5ed2..664785674ff1 100644
--- a/kernel/linux/kni/compat.h
+++ b/kernel/linux/kni/compat.h
@@ -133,7 +133,8 @@
#if KERNEL_VERSION(5, 6, 0) <= LINUX_VERSION_CODE || \
(defined(RHEL_RELEASE_CODE) && \
- RHEL_RELEASE_VERSION(8, 3) <= RHEL_RELEASE_CODE)
+ RHEL_RELEASE_VERSION(8, 3) <= RHEL_RELEASE_CODE) || \
+ (defined(CONFIG_SUSE_KERNEL) && defined(HAVE_ARG_TX_QUEUE))
#define HAVE_TX_TIMEOUT_TXQUEUE
#endif
diff --git a/kernel/linux/kni/meson.build b/kernel/linux/kni/meson.build
index c15c78b0b474..c683fc7b36b2 100644
--- a/kernel/linux/kni/meson.build
+++ b/kernel/linux/kni/meson.build
@@ -1,6 +1,17 @@
# SPDX-License-Identifier: BSD-3-Clause
# Copyright(c) 2018 Luca Boccassi <bluca@debian.org>
+# For SUSE build check function arguments of ndo_tx_timeout API
+# Ref: https://jira.devtools.intel.com/browse/DPDK-29263
+kmod_cflags = ''
+file_path = kernel_source_dir + '/include/linux/netdevice.h'
+run_cmd = run_command('grep', 'ndo_tx_timeout', file_path)
+
+if run_cmd.stdout().contains('txqueue') == true
+ kmod_cflags = '-DHAVE_ARG_TX_QUEUE'
+endif
+
+
kni_mkfile = custom_target('rte_kni_makefile',
output: 'Makefile',
command: ['touch', '@OUTPUT@'])
@@ -17,7 +28,8 @@ custom_target('rte_kni',
command: ['make', '-j4', '-C', kernel_build_dir,
'M=' + meson.current_build_dir(),
'src=' + meson.current_source_dir(),
- 'MODULE_CFLAGS=-include ' + meson.source_root() + '/config/rte_config.h' +
+ ' '.join(['MODULE_CFLAGS=', kmod_cflags,'-include '])
+ + meson.source_root() + '/config/rte_config.h' +
' -I' + meson.source_root() + '/lib/eal/include' +
' -I' + meson.source_root() + '/lib/kni' +
' -I' + meson.build_root() +
diff --git a/kernel/linux/meson.build b/kernel/linux/meson.build
index 3a00ea954cc5..0637452e955c 100644
--- a/kernel/linux/meson.build
+++ b/kernel/linux/meson.build
@@ -4,6 +4,7 @@
subdirs = ['kni']
kernel_build_dir = get_option('kernel_dir')
+kernel_source_dir = get_option('kernel_dir')
kernel_install_dir = ''
install = not meson.is_cross_build()
cross_args = []
@@ -16,6 +17,10 @@ if not meson.is_cross_build()
# use default path for native builds
kernel_build_dir = '/lib/modules/' + kernel_version + '/build'
endif
+ if kernel_source_dir == ''
+ # use default path for native builds
+ kernel_source_dir = '/lib/modules/' + kernel_version + '/source'
+ endif
# test running make in kernel directory, using "make kernelversion"
make_returncode = run_command('make', '-sC', kernel_build_dir,
--
2.31.1
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [dpdk-dev] [PATCH v2] kni: fix build for SLES15-SP3
2021-10-19 10:48 ` [dpdk-dev] [PATCH v2] kni: fix build for SLES15-SP3 Ferruh Yigit
@ 2021-10-20 7:14 ` Jiang, YuX
2021-10-25 13:33 ` Thomas Monjalon
0 siblings, 1 reply; 5+ messages in thread
From: Jiang, YuX @ 2021-10-20 7:14 UTC (permalink / raw)
To: Yigit, Ferruh, dev
Cc: Yigit, Ferruh, Singh, Aman Deep, stable, Christian Ehrhardt,
Marco Varlese
> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of Ferruh Yigit
> Sent: Tuesday, October 19, 2021 6:49 PM
> To: dev@dpdk.org
> Cc: Yigit, Ferruh <ferruh.yigit@intel.com>; Singh, Aman Deep
> <aman.deep.singh@intel.com>; stable@dpdk.org; Christian Ehrhardt
> <christian.ehrhardt@canonical.com>; Marco Varlese <mvarlese@suse.de>
> Subject: [dpdk-dev] [PATCH v2] kni: fix build for SLES15-SP3
>
> From: Aman Singh <aman.deep.singh@intel.com>
>
> As suse version numbering is inconsistent to determine Linux kernel API to
> be used. In this patch we check parameter of 'ndo_tx_timeout'
> API directly from the kernel source. This is done only for suse build.
>
> Bugzilla ID: 812
> Cc: stable@dpdk.org
>
> Signed-off-by: Aman Singh <aman.deep.singh@intel.com>
> Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
Tested-by: Longfeng Liang <longfengx.liang@intel.com>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [dpdk-dev] [PATCH v2] kni: fix build for SLES15-SP3
2021-10-20 7:14 ` Jiang, YuX
@ 2021-10-25 13:33 ` Thomas Monjalon
0 siblings, 0 replies; 5+ messages in thread
From: Thomas Monjalon @ 2021-10-25 13:33 UTC (permalink / raw)
To: Yigit, Ferruh, Singh, Aman Deep
Cc: dev, stable, Christian Ehrhardt, Marco Varlese, Jiang, YuX
> > From: Aman Singh <aman.deep.singh@intel.com>
> >
> > As suse version numbering is inconsistent to determine Linux kernel API to
> > be used. In this patch we check parameter of 'ndo_tx_timeout'
> > API directly from the kernel source. This is done only for suse build.
> >
> > Bugzilla ID: 812
> > Cc: stable@dpdk.org
> >
> > Signed-off-by: Aman Singh <aman.deep.singh@intel.com>
> > Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
> Tested-by: Longfeng Liang <longfengx.liang@intel.com>
Applied, thanks.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2021-10-25 13:33 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-13 14:33 [dpdk-dev] [PATCH] kni: resolve build issue for OpenSuse15.3 Aman Singh
2021-10-13 16:52 ` Ferruh Yigit
2021-10-19 10:48 ` [dpdk-dev] [PATCH v2] kni: fix build for SLES15-SP3 Ferruh Yigit
2021-10-20 7:14 ` Jiang, YuX
2021-10-25 13: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).