From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 006BBA045E for ; Thu, 30 May 2019 12:22:35 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 8A7E61B99A; Thu, 30 May 2019 12:22:35 +0200 (CEST) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by dpdk.org (Postfix) with ESMTP id A5A411B955 for ; Thu, 30 May 2019 12:22:33 +0200 (CEST) X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 30 May 2019 03:22:32 -0700 X-ExtLoop1: 1 Received: from bricha3-mobl.ger.corp.intel.com ([10.237.221.64]) by fmsmga006.fm.intel.com with SMTP; 30 May 2019 03:22:30 -0700 Received: by (sSMTP sendmail emulation); Thu, 30 May 2019 11:22:29 +0100 Date: Thu, 30 May 2019 11:22:29 +0100 From: Bruce Richardson To: Luca Boccassi Cc: Ilya Maximets , dev@dpdk.org, Thomas Monjalon , Aaron Conole , Kevin Traynor Message-ID: <20190530102229.GC1107@bricha3-MOBL.ger.corp.intel.com> References: <20190529163958.30796-1-i.maximets@samsung.com> <20190529163958.30796-3-i.maximets@samsung.com> <1a07d1cd59d84dce84e56c10fdabf5e5504560a6.camel@debian.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1a07d1cd59d84dce84e56c10fdabf5e5504560a6.camel@debian.org> User-Agent: Mutt/1.11.4 (2019-03-13) Subject: Re: [dpdk-dev] [PATCH 2/2] meson: make build configurable 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 Wed, May 29, 2019 at 09:37:20PM +0100, Luca Boccassi wrote: > On Wed, 2019-05-29 at 19:39 +0300, Ilya Maximets wrote: > > The first thing many developers do before start building DPDK is > > disabling all the not needed divers and libraries. This happens > > just because more than a half of DPDK dirvers and libraries are not > > needed for the particular reason. For example, you don't need > > dpaa*, octeon*, various croypto devices, eventdev, etc. if you're > > only want to build OVS for x86_64 with static linking. > > > > By disabling everything you don't need, build speeds up literally 10x > > times. This is important for CI systems. For example, TravisCI wastes > > 10 minutes for the default DPDK build just to check linking with OVS. > > > > Another thing is the binary size. Number of DPDK libraries and, > > as a result, size of resulted statically linked application decreases > > significantly. > > > > Important thing also that you're able to not install some > > dependencies > > if you don't have them on a target platform. Just disable > > libs/drivers > > that depends on it. Similar thing for the glibc version mismatch > > between build and target platforms. > > > > Also, I have to note that less code means less probability of > > failures and less number of attack vectors. > > > > This patch gives 'meson' the power of configurability that we > > have with 'make'. Using new options it's possible to enable just > > what you need and nothing more. > > > > For example, following cmdline could be used to build almost minimal > > set of DPDK libs and drivers to check OVS build: > > > > $ meson build -Dexamples='' -Dtests=false -Denable_kmods=false \ > > -Ddrivers_bus=pci,vdev \ > > -Ddrivers_mempool=ring \ > > -Ddrivers_net=null,virtio,ring \ > > -Ddrivers_crypto=virtio \ > > -Ddrivers_compress=none \ > > -Ddrivers_event=none \ > > -Ddrivers_baseband=none \ > > -Ddrivers_raw=none \ > > -Ddrivers_common=none \ > > > > -Dlibs=kvargs,eal,cmdline,ring,mempool,mbuf,net,meter,\ > > ethdev,pci,hash,cryptodev,pdump,vhost \ > > -Dapps=none > > > > Adding a few real net drivers will give configuration that can be > > used > > in production environment. > > > > Looks not very pretty, but this could be moved to a script. > > > > Build details: > > > > Build targets in project: 57 > > > > $ time ninja > > real 0m11,528s > > user 1m4,137s > > sys 0m4,935s > > > > $ du -sh ../dpdk_meson_install/ > > 3,5M ../dpdk_meson_install/ > > > > To compare with what we have without these options: > > > > $ meson build -Dexamples='' -Dtests=false -Denable_kmods=false > > Build targets in project: 434 > > > > $ time ninja > > real 1m38,963s > > user 10m18,624s > > sys 0m45,478s > > > > $ du -sh ../dpdk_meson_install/ > > 27M ../dpdk_meson_install/ > > > > 10x speed up for the user time. > > 7.7 times size decrease. > > > > This is probably not much user-friendly because it's not a Kconfig > > and dependency tracking in meson is really poor, so it requires > > usually few iterations to pick correct set of libraries to satisfy > > all dependencies. However, it's not a big deal. Options intended > > for a proficient users who knows what they need. > > Hi, > > We talked about this a few times in the past, and it was actually one > of the design goals to _avoid_ replicating the octopus-like config > system of the makefiles. That's because it makes the test matrix > insanely complicated, not to mention the harm to user friendliness, > among other things. > > If someone doesn't want to use a PMD, they can just avoid installing it > - it's simple enough. > > Sorry, but from me it's a very strong NACK. > I would agree with this position - tracking the dependencies of the libraries etc. is a nightmare, and requires lots of ifdef'ery in the code for handling cases where libraries don't exist. However, I might be ok with limiting the drivers somewhat, since they don't tend to depend on each other so much, though ideally I'd still prefer to have one build of DPDK that has minimal configuration. If we say that we can disable some drivers, though, issue then becomes whether e.g. the bus drivers could selectively be disabled, and the knock-on effects of that. I'd hate to see the case where we end up having the meson.build files for drivers becoming a massive list of conditional checks for a bunch of internal dependencies. If someone is wanting to do a custom build of DPDK, they can always patch out the subdirectories they don't want in the meson.build files - but because of testing matrixes for such configurations, I don't think its something we want to explicitly support. /Bruce