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..c683fc7b36 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 +# 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 3a00ea954c..0637452e95 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,