From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 41FF3A04B5; Mon, 2 Dec 2019 13:08:32 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 1159A1BF7C; Mon, 2 Dec 2019 13:08:31 +0100 (CET) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 5EADC91; Mon, 2 Dec 2019 13:08:29 +0100 (CET) X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 02 Dec 2019 04:08:28 -0800 X-IronPort-AV: E=Sophos;i="5.69,268,1571727600"; d="scan'208";a="204533768" Received: from bricha3-mobl.ger.corp.intel.com ([10.237.221.46]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 02 Dec 2019 04:08:22 -0800 Date: Mon, 2 Dec 2019 12:08:19 +0000 From: Bruce Richardson To: Ye Xiaolong Cc: Igor Ryzhov , Ferruh Yigit , dev , dpdk stable Message-ID: <20191202120819.GA25@bricha3-MOBL.ger.corp.intel.com> References: <20191202061442.56964-1-xiaolong.ye@intel.com> <20191202083903.GA78157@intel.com> <20191202113454.GB78157@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191202113454.GB78157@intel.com> User-Agent: Mutt/1.12.1 (2019-06-15) Subject: Re: [dpdk-dev] [PATCH] kernel/linux: fix kernel dir for meson X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 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" On Mon, Dec 02, 2019 at 07:34:54PM +0800, Ye Xiaolong wrote: > On 12/02, Igor Ryzhov wrote: > >We should at least install it into /lib/modules/kernel-version. For > >convenience, dpdk modules are installed into > >/lib/modules/kernel-version/extra/dpdk. > >In the cross-compilation case, you can use DEST_DIR to set some prefix. > > > >I don't really see the issue here. The description clearly says that > >headers must be in $kernel_dir/build which is usually a symlink > >to /usr/src/linux-headers-kernel-version. > >Just set kernel_dir correctly and there won't be compilation failure. > > I think for cross-compilation case, user should be allowed to specify any kernel > src dir (it doesn't have to be /lib/modules/kernel-version) in his local system > as kernel_dir that doesn't contain the build dir, in this case, current meson > build will skip kernel module compilation. > I don't think we can take this change as the default, since the previous fix was put in for good reason. However, perhaps we can attempt to support both, using the checks below for "make kernelversion" in kernel/linux/meson.build. We can attempt using the directory with /build (as now) and then if that fails attempt without it (or vice versa). /Bruce > > > > >Igor > > > >On Mon, Dec 2, 2019 at 11:43 AM Ye Xiaolong wrote: > > > >> Hi, Igor > >> > >> Thanks for the feedback. > >> > >> On 12/02, Igor Ryzhov wrote: > >> >Hi Xiaolong, > >> > > >> >Nack from me. It's just an incorrect revert of my fix. > >> >Kernel modules will be installed in wrong directory, just check > >> install_dir > >> > >> Is there any convention that we must install kernel modules to which > >> directory? > >> And what about for cross compilation case? > >> > >> Current issue is that if I specify kernel_dir as one local linux src dir > >> in meson_options.txt, > >> meson build would fail to compile kernel modules while setting > >> RTE_KERNELDIR='//build_dir/target-x86_64_glibc/linux-x86_64/linux-4.19.81/' > >> before make works fine. Is there any subtlety I have missed? > >> > >> Thanks, > >> Xiaolong > >> > >> >parameter in kni/meson.build and igb_uio/meson.build. > >> > > >> >Igor > >> > > >> >On Mon, Dec 2, 2019 at 9:18 AM Xiaolong Ye wrote: > >> > > >> >> kernel_dir option in meson build is equivalent to RTE_KERNELDIR in make > >> >> system, for cross-compilation case, users would specify it as local > >> >> kernel src dir like > >> >> > >> >> //target-arm_glibc/linux-arm/linux-4.19.81/ > >> >> > >> >> Current meson build would fail to compile kernel module if user specify > >> >> kernel_dir as above, this patch fixes this issue. > >> >> > >> >> Fixes: 317832f97c16 ("kernel/linux: fix modules install path") > >> >> Cc: stable@dpdk.org > >> >> Cc: iryzhov@nfware.com > >> >> > >> >> Signed-off-by: Xiaolong Ye > >> >> --- > >> >> kernel/linux/igb_uio/meson.build | 2 +- > >> >> kernel/linux/kni/meson.build | 2 +- > >> >> kernel/linux/meson.build | 4 ++-- > >> >> meson_options.txt | 2 +- > >> >> 4 files changed, 5 insertions(+), 5 deletions(-) > >> >> > >> >> diff --git a/kernel/linux/igb_uio/meson.build > >> >> b/kernel/linux/igb_uio/meson.build > >> >> index fac404f07..e66218dae 100644 > >> >> --- a/kernel/linux/igb_uio/meson.build > >> >> +++ b/kernel/linux/igb_uio/meson.build > >> >> @@ -8,7 +8,7 @@ mkfile = custom_target('igb_uio_makefile', > >> >> custom_target('igb_uio', > >> >> input: ['igb_uio.c', 'Kbuild'], > >> >> output: 'igb_uio.ko', > >> >> - command: ['make', '-C', kernel_dir + '/build', > >> >> + command: ['make', '-C', kernel_dir, > >> >> 'M=' + meson.current_build_dir(), > >> >> 'src=' + meson.current_source_dir(), > >> >> 'EXTRA_CFLAGS=-I' + meson.current_source_dir() + > >> >> diff --git a/kernel/linux/kni/meson.build b/kernel/linux/kni/meson.build > >> >> index 955eec949..9fce0c16e 100644 > >> >> --- a/kernel/linux/kni/meson.build > >> >> +++ b/kernel/linux/kni/meson.build > >> >> @@ -13,7 +13,7 @@ kni_sources = files( > >> >> custom_target('rte_kni', > >> >> input: kni_sources, > >> >> output: 'rte_kni.ko', > >> >> - command: ['make', '-j4', '-C', kernel_dir + '/build', > >> >> + command: ['make', '-j4', '-C', kernel_dir, > >> >> 'M=' + meson.current_build_dir(), > >> >> 'src=' + meson.current_source_dir(), > >> >> 'MODULE_CFLAGS=-include ' + meson.source_root() + > >> >> '/config/rte_config.h' + > >> >> diff --git a/kernel/linux/meson.build b/kernel/linux/meson.build > >> >> index 1796cc686..a37c95752 100644 > >> >> --- a/kernel/linux/meson.build > >> >> +++ b/kernel/linux/meson.build > >> >> @@ -13,11 +13,11 @@ kernel_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 > >> >> + kernel_dir = '/lib/modules/' + kernel_version + '/build' > >> >> endif > >> >> > >> >> # test running make in kernel directory, using "make kernelversion" > >> >> -make_returncode = run_command('make', '-sC', kernel_dir + '/build', > >> >> +make_returncode = run_command('make', '-sC', kernel_dir, > >> >> 'kernelversion').returncode() > >> >> if make_returncode != 0 > >> >> warning('Cannot compile kernel modules as requested - are kernel > >> >> headers installed?') > >> >> diff --git a/meson_options.txt b/meson_options.txt > >> >> index bc369d06c..7eba3b720 100644 > >> >> --- a/meson_options.txt > >> >> +++ b/meson_options.txt > >> >> @@ -17,7 +17,7 @@ option('ibverbs_link', type: 'combo', choices : > >> >> ['shared', 'dlopen'], value: 'sh > >> >> option('include_subdir_arch', type: 'string', value: '', > >> >> description: 'subdirectory where to install arch-dependent > >> >> headers') > >> >> option('kernel_dir', type: 'string', value: '', > >> >> - description: 'Path to the kernel for building kernel modules. > >> >> Headers must be in $kernel_dir/build. Modules will be installed in > >> >> $DEST_DIR/$kernel_dir/extra/dpdk.') > >> >> + description: 'Path to the kernel for building kernel modules. > >> >> Modules will be installed in $DEST_DIR/$kernel_dir/extra/dpdk.') > >> >> option('lib_musdk_dir', type: 'string', value: '', > >> >> description: 'path to the MUSDK library installation directory') > >> >> option('machine', type: 'string', value: 'native', > >> >> -- > >> >> 2.17.1 > >> >> > >> >> > >>