From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id A7CB0A0C55; Wed, 13 Oct 2021 16:43:28 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2BF00410EB; Wed, 13 Oct 2021 16:43:28 +0200 (CEST) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by mails.dpdk.org (Postfix) with ESMTP id 7F4CB40E64; Wed, 13 Oct 2021 16:43:26 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10135"; a="313641589" X-IronPort-AV: E=Sophos;i="5.85,371,1624345200"; d="scan'208";a="313641589" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Oct 2021 07:43:24 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,371,1624345200"; d="scan'208";a="480830714" Received: from npg-npf-wlpr-srv02.iind.intel.com ([10.190.213.104]) by orsmga007.jf.intel.com with ESMTP; 13 Oct 2021 07:43:22 -0700 From: Aman Singh To: dev@dpdk.org Cc: ferruh.yigit@intel.com, stable@dpdk.org Date: Wed, 13 Oct 2021 20:03:02 +0530 Message-Id: <20211013143302.7019-1-aman.deep.singh@intel.com> X-Mailer: git-send-email 2.17.1 Subject: [dpdk-dev] [PATCH] kni: resolve build issue for OpenSuse15.3 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 --- 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 +# 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