From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ferruh Yigit Subject: Re: [PATCH] mk: fix kernel modules build dependency Date: Thu, 29 Mar 2018 19:28:35 +0100 Message-ID: <16136f8e-332f-3b96-21ce-ad05a94c1a54@intel.com> References: <20180329153931.26351-1-thomas@monjalon.net> <2419180.MvykWTCLKm@xps> <0a59c197-0331-a122-f997-b8a77b39e01b@intel.com> <1680117.05lWP9jXLg@xps> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Cc: "dev@dpdk.org" To: Hemant Agrawal , Thomas Monjalon Return-path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 2FE882BD8 for ; Thu, 29 Mar 2018 20:28:40 +0200 (CEST) In-Reply-To: Content-Language: en-US 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 3/29/2018 7:12 PM, Hemant Agrawal wrote: >> -----Original Message----- >> From: Thomas Monjalon [mailto:thomas@monjalon.net] >> Sent: Thursday, March 29, 2018 10:31 PM >> To: Ferruh Yigit >> Cc: Hemant Agrawal ; dev@dpdk.org >> Subject: Re: [dpdk-dev] [PATCH] mk: fix kernel modules build dependency >> Importance: High >> >> 29/03/2018 18:50, Ferruh Yigit: >>> On 3/29/2018 5:43 PM, Thomas Monjalon wrote: >>>> 29/03/2018 18:38, Ferruh Yigit: >>>>> On 3/29/2018 5:32 PM, Thomas Monjalon wrote: >>>>>> 29/03/2018 17:48, Ferruh Yigit: >>>>>>> On 3/29/2018 4:39 PM, Thomas Monjalon wrote: >>>>>>>> Some kernel modules may need some header files to be "installed" >>>>>>>> in the build directory. >>>>>>>> >>>>>>>> When running multiple threads of make, kernel modules can try to >>>>>>>> be compiled before the lib headers are ready: >>>>>>>> make -j3 >>>>>>>> kernel/linux/kni/kni_misc.c:19:37: fatal error: >>>>>>>> exec-env/rte_kni_common.h: No such file or directory >>>>>>> >>>>>>> Is there a reason to keep header in eal when module itself moved into >> kernel? >>>>>> >>>>>> It seems you missed my comment below: >>>>>> >>>>>> On a related note, this header file >>>>>> >>>>>> lib/librte_eal/linuxapp/eal/include/exec-env/rte_kni_common.h >>>>>> could be moved to lib/librte_kni/ >>>>>> Opinion? >>>>> >>>>> Ahh, yes we are saying same thing. >>>>> But not sure if it should go under lib/librte_kni/ or kernel/linux/kni/? >>>>> I lean to kernel/linux/kni/. >>>> >>>> Why in kernel/? >>>> >>>> Logically, kernel/ depends on lib/ but not the reverse. >>>> >>>> And regarding the licensing, we avoid BSD files in Linux modules. >>> >>> From functionality point of view, module provides the functionality >>> and it should provide the header, this can be all subjective tough :) >>> >>> Or in other words, if you have the kernel module, you can write >>> another piece of userspace application (without using librte_kni) and it will be >> functional. >>> But if you have the librte_kni only, it won't be functional on its own. >>> >>> Providing header with kernel enables other userspace app to user KNI. >> >> So you are saying we should reverse the dependency? >> It would mean moving all headers used by kernel modules in kernel/ directory: >> - rte_pci_dev_features.h >> \- rte_pci_dev_feature_defs.h >> - rte_kni_common.h >> \- rte_common.h >> >> Are you sure? >> > I agree that ideologically the kernel modules shall be self sufficient. > However, given the dpdk structure, my original intention was to have userspace self sufficient. The kernel modules may depend on userspace. Overall agree to make userspace self sufficient, it makes builds more stable. Specific to librte_kni, it is kind wrapper to kni module, so functionally it is OK to make librte_kni dependent to kni module, but not sure from build point of view. > > However, no strong opinion either way. >