From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from dpdk.org (dpdk.org [92.243.14.124])
	by dpdk.space (Postfix) with ESMTP id D2173A045E
	for <public@inbox.dpdk.org>; Thu, 30 May 2019 13:46:16 +0200 (CEST)
Received: from [92.243.14.124] (localhost [127.0.0.1])
	by dpdk.org (Postfix) with ESMTP id D6F8E1B05;
	Thu, 30 May 2019 13:46:15 +0200 (CEST)
Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com
 [210.118.77.12]) by dpdk.org (Postfix) with ESMTP id 6BEE8A3
 for <dev@dpdk.org>; Thu, 30 May 2019 13:46:14 +0200 (CEST)
Received: from eucas1p1.samsung.com (unknown [182.198.249.206])
 by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id
 20190530114613euoutp02669b7c2276f4475bf3a68605a76040c6~jc2Tvuod32520025200euoutp02H
 for <dev@dpdk.org>; Thu, 30 May 2019 11:46:13 +0000 (GMT)
DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com
 20190530114613euoutp02669b7c2276f4475bf3a68605a76040c6~jc2Tvuod32520025200euoutp02H
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com;
 s=mail20170921; t=1559216773;
 bh=GvQ+NZP8SWCP96eCiN504NtxhwST7mMFpQg//+C9mLs=;
 h=Subject:To:Cc:From:Date:In-Reply-To:References:From;
 b=tSq6fs3CcN8UGQnevxu5N3a9YZk2BbCYrKlt/8KAmKyfmaTQvDAHy4H0UWjwF8Jf9
 xCwU9PjNF5YyPoG57IL9EfUtPvnQbRoZahXSdkKNq/L8sAjvE+jJE+NzTstlGrCZvU
 UHTrghXQn2gYkdZ6W7iqsu3ZYUydokPJwLp6I5eo=
Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by
 eucas1p2.samsung.com (KnoxPortal) with ESMTP id
 20190530114612eucas1p2ba26b10afc2ca0ca5db0f68c51df9dc3~jc2TNWXPt0693706937eucas1p2I;
 Thu, 30 May 2019 11:46:12 +0000 (GMT)
Received: from eucas1p1.samsung.com ( [182.198.249.206]) by
 eusmges3new.samsung.com (EUCPMTA) with SMTP id A1.99.04325.482CFEC5; Thu, 30
 May 2019 12:46:12 +0100 (BST)
Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by
 eucas1p1.samsung.com (KnoxPortal) with ESMTPA id
 20190530114612eucas1p186014a45aa255fa77eee51b02eb82412~jc2SfqFn00289102891eucas1p1I;
 Thu, 30 May 2019 11:46:12 +0000 (GMT)
Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by
 eusmtrp1.samsung.com (KnoxPortal) with ESMTP id
 20190530114611eusmtrp1075f3f0bd3090c6be00dcda4b3e918fd~jc2SQGxuT2032920329eusmtrp1L;
 Thu, 30 May 2019 11:46:11 +0000 (GMT)
X-AuditID: cbfec7f5-b8fff700000010e5-33-5cefc2844834
Received: from eusmtip2.samsung.com ( [203.254.199.222]) by
 eusmgms1.samsung.com (EUCPMTA) with SMTP id C2.04.04146.382CFEC5; Thu, 30
 May 2019 12:46:11 +0100 (BST)
Received: from [106.109.129.180] (unknown [106.109.129.180]) by
 eusmtip2.samsung.com (KnoxPortal) with ESMTPA id
 20190530114611eusmtip21d5ce144a99cdb1ba289b86d90e76e56~jc2RwmCcv3037830378eusmtip24;
 Thu, 30 May 2019 11:46:11 +0000 (GMT)
To: Bruce Richardson <bruce.richardson@intel.com>, Luca Boccassi
 <bluca@debian.org>
Cc: dev@dpdk.org, Thomas Monjalon <thomas@monjalon.net>, Aaron Conole
 <aconole@redhat.com>, Kevin Traynor <ktraynor@redhat.com>
From: Ilya Maximets <i.maximets@samsung.com>
Message-ID: <95099b74-d74d-e10c-3491-a59a9663ba66@samsung.com>
Date: Thu, 30 May 2019 14:46:10 +0300
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101
 Thunderbird/60.7.0
MIME-Version: 1.0
In-Reply-To: <20190530102229.GC1107@bricha3-M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X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrEIsWRmVeSWpSXmKPExsVy+t/xe7rNh97HGBw/pmnx680Ddos5TevY
 LW6ssrd492k7k8WV9p/sFmsPfWC3+PTgBIsDu8evtrnMHr8WLGX1WLznJZPHsZvT2D3e77vK
 5tG3ZRVjAFuUnk1RfmlJqkJGfnGJrVK0oYWRnqGlhZ6RiaWeobF5rJWRqZK+nU1Kak5mWWqR
 vl2CXsbMRw/ZCjq1Kk6ducHUwPhbvouRk0NCwESi88c2RhBbSGApo8SXS4UQcSmJH78usELY
 whJ/rnWxdTFyAdW8Z5Q4NvcRM0hCWMBJ4uGkb2C2iECoxNHFx1lAbGaBRkaJxvMsEA07mSTa
 dj5hAkmwCehInFp9BGwbr4CdxOXmJWDNLAKqEu8bb4LZogIRErN3NbBA1AhKnJz5BMzmFHCR
 uHDuLhvEAnWJP/MuMUPY4hJNX1ayQtjyEtvfzmGewCg0C0n7LCQts5C0zELSsoCRZRWjSGpp
 cW56brGhXnFibnFpXrpecn7uJkZg/G079nPzDsZLG4MPMQpwMCrx8AocfB8jxJpYVlyZe4hR
 goNZSYT35/J3MUK8KYmVValF+fFFpTmpxYcYTYGem8gsJZqcD0wNeSXxhqaG5haWhubG5sZm
 FkrivB0CB2OEBNITS1KzU1MLUotg+pg4OKUaGF1e3hX8LfHsf2HWgjRPPuH7N06wTW8QsJ8z
 4YLv/fweTS175hMzr/Fe2Bkkfl6UMb+UpzPVTlvqnPW7tW8nLb8f0fF9zccevlD3ewGn7V/o
 +z/Z0p/03+HPHJ+AmqkqIT+mP+YVs5YXKw04d2L16qXTgyQ1/DMM9I7PcoqT5WFWc1x2Q8i2
 SYmlOCPRUIu5qDgRACEdu5PVAgAA
X-CMS-MailID: 20190530114612eucas1p186014a45aa255fa77eee51b02eb82412
X-Msg-Generator: CA
Content-Type: text/plain; charset="utf-8"
X-RootMTR: 20190529164009eucas1p289f1dcf87012ecf049efc8eee2c2ea9d
X-EPHeader: CA
CMS-TYPE: 201P
X-CMS-RootMailID: 20190529164009eucas1p289f1dcf87012ecf049efc8eee2c2ea9d
References: <20190529163958.30796-1-i.maximets@samsung.com>
 <CGME20190529164009eucas1p289f1dcf87012ecf049efc8eee2c2ea9d@eucas1p2.samsung.com>
 <20190529163958.30796-3-i.maximets@samsung.com>
 <1a07d1cd59d84dce84e56c10fdabf5e5504560a6.camel@debian.org>
 <20190530102229.GC1107@bricha3-MOBL.ger.corp.intel.com>
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 <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org
Sender: "dev" <dev-bounces@dpdk.org>

On 30.05.2019 13:22, Bruce Richardson wrote:
> 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.

Thanks Bruce.
I see your point.

Please, take a look at the first patch of this series. It doesn't directly
connected to this one, but should speed up meson configuration a bit.

Best regards, Ilya Maximets.