patches for DPDK stable branches
 help / color / mirror / Atom feed
* [20.11] kni: fix build for SLES15-SP3
@ 2021-12-08 10:34 Ferruh Yigit
  2021-12-08 10:37 ` Ferruh Yigit
  0 siblings, 1 reply; 4+ messages in thread
From: Ferruh Yigit @ 2021-12-08 10:34 UTC (permalink / raw)
  To: stable; +Cc: Aman Singh, Longfeng Liang, yux.jiang

From: Aman Singh <aman.deep.singh@intel.com>

[ 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
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>
---
Cc: yux.jiang@intel.com

@Yu, can you please test the patch on SLES15-SP3, I am sending the
backport without testing it on SUSE.
---
 kernel/linux/kni/compat.h    |  3 ++-
 kernel/linux/kni/meson.build | 14 +++++++++++++-
 kernel/linux/meson.build     |  6 ++++++
 3 files changed, 21 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 07e0c9dae727..0eedbd6cb10e 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@'])
@@ -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/include' +
 		' -I' + meson.source_root() + '/lib/librte_kni' +
 		' -I' + meson.build_root() +
diff --git a/kernel/linux/meson.build b/kernel/linux/meson.build
index 5c864a465344..76eb279d9e59 100644
--- a/kernel/linux/meson.build
+++ b/kernel/linux/meson.build
@@ -15,6 +15,12 @@ if kernel_dir == ''
 	kernel_dir = '/lib/modules/' + kernel_version
 endif
 
+kernel_source_dir = get_option('kernel_dir')
+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_dir + '/build',
 		'kernelversion').returncode()
-- 
2.33.1


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

* Re: [20.11] kni: fix build for SLES15-SP3
  2021-12-08 10:34 [20.11] kni: fix build for SLES15-SP3 Ferruh Yigit
@ 2021-12-08 10:37 ` Ferruh Yigit
  2021-12-08 10:58   ` Xueming(Steven) Li
  0 siblings, 1 reply; 4+ messages in thread
From: Ferruh Yigit @ 2021-12-08 10:37 UTC (permalink / raw)
  To: Xueming(Steven) Li; +Cc: Aman Singh, Longfeng Liang, yux.jiang, stable

On 12/8/2021 10:34 AM, Ferruh Yigit wrote:
> From: Aman Singh <aman.deep.singh@intel.com>
> 
> [ 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
> 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>
> ---
> Cc: yux.jiang@intel.com
> 
> @Yu, can you please test the patch on SLES15-SP3, I am sending the
> backport without testing it on SUSE.

Hi Xueming(Steven),

Can you please consider this build fix for -rc2 when Yu verifies it?

> ---
>   kernel/linux/kni/compat.h    |  3 ++-
>   kernel/linux/kni/meson.build | 14 +++++++++++++-
>   kernel/linux/meson.build     |  6 ++++++
>   3 files changed, 21 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 07e0c9dae727..0eedbd6cb10e 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@'])
> @@ -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/include' +
>   		' -I' + meson.source_root() + '/lib/librte_kni' +
>   		' -I' + meson.build_root() +
> diff --git a/kernel/linux/meson.build b/kernel/linux/meson.build
> index 5c864a465344..76eb279d9e59 100644
> --- a/kernel/linux/meson.build
> +++ b/kernel/linux/meson.build
> @@ -15,6 +15,12 @@ if kernel_dir == ''
>   	kernel_dir = '/lib/modules/' + kernel_version
>   endif
>   
> +kernel_source_dir = get_option('kernel_dir')
> +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_dir + '/build',
>   		'kernelversion').returncode()
> 


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

* Re: [20.11] kni: fix build for SLES15-SP3
  2021-12-08 10:37 ` Ferruh Yigit
@ 2021-12-08 10:58   ` Xueming(Steven) Li
  2021-12-09  3:26     ` Jiang, YuX
  0 siblings, 1 reply; 4+ messages in thread
From: Xueming(Steven) Li @ 2021-12-08 10:58 UTC (permalink / raw)
  To: ferruh.yigit; +Cc: stable, longfengx.liang, yux.jiang, aman.deep.singh

On Wed, 2021-12-08 at 10:37 +0000, Ferruh Yigit wrote:
> On 12/8/2021 10:34 AM, Ferruh Yigit wrote:
> > From: Aman Singh <aman.deep.singh@intel.com>
> > 
> > [ 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
> > 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>
> > ---
> > Cc: yux.jiang@intel.com
> > 
> > @Yu, can you please test the patch on SLES15-SP3, I am sending the
> > backport without testing it on SUSE.
> 
> Hi Xueming(Steven),
> 
> Can you please consider this build fix for -rc2 when Yu verifies it?

NP, noted.

> 
> > ---
> >   kernel/linux/kni/compat.h    |  3 ++-
> >   kernel/linux/kni/meson.build | 14 +++++++++++++-
> >   kernel/linux/meson.build     |  6 ++++++
> >   3 files changed, 21 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 07e0c9dae727..0eedbd6cb10e 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://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fjira.devtools.intel.com%2Fbrowse%2FDPDK-29263&amp;data=04%7C01%7Cxuemingl%40nvidia.com%7Cf5ed2c9e400d45daf90d08d9ba36b62d%7C43083d15727340c1b7db39efd9ccc17a%7C0%7C0%7C637745566410423776%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&amp;sdata=LjUAgmSO3WjpNttSqdMGI5MgOXPcrbklWTshk%2B%2BEV7k%3D&amp;reserved=0
> > +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/include' +
> >   		' -I' + meson.source_root() + '/lib/librte_kni' +
> >   		' -I' + meson.build_root() +
> > diff --git a/kernel/linux/meson.build b/kernel/linux/meson.build
> > index 5c864a465344..76eb279d9e59 100644
> > --- a/kernel/linux/meson.build
> > +++ b/kernel/linux/meson.build
> > @@ -15,6 +15,12 @@ if kernel_dir == ''
> >   	kernel_dir = '/lib/modules/' + kernel_version
> >   endif
> >   
> > +kernel_source_dir = get_option('kernel_dir')
> > +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_dir + '/build',
> >   		'kernelversion').returncode()
> > 
> 


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

* RE: [20.11] kni: fix build for SLES15-SP3
  2021-12-08 10:58   ` Xueming(Steven) Li
@ 2021-12-09  3:26     ` Jiang, YuX
  0 siblings, 0 replies; 4+ messages in thread
From: Jiang, YuX @ 2021-12-09  3:26 UTC (permalink / raw)
  To: Xueming(Steven) Li, Yigit, Ferruh
  Cc: stable, Liang, LongfengX, Singh, Aman Deep

> -----Original Message-----
> From: Xueming(Steven) Li <xuemingl@nvidia.com>
> Sent: Wednesday, December 8, 2021 6:59 PM
> To: Yigit, Ferruh <ferruh.yigit@intel.com>
> Cc: stable@dpdk.org; Liang, LongfengX <longfengx.liang@intel.com>; Jiang,
> YuX <yux.jiang@intel.com>; Singh, Aman Deep
> <aman.deep.singh@intel.com>
> Subject: Re: [20.11] kni: fix build for SLES15-SP3
> 
> On Wed, 2021-12-08 at 10:37 +0000, Ferruh Yigit wrote:
> > On 12/8/2021 10:34 AM, Ferruh Yigit wrote:
> > > From: Aman Singh <aman.deep.singh@intel.com>
> > >
> > > [ 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
> > > 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>
> > > ---
> > > Cc: yux.jiang@intel.com
> > >
> > > @Yu, can you please test the patch on SLES15-SP3, I am sending the
> > > backport without testing it on SUSE.
> >
> > Hi Xueming(Steven),
> >
> > Can you please consider this build fix for -rc2 when Yu verifies it?
> 
> NP, noted.
> 
Tested-by: Longfeng Liang <longfengx.liang@intel.com>

Verify the patch passed on OpenSuse15.3 with gcc7.5.0&clang11.0.1
DPDK: DPDK20.11.4-rc1


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

end of thread, other threads:[~2021-12-09  3:26 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-08 10:34 [20.11] kni: fix build for SLES15-SP3 Ferruh Yigit
2021-12-08 10:37 ` Ferruh Yigit
2021-12-08 10:58   ` Xueming(Steven) Li
2021-12-09  3:26     ` Jiang, YuX

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).