patch 'kni: fix build for SLES15-SP3' has been queued to stable release 19.11.11

christian.ehrhardt at canonical.com christian.ehrhardt at canonical.com
Tue Nov 30 17:35:00 CET 2021


Hi,

FYI, your patch has been queued to stable release 19.11.11

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before December 10th 2021. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://github.com/cpaelzer/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/cpaelzer/dpdk-stable-queue/commit/6c8f6b72f28c713a7017d0db9ce95b2377ce4366

Thanks.

Christian Ehrhardt <christian.ehrhardt at canonical.com>

---
>From 6c8f6b72f28c713a7017d0db9ce95b2377ce4366 Mon Sep 17 00:00:00 2001
From: Aman Singh <aman.deep.singh at intel.com>
Date: Tue, 19 Oct 2021 11:48:41 +0100
Subject: [PATCH] kni: fix build for SLES15-SP3

[ upstream commit c28e2165ec360c39ea0e3a0c02b4229966697384 ]

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

Signed-off-by: Aman Singh <aman.deep.singh at intel.com>
Acked-by: Ferruh Yigit <ferruh.yigit at intel.com>
Tested-by: Longfeng Liang <longfengx.liang at intel.com>
---
 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 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 f93e97fa09..679fdf4f51 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 at 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@'])
@@ -16,7 +27,8 @@ custom_target('rte_kni',
 	command: ['make', '-j4', '-C', kernel_dir + '/build',
 		'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/librte_eal/common/include' +
 		' -I' + meson.source_root() + '/lib/librte_eal/linux/eal/include' +
 		' -I' + meson.build_root() +
diff --git a/kernel/linux/meson.build b/kernel/linux/meson.build
index 1796cc6861..cd74739905 100644
--- a/kernel/linux/meson.build
+++ b/kernel/linux/meson.build
@@ -10,10 +10,15 @@ if get_option('kernel_dir') == '' and meson.is_cross_build()
 endif
 
 kernel_dir = get_option('kernel_dir')
+kernel_source_dir = get_option('kernel_dir')
 if kernel_dir == ''
 	# use default path for native builds
 	kernel_version = run_command('uname', '-r').stdout().strip()
 	kernel_dir = '/lib/modules/' + kernel_version
+	if kernel_source_dir == ''
+		# use default path for native builds
+		kernel_source_dir = '/lib/modules/' + kernel_version + '/source'
+	endif
 endif
 
 # test running make in kernel directory, using "make kernelversion"
-- 
2.34.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-11-30 16:50:11.456823890 +0100
+++ 0096-kni-fix-build-for-SLES15-SP3.patch	2021-11-30 16:50:05.894874293 +0100
@@ -1 +1 @@
-From c28e2165ec360c39ea0e3a0c02b4229966697384 Mon Sep 17 00:00:00 2001
+From 6c8f6b72f28c713a7017d0db9ce95b2377ce4366 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit c28e2165ec360c39ea0e3a0c02b4229966697384 ]
+
@@ -11 +12,0 @@
-Cc: stable at dpdk.org
@@ -37 +38 @@
-index c15c78b0b4..c683fc7b36 100644
+index f93e97fa09..679fdf4f51 100644
@@ -56,12 +57,12 @@
-         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() +
+ 	output: 'Makefile',
+ 	command: ['touch', '@OUTPUT@'])
+@@ -16,7 +27,8 @@ custom_target('rte_kni',
+ 	command: ['make', '-j4', '-C', kernel_dir + '/build',
+ 		'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/librte_eal/common/include' +
+ 		' -I' + meson.source_root() + '/lib/librte_eal/linux/eal/include' +
+ 		' -I' + meson.build_root() +
@@ -69 +70 @@
-index 3a00ea954c..0637452e95 100644
+index 1796cc6861..cd74739905 100644
@@ -72,2 +73,2 @@
-@@ -4,6 +4,7 @@
- subdirs = ['kni']
+@@ -10,10 +10,15 @@ if get_option('kernel_dir') == '' and meson.is_cross_build()
+ endif
@@ -75 +76 @@
- kernel_build_dir = get_option('kernel_dir')
+ kernel_dir = get_option('kernel_dir')
@@ -77,11 +78,9 @@
- 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
+ if kernel_dir == ''
+ 	# use default path for native builds
+ 	kernel_version = run_command('uname', '-r').stdout().strip()
+ 	kernel_dir = '/lib/modules/' + kernel_version
++	if kernel_source_dir == ''
++		# use default path for native builds
++		kernel_source_dir = '/lib/modules/' + kernel_version + '/source'
++	endif
+ endif
@@ -89,2 +88 @@
-     # test running make in kernel directory, using "make kernelversion"
-     make_returncode = run_command('make', '-sC', kernel_build_dir,
+ # test running make in kernel directory, using "make kernelversion"


More information about the stable mailing list