From patchwork Mon Jul 31 14:48:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: David Marchand X-Patchwork-Id: 129749 X-Patchwork-Delegate: david.marchand@redhat.com 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 299EC42FA5; Mon, 31 Jul 2023 16:48:38 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A9F9743251; Mon, 31 Jul 2023 16:48:37 +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 EDF5443245 for ; Mon, 31 Jul 2023 16:48:35 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1690814915; 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=f1piFmUH+vf6WgkHxRCFXjXzm+J2lISCXqOexUsbkDA=; b=aanf9fjPhZoE/i03cj6LXVj6Q1CJXk2Q+5NzoOdKfAREguSUBRs5dhwIEi4HI3Eee1oots z346i6cRNZQiSK3/wgPJr0CpGihKav3yFUEUA7H/7wuqMNOUMLAhFLqo7ctohLdIroweHc kOi39U04iNBS8xCuCX/qoV04eHDe4gs= Received: from mimecast-mx02.redhat.com (66.187.233.73 [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-449-FcRj2SvuMCqlHPH6KpdmtA-1; Mon, 31 Jul 2023 10:48:31 -0400 X-MC-Unique: FcRj2SvuMCqlHPH6KpdmtA-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 61F5F1C0E0CC; Mon, 31 Jul 2023 14:48:30 +0000 (UTC) Received: from dmarchan.redhat.com (unknown [10.45.224.120]) by smtp.corp.redhat.com (Postfix) with ESMTP id 156E31121325; Mon, 31 Jul 2023 14:48:27 +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, =?utf-8?q?Morten_Br=C3=B8rup?= , Bruce Richardson , Aaron Conole , Michael Santana Subject: [PATCH v7 1/2] build: select deprecated libraries Date: Mon, 31 Jul 2023 16:48:16 +0200 Message-ID: <20230731144817.2147634-2-david.marchand@redhat.com> In-Reply-To: <20230731144817.2147634-1-david.marchand@redhat.com> References: <20230629090459.823130-1-david.marchand@redhat.com> <20230731144817.2147634-1-david.marchand@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 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: Morten Brørup Acked-by: Bruce Richardson Acked-by: Aaron Conole --- Changes since v5: - rebased, - updated doc (kni, flow classify docs), - updated deprecation notices and RN, Changes since v4: - changed the option to a list of libraries instead of a global on/off knob, - moved all deprecated libs checks under a single block for readability, --- .ci/linux-build.sh | 2 +- devtools/test-meson-builds.sh | 8 +++--- doc/guides/prog_guide/flow_classify_lib.rst | 5 ++-- .../prog_guide/kernel_nic_interface.rst | 3 +- doc/guides/rel_notes/deprecation.rst | 4 --- doc/guides/rel_notes/release_23_11.rst | 3 ++ lib/meson.build | 28 +++++++++++++------ meson_options.txt | 4 ++- 8 files changed, 36 insertions(+), 21 deletions(-) diff --git a/.ci/linux-build.sh b/.ci/linux-build.sh index 45f2729996..e0b62bac90 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=*" fi OPTS="$OPTS -Dlibdir=lib" diff --git a/devtools/test-meson-builds.sh b/devtools/test-meson-builds.sh index 84b907d2ea..c41659d28b 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=*" fi if echo $* | grep -qw -- '--default-library=shared' ; then options="$options -Dexamples=all" diff --git a/doc/guides/prog_guide/flow_classify_lib.rst b/doc/guides/prog_guide/flow_classify_lib.rst index ad2e10ec26..558a982e3b 100644 --- a/doc/guides/prog_guide/flow_classify_lib.rst +++ b/doc/guides/prog_guide/flow_classify_lib.rst @@ -10,8 +10,9 @@ Flow Classification Library See :doc:`../rel_notes/deprecation`. It is disabled by default in the DPDK build. - To re-enable the library, remove 'flow_classify' from the "disable_libs" - meson option when configuring a build. + To re-enable the library, tell meson to enable 'flow_classify' as part of + the deprecated libraries meson option + ``-Denable_deprecated_libs=flow_classify``. DPDK provides a Flow Classification library that provides the ability to classify an input packet by matching it against a set of Flow rules. diff --git a/doc/guides/prog_guide/kernel_nic_interface.rst b/doc/guides/prog_guide/kernel_nic_interface.rst index 392e5df75f..1097ecc695 100644 --- a/doc/guides/prog_guide/kernel_nic_interface.rst +++ b/doc/guides/prog_guide/kernel_nic_interface.rst @@ -18,7 +18,8 @@ Kernel NIC Interface .. note:: KNI is disabled by default in the DPDK build. - To re-enable the library, remove 'kni' from the "disable_libs" meson option when configuring a build. + To re-enable the library, tell meson to enable 'kni' as part of the + deprecated libraries meson option ``-Denable_deprecated_libs=kni``. The DPDK Kernel NIC Interface (KNI) allows userspace applications access to the Linux* control plane. diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst index 494b401cda..10ba03a71c 100644 --- a/doc/guides/rel_notes/deprecation.rst +++ b/doc/guides/rel_notes/deprecation.rst @@ -35,10 +35,6 @@ Deprecation Notices which also added support for standard atomics (Ref: https://releases.llvm.org/3.6.0/tools/clang/docs/ReleaseNotes.html) -* build: Enabling deprecated libraries (``flow_classify``, ``kni``) - won't be possible anymore through the use of the ``disable_libs`` build option. - A new build option for deprecated libraries will be introduced instead. - * kvargs: The function ``rte_kvargs_process`` will get a new parameter for returning key match count. It will ease handling of no-match case. diff --git a/doc/guides/rel_notes/release_23_11.rst b/doc/guides/rel_notes/release_23_11.rst index 6b4dd21fd0..781b338101 100644 --- a/doc/guides/rel_notes/release_23_11.rst +++ b/doc/guides/rel_notes/release_23_11.rst @@ -55,6 +55,9 @@ New Features Also, make sure to start the actual text at the margin. ======================================================= +* build: Enabling deprecated libraries (``flow_classify``, ``kni``) is now done + using the new ``enable_deprecated_libraries`` build option. + Removed Items ------------- diff --git a/lib/meson.build b/lib/meson.build index fac2f52cad..73afd90b38 100644 --- a/lib/meson.build +++ b/lib/meson.build @@ -93,6 +93,15 @@ dpdk_libs_deprecated += [ 'kni', ] +enable_deprecated_libs = [] +foreach l:run_command(list_dir_globs, get_option('enable_deprecated_libs'), + check: true).stdout().split() + if not dpdk_libs_deprecated.contains(l) + continue + endif + enable_deprecated_libs += l +endforeach + disabled_libs = [] opt_disabled_libs = run_command(list_dir_globs, get_option('disable_libs'), check: true).stdout().split() @@ -137,16 +146,19 @@ foreach l:libraries deps += ['eal'] endif - if disabled_libs.contains(l) - build = false - reason = 'explicitly disabled via build config' - if dpdk_libs_deprecated.contains(l) - reason += ' (deprecated lib)' - endif - else - if dpdk_libs_deprecated.contains(l) + if dpdk_libs_deprecated.contains(l) + if not enable_deprecated_libs.contains(l) + build = false + reason = 'not in enabled deprecated libraries build config' + else warning('Enabling deprecated library, "@0@"'.format(l)) endif + elif disabled_libs.contains(l) + build = false + reason = 'explicitly disabled via build config' + endif + + if build subdir(l) endif if name != l diff --git a/meson_options.txt b/meson_options.txt index 82c8297065..839d4266c6 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: 'string', value: '', description: + 'Comma-separated list of deprecated libraries to explicitly enable.') 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 Mon Jul 31 14:48:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: David Marchand X-Patchwork-Id: 129750 X-Patchwork-Delegate: david.marchand@redhat.com 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 2C72E42FA5; Mon, 31 Jul 2023 16:48:45 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C1F0B43257; Mon, 31 Jul 2023 16:48:41 +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 CBD8B43245 for ; Mon, 31 Jul 2023 16:48:39 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1690814919; 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=YmYUQq+MUrdicuXnM2mVIEdoVX/h5fSfhK1IEgD6BrY=; b=E0ivcICE6oVUA11m874kdjHTYmI9Q92yzyQOa9fnDnEz+sRzCf8QKF8ipBb9aELZ+aivVo vDhZNe0qMTIeWASoFH2E+jnTQXjbjsfqAKL9Py9M3YKqtS+2FEThSeH7lSl6KCif/fGwou z17v26ppQreUBuyj/mJ9shN+oirLDCQ= Received: from mimecast-mx02.redhat.com (66.187.233.73 [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-534-a89pSXr2PGC23hhwoysHKQ-1; Mon, 31 Jul 2023 10:48:35 -0400 X-MC-Unique: a89pSXr2PGC23hhwoysHKQ-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 21BE02A59559; Mon, 31 Jul 2023 14:48:34 +0000 (UTC) Received: from dmarchan.redhat.com (unknown [10.45.224.120]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7857540D2839; Mon, 31 Jul 2023 14:48:32 +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, =?utf-8?q?Morten_Br=C3=B8rup?= , Bruce Richardson Subject: [PATCH v7 2/2] build: select optional libraries Date: Mon, 31 Jul 2023 16:48:17 +0200 Message-ID: <20230731144817.2147634-3-david.marchand@redhat.com> In-Reply-To: <20230731144817.2147634-1-david.marchand@redhat.com> References: <20230629090459.823130-1-david.marchand@redhat.com> <20230731144817.2147634-1-david.marchand@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 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: Morten Brørup Acked-by: Bruce Richardson --- Changes since v5: - added an entry in the release notes, Changes since v4: - moved always_enable earlier for readability, 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, --- doc/guides/rel_notes/release_23_11.rst | 3 +++ lib/meson.build | 34 +++++++++++++++++--------- meson_options.txt | 4 ++- 3 files changed, 28 insertions(+), 13 deletions(-) diff --git a/doc/guides/rel_notes/release_23_11.rst b/doc/guides/rel_notes/release_23_11.rst index 781b338101..c073612b82 100644 --- a/doc/guides/rel_notes/release_23_11.rst +++ b/doc/guides/rel_notes/release_23_11.rst @@ -58,6 +58,9 @@ New Features * build: Enabling deprecated libraries (``flow_classify``, ``kni``) is now done using the new ``enable_deprecated_libraries`` build option. +* build: Optional libraries can now be selected with the new ``enable_libs`` + build option similarly to the existing ``enable_drivers`` build option. + Removed Items ------------- diff --git a/lib/meson.build b/lib/meson.build index 73afd90b38..b8834fc277 100644 --- a/lib/meson.build +++ b/lib/meson.build @@ -88,6 +88,13 @@ optional_libs = [ 'vhost', ] +always_enable = [] +foreach l:libraries + if not optional_libs.contains(l) + always_enable += l + endif +endforeach + dpdk_libs_deprecated += [ 'flow_classify', 'kni', @@ -102,17 +109,13 @@ foreach l:run_command(list_dir_globs, get_option('enable_deprecated_libs'), enable_deprecated_libs += l endforeach -disabled_libs = [] -opt_disabled_libs = run_command(list_dir_globs, get_option('disable_libs'), - check: true).stdout().split() -foreach l:opt_disabled_libs - if not optional_libs.contains(l) - warning('Cannot disable mandatory library "@0@"'.format(l)) - continue - endif - disabled_libs += l -endforeach +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 +enable_libs += always_enable default_cflags = machine_args default_cflags += ['-DALLOW_EXPERIMENTAL_API'] @@ -153,9 +156,16 @@ foreach l:libraries else warning('Enabling deprecated library, "@0@"'.format(l)) endif - 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' + 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' + endif endif if build diff --git a/meson_options.txt b/meson_options.txt index 839d4266c6..7312da3640 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: