From patchwork Wed Jun 21 17:00:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Marchand X-Patchwork-Id: 128895 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 5A56E42D16; Wed, 21 Jun 2023 19:01:29 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DEC7942C4D; Wed, 21 Jun 2023 19:01:25 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id E201542B7E for ; Wed, 21 Jun 2023 19:01:23 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1687366883; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Srvf6cEC2YBGBCsJxqOi7I+vT0wJ5AleJsTK1sUyzDU=; b=ZxpNotYVSbpTpQSQRkegm0xQIWxrZWmCEDX/4mlzLZo3kjwpYlwaxkd9pLM34mhKpq7SJq VKWxkR8at4yPIZF4MMKhGfB+pn0+0718Jo7Nd1RK585QlZMQmfVqA1xapkquf+XZqCXQcP 7NeZz1N02bLPlpmYKrUC52ILLDQULog= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-28-TZodYI-QOaSv4RCDIyRccA-1; Wed, 21 Jun 2023 13:01:18 -0400 X-MC-Unique: TZodYI-QOaSv4RCDIyRccA-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 5ED1310311E6; Wed, 21 Jun 2023 17:01:11 +0000 (UTC) Received: from dmarchan.redhat.com (unknown [10.45.224.210]) by smtp.corp.redhat.com (Postfix) with ESMTP id 064D914682F8; Wed, 21 Jun 2023 17:01:09 +0000 (UTC) From: David Marchand To: dev@dpdk.org Cc: thomas@monjalon.net, bluca@debian.org, tredaelli@redhat.com, i.maximets@ovn.org, james.r.harris@intel.com, mohammed@hawari.fr Subject: [PATCH v4 1/4] kni: move IOVA build check Date: Wed, 21 Jun 2023 19:00:55 +0200 Message-Id: <20230621170058.2740340-2-david.marchand@redhat.com> In-Reply-To: <20230621170058.2740340-1-david.marchand@redhat.com> References: <20211117112847.7362-6-david.marchand@redhat.com> <20230621170058.2740340-1-david.marchand@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org kni dependency to IOVA configuration does not need to be expressed in the top level lib/meson.build file. Signed-off-by: David Marchand Acked-by: Bruce Richardson --- lib/kni/meson.build | 5 +++++ lib/meson.build | 3 --- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/kni/meson.build b/lib/kni/meson.build index 8a71d8ba6f..5ce410f7f2 100644 --- a/lib/kni/meson.build +++ b/lib/kni/meson.build @@ -7,6 +7,11 @@ if is_windows subdir_done() endif +if dpdk_conf.get('RTE_IOVA_IN_MBUF') == 0 + build = false + reason = 'requires IOVA in mbuf (set enable_iova_as_pa option)' +endif + if not is_linux or not dpdk_conf.get('RTE_ARCH_64') build = false reason = 'only supported on 64-bit Linux' diff --git a/lib/meson.build b/lib/meson.build index 9677239236..f5c8a70a1d 100644 --- a/lib/meson.build +++ b/lib/meson.build @@ -95,9 +95,6 @@ dpdk_libs_deprecated += [ disabled_libs = [] opt_disabled_libs = run_command(list_dir_globs, get_option('disable_libs'), check: true).stdout().split() -if dpdk_conf.get('RTE_IOVA_IN_MBUF') == 0 - opt_disabled_libs += ['kni'] -endif foreach l:opt_disabled_libs if not optional_libs.contains(l) warning('Cannot disable mandatory library "@0@"'.format(l)) From patchwork Wed Jun 21 17:00:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Marchand X-Patchwork-Id: 128894 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id C783A42D16; Wed, 21 Jun 2023 19:01:23 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BA4E541151; Wed, 21 Jun 2023 19:01:23 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id 1E7C5410FD for ; Wed, 21 Jun 2023 19:01:22 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1687366881; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=4V84BtOLgiedfTig4+zUYUsMzYbXZp8iMRv/6VTQRH8=; b=d4qsU5P6h5KT69PG6LZBMRVhjwjlTVfHSAr0Bi47O2VPF2qO+Edc7ip0cbqPhVdQrZSafh oFOB5u6HKx7UJjhAMJFNwqBPHVVHjuwLSI4twEm50KptEfhcomozXLhNWpoS5PAwNmGPrZ vkTqdmos58AyyDjNWI/M4/2ua/C3Ppk= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-436-_rjWd5NGOnWmQ4jqOID0Ow-1; Wed, 21 Jun 2023 13:01:17 -0400 X-MC-Unique: _rjWd5NGOnWmQ4jqOID0Ow-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id EF03A3C1C4C4; Wed, 21 Jun 2023 17:01:14 +0000 (UTC) Received: from dmarchan.redhat.com (unknown [10.45.224.210]) by smtp.corp.redhat.com (Postfix) with ESMTP id 73E462017DE2; Wed, 21 Jun 2023 17:01:13 +0000 (UTC) From: David Marchand To: dev@dpdk.org Cc: thomas@monjalon.net, bluca@debian.org, tredaelli@redhat.com, i.maximets@ovn.org, james.r.harris@intel.com, mohammed@hawari.fr, Bruce Richardson Subject: [PATCH v4 2/4] build: rename enabled libraries list Date: Wed, 21 Jun 2023 19:00:56 +0200 Message-Id: <20230621170058.2740340-3-david.marchand@redhat.com> In-Reply-To: <20230621170058.2740340-1-david.marchand@redhat.com> References: <20211117112847.7362-6-david.marchand@redhat.com> <20230621170058.2740340-1-david.marchand@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org The enabled_libs variable is renamed and moved to the top level meson.build file, for sake of consistency wrt to drivers and applications similar variables. Signed-off-by: David Marchand Acked-by: Bruce Richardson --- app/test/meson.build | 2 +- buildtools/chkincs/meson.build | 2 +- lib/meson.build | 4 +--- meson.build | 3 ++- 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/app/test/meson.build b/app/test/meson.build index d0fabcbb8b..f3217ae577 100644 --- a/app/test/meson.build +++ b/app/test/meson.build @@ -152,7 +152,7 @@ test_sources = files( 'virtual_pmd.c', ) -test_deps = enabled_libs +test_deps = dpdk_libs_enabled # as well as libs, the pci and vdev bus drivers are needed for a lot of tests test_deps += ['bus_pci', 'bus_vdev'] diff --git a/buildtools/chkincs/meson.build b/buildtools/chkincs/meson.build index 378c2f19ef..f2dadcae18 100644 --- a/buildtools/chkincs/meson.build +++ b/buildtools/chkincs/meson.build @@ -22,7 +22,7 @@ sources += gen_c_files.process(dpdk_chkinc_headers) # so we always include them in deps list deps = [get_variable('shared_rte_bus_vdev'), get_variable('shared_rte_bus_pci')] # add the rest of the libs to the dependencies -foreach l:enabled_libs +foreach l:dpdk_libs_enabled deps += get_variable('shared_rte_' + l) endforeach diff --git a/lib/meson.build b/lib/meson.build index f5c8a70a1d..363a4fd79f 100644 --- a/lib/meson.build +++ b/lib/meson.build @@ -112,8 +112,6 @@ if cc.has_argument('-Wno-format-truncation') default_cflags += '-Wno-format-truncation' endif -enabled_libs = [] # used to print summary at the end - foreach l:libraries build = true reason = '' # set if build == false to explain why @@ -180,7 +178,7 @@ foreach l:libraries continue endif - enabled_libs += name + dpdk_libs_enabled += name dpdk_conf.set('RTE_LIB_' + name.to_upper(), 1) install_headers(headers) install_headers(indirect_headers) diff --git a/meson.build b/meson.build index 992ca91e88..39cb73846d 100644 --- a/meson.build +++ b/meson.build @@ -44,6 +44,7 @@ dpdk_extra_ldflags = [] dpdk_libs_deprecated = [] dpdk_apps_disabled = [] dpdk_libs_disabled = [] +dpdk_libs_enabled = [] dpdk_drvs_disabled = [] testpmd_drivers_sources = [] testpmd_drivers_deps = [] @@ -134,7 +135,7 @@ message(output_message + '\n') output_message = '\n=================\nLibraries Enabled\n=================\n' output_message += '\nlibs:\n\t' output_count = 0 -foreach lib:enabled_libs +foreach lib:dpdk_libs_enabled output_message += lib + ', ' output_count += 1 if output_count == 8 From patchwork Wed Jun 21 17:00:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Marchand X-Patchwork-Id: 128896 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 506C342D16; Wed, 21 Jun 2023 19:01:36 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id EBE5D42D12; Wed, 21 Jun 2023 19:01:27 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id 76A0042D10 for ; Wed, 21 Jun 2023 19:01:27 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1687366887; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=5cHBr7/ynbi8Vbabgmho3/X3+HyWHwbvgQgmzxb074E=; b=AzfNMxE5vQjZT3qHRT1WNNLu0ZETMf0UjXJw5GfJIGuh9pOPkgLoKoqyq9thUwJ1rgeN2d D0+2OtIiLzsZVJYynFtV+0e8e0q6eRbiKtc4gF90OO7x/q6fQ9Hm9bLo3W0tskX/44Xypn odUa80fh1SsQ2js3HqiKWKr+m+c0+TA= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-553-2ROesEk7MQyHt8Ai2fGDCA-1; Wed, 21 Jun 2023 13:01:23 -0400 X-MC-Unique: 2ROesEk7MQyHt8Ai2fGDCA-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id BD04D10311E5; Wed, 21 Jun 2023 17:01:18 +0000 (UTC) Received: from dmarchan.redhat.com (unknown [10.45.224.210]) by smtp.corp.redhat.com (Postfix) with ESMTP id E3D07492B01; Wed, 21 Jun 2023 17:01:16 +0000 (UTC) From: David Marchand To: dev@dpdk.org Cc: thomas@monjalon.net, bluca@debian.org, tredaelli@redhat.com, i.maximets@ovn.org, james.r.harris@intel.com, mohammed@hawari.fr, Aaron Conole , Michael Santana , Bruce Richardson Subject: [PATCH v4 3/4] build: select deprecated libraries Date: Wed, 21 Jun 2023 19:00:57 +0200 Message-Id: <20230621170058.2740340-4-david.marchand@redhat.com> In-Reply-To: <20230621170058.2740340-1-david.marchand@redhat.com> References: <20211117112847.7362-6-david.marchand@redhat.com> <20230621170058.2740340-1-david.marchand@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Rework deprecated libraries selection by introducing a new configuration option. This breaks existing configurations that were relying on disable_libs='' for enabling deprecated libraries. On the other hand, it will make enabling optional libraries more straightforward by taking the deprecated libraries out of the picture. Signed-off-by: David Marchand Acked-by: Bruce Richardson --- .ci/linux-build.sh | 2 +- devtools/test-meson-builds.sh | 8 ++++---- lib/meson.build | 9 +++++++-- meson_options.txt | 4 +++- 4 files changed, 15 insertions(+), 8 deletions(-) diff --git a/.ci/linux-build.sh b/.ci/linux-build.sh index 9631e342b5..da51f8e55e 100755 --- a/.ci/linux-build.sh +++ b/.ci/linux-build.sh @@ -97,7 +97,7 @@ if [ "$MINI" = "true" ]; then OPTS="$OPTS -Denable_drivers=net/null" OPTS="$OPTS -Ddisable_libs=*" else - OPTS="$OPTS -Ddisable_libs=" + OPTS="$OPTS -Denable_deprecated_libs=true" fi if [ "$ASAN" = "true" ]; then diff --git a/devtools/test-meson-builds.sh b/devtools/test-meson-builds.sh index 9131088c9d..efeddb36f3 100755 --- a/devtools/test-meson-builds.sh +++ b/devtools/test-meson-builds.sh @@ -120,10 +120,10 @@ config () # return fi options= - # deprecated libs may be disabled by default, so for complete builds ensure - # no libs are disabled - if ! echo $* | grep -q -- 'disable_libs' ; then - options="$options -Ddisable_libs=" + # deprecated libs are disabled by default, so for complete builds + # enable them + if ! echo $* | grep -q -- 'enable_deprecated_libs' ; then + options="$options -Denable_deprecated_libs=true" fi if echo $* | grep -qw -- '--default-library=shared' ; then options="$options -Dexamples=all" diff --git a/lib/meson.build b/lib/meson.build index 363a4fd79f..a6e9e19b42 100644 --- a/lib/meson.build +++ b/lib/meson.build @@ -136,13 +136,18 @@ foreach l:libraries deps += ['eal'] endif - if disabled_libs.contains(l) + if dpdk_libs_deprecated.contains(l) and not get_option('enable_deprecated_libs') + build = false + reason = 'deprecated libraries disabled via build config' + elif disabled_libs.contains(l) build = false reason = 'explicitly disabled via build config' if dpdk_libs_deprecated.contains(l) reason += ' (deprecated lib)' endif - else + endif + + if build if dpdk_libs_deprecated.contains(l) warning('Enabling deprecated library, "@0@"'.format(l)) endif diff --git a/meson_options.txt b/meson_options.txt index 82c8297065..f959015e46 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -10,7 +10,7 @@ option('disable_apps', type: 'string', value: '', description: 'Comma-separated list of apps to explicitly disable.') option('disable_drivers', type: 'string', value: '', description: 'Comma-separated list of drivers to explicitly disable.') -option('disable_libs', type: 'string', value: 'flow_classify,kni', description: +option('disable_libs', type: 'string', value: '', description: 'Comma-separated list of libraries to explicitly disable. [NOTE: not all libs can be disabled]') option('drivers_install_subdir', type: 'string', value: 'dpdk/pmds-', description: 'Subdirectory of libdir where to install PMDs. Defaults to using a versioned subdirectory.') @@ -18,6 +18,8 @@ option('enable_docs', type: 'boolean', value: false, description: 'build documentation') option('enable_apps', type: 'string', value: '', description: 'Comma-separated list of apps to build. If unspecified, build all apps.') +option('enable_deprecated_libs', type: 'boolean', value: false, description: + 'Add deprecated libraries to the list of optional libraries to build') option('enable_drivers', type: 'string', value: '', description: 'Comma-separated list of drivers to build. If unspecified, build all drivers.') option('enable_driver_sdk', type: 'boolean', value: false, description: From patchwork Wed Jun 21 17:00:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Marchand X-Patchwork-Id: 128897 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 691EC42D16; Wed, 21 Jun 2023 19:01:43 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2892042D20; Wed, 21 Jun 2023 19:01:30 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id 028A242D17 for ; Wed, 21 Jun 2023 19:01:28 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1687366888; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ECcuUp0eX0i37ZYWdTvx/gUJP84tFuyCnva1kptr3Rw=; b=NxUWJhT5wCW9rBkIyNT6p9pUy0inPM0b2N8S90jO1wTeoChAzHM4z401/qRJLz2dcEeZp2 JJUQrJhvALcI7820NoKIzPMyVPw0TSiZuN/napjXp3BupcUxWGnhNVBkbKKiDewBkLZLSi hw02DQAox6STnq8Bn0W4JmuP7GZ72wg= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-98-TYQHZJm5MEe9EDUQOw-8sQ-1; Wed, 21 Jun 2023 13:01:25 -0400 X-MC-Unique: TYQHZJm5MEe9EDUQOw-8sQ-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 65D428C5862; Wed, 21 Jun 2023 17:01:22 +0000 (UTC) Received: from dmarchan.redhat.com (unknown [10.45.224.210]) by smtp.corp.redhat.com (Postfix) with ESMTP id D51552166B32; Wed, 21 Jun 2023 17:01:20 +0000 (UTC) From: David Marchand To: dev@dpdk.org Cc: thomas@monjalon.net, bluca@debian.org, tredaelli@redhat.com, i.maximets@ovn.org, james.r.harris@intel.com, mohammed@hawari.fr, Bruce Richardson Subject: [PATCH v4 4/4] build: select optional libraries Date: Wed, 21 Jun 2023 19:00:58 +0200 Message-Id: <20230621170058.2740340-5-david.marchand@redhat.com> In-Reply-To: <20230621170058.2740340-1-david.marchand@redhat.com> References: <20211117112847.7362-6-david.marchand@redhat.com> <20230621170058.2740340-1-david.marchand@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org There is currently no way to know which libraries are optional. Introduce a enable_libs option (close to what we have for drivers) so that packagers or projects consuming DPDK can more easily select the optional libraries that matter to them and disable other optional libraries. Signed-off-by: David Marchand Acked-by: Bruce Richardson --- Changes since v3: - split non related cleanup changes, - fixed false positive complaints about disabling mandatory libs by building the list of always enabled libs, appending this list to enable_list and checking the disable side, - updated enable/disable_libs descriptions, Changes since v2: - moved the IOVA check for kni build in lib/kni/meson.build, - reworked deprecated libraries handling by only considering them when no enable_libs option is set. With this, no need for a default value in meson_options.txt, yet configurations in the CI must be adjusted, - moved mandatory libraries check after enable/disable_libs evaluation, --- lib/meson.build | 33 +++++++++++++++++++++++---------- meson_options.txt | 4 +++- 2 files changed, 26 insertions(+), 11 deletions(-) diff --git a/lib/meson.build b/lib/meson.build index a6e9e19b42..407769b270 100644 --- a/lib/meson.build +++ b/lib/meson.build @@ -92,17 +92,20 @@ dpdk_libs_deprecated += [ 'kni', ] -disabled_libs = [] -opt_disabled_libs = run_command(list_dir_globs, get_option('disable_libs'), - check: true).stdout().split() -foreach l:opt_disabled_libs +disable_libs = run_command(list_dir_globs, get_option('disable_libs'), check: true).stdout().split() + +enable_libs = run_command(list_dir_globs, get_option('enable_libs'), check: true).stdout().split() +if enable_libs.length() == 0 + enable_libs += optional_libs +endif + +always_enable = [] +foreach l:libraries if not optional_libs.contains(l) - warning('Cannot disable mandatory library "@0@"'.format(l)) - continue + always_enable += l endif - disabled_libs += l endforeach - +enable_libs += always_enable default_cflags = machine_args default_cflags += ['-DALLOW_EXPERIMENTAL_API'] @@ -139,12 +142,22 @@ foreach l:libraries if dpdk_libs_deprecated.contains(l) and not get_option('enable_deprecated_libs') build = false reason = 'deprecated libraries disabled via build config' - elif disabled_libs.contains(l) + elif not enable_libs.contains(l) build = false - reason = 'explicitly disabled via build config' + reason = 'not in enabled libraries build config' if dpdk_libs_deprecated.contains(l) reason += ' (deprecated lib)' endif + elif disable_libs.contains(l) + if always_enable.contains(l) + warning('Cannot disable mandatory library "@0@"'.format(l)) + else + build = false + reason = 'explicitly disabled via build config' + if dpdk_libs_deprecated.contains(l) + reason += ' (deprecated lib)' + endif + endif endif if build diff --git a/meson_options.txt b/meson_options.txt index f959015e46..9951563146 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -11,7 +11,7 @@ option('disable_apps', type: 'string', value: '', description: option('disable_drivers', type: 'string', value: '', description: 'Comma-separated list of drivers to explicitly disable.') option('disable_libs', type: 'string', value: '', description: - 'Comma-separated list of libraries to explicitly disable. [NOTE: not all libs can be disabled]') + 'Comma-separated list of optional libraries to explicitly disable. [NOTE: mandatory libs cannot be disabled]') option('drivers_install_subdir', type: 'string', value: 'dpdk/pmds-', description: 'Subdirectory of libdir where to install PMDs. Defaults to using a versioned subdirectory.') option('enable_docs', type: 'boolean', value: false, description: @@ -26,6 +26,8 @@ option('enable_driver_sdk', type: 'boolean', value: false, description: 'Install headers to build drivers.') option('enable_kmods', type: 'boolean', value: false, description: 'build kernel modules') +option('enable_libs', type: 'string', value: '', description: + 'Comma-separated list of optional libraries to explicitly enable. [NOTE: mandatory libs are always enabled]') option('examples', type: 'string', value: '', description: 'Comma-separated list of examples to build by default') option('ibverbs_link', type: 'combo', choices : ['static', 'shared', 'dlopen'], value: 'shared', description: