From patchwork Sun Oct 30 08:27:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Monjalon X-Patchwork-Id: 119289 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 0AF0AA00C2; Sun, 30 Oct 2022 09:27:42 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9C89E40693; Sun, 30 Oct 2022 09:27:41 +0100 (CET) Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) by mails.dpdk.org (Postfix) with ESMTP id A563040151 for ; Sun, 30 Oct 2022 09:27:40 +0100 (CET) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 2F6455C00D9; Sun, 30 Oct 2022 04:27:40 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Sun, 30 Oct 2022 04:27:40 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= cc:cc:content-transfer-encoding:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm3; t=1667118460; x=1667204860; bh=iO jBVy09AB4lrZrcl6OqG1VJrmzleaO7CK94uUM6h20=; b=vTZGQa1pHeOgKs1SSU C/un3+F341n09DlRp+8w0UhAo0vKsBOgSGEeBghjh1JIqjLmrNHonFLPoC4LMMnO zvdqIA/3SBzLnGejFZHZSqj27e4ir8bA0n3iBtgrXmns3nF50xC9K+3ttmrrfaTx qfc64LnWr124xIEkQPpHO0nTY0nvmlvpxB7EwZoonhLrvNzwlAVj2iNZbRWTCywa R/dHAI+RMQgwWWtMw/BMhYhphGhGs7sB9uz4P7EPToMzwbSTy6ZKCZwJeLjo7daw vxi3HTnMI6tpoifyuEhq68Gv4iRBonARF/R9H1CqoKfqgmmtJGK/k8BosKHP94pk 58Hw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; t=1667118460; x=1667204860; bh=iOjBVy09AB4lr Zrcl6OqG1VJrmzleaO7CK94uUM6h20=; b=U3Csuk5B7QPwsR2/v93URcRr9BuA+ oBXUi6SreDMaN7gru7G1mLhIhiPVOLtKPJFDjPK6uFShG3TySKlFAbb+CUjSK15r TWAxfqeATga/xiOJcWyc4GDUK5eXW8fMfl68Lk+ePSKrAklX4qus9j78mgFMeQty UwaZlyjbV2EmLBXwLYOvTH6kJ+TJblkoiaLiOZPrZjUzrgslbevnJw1n1qK2sufE eR/Vg1BlZZULFeOsTxKJeQTcAk55rd/1BtmfTz9G7/b9MjhMriGAOfTM/WKbDqsM 9+OmFwV8MHK5Aylk8RieIaUaLSP3ceK8gC6sMLEdO7t/9Ph8qb7Ckb1oQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvgedrtdelgddufeegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvvefufffkofgjfhgggfestdekredtredttdenucfhrhhomhepvfhhohhm rghsucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenuc ggtffrrghtthgvrhhnpedvjefhudeghedvtdeijeeigeetuedugfejueekieeltdfhteev keehhfeilefhtdenucevlhhushhtvghrufhiiigvpedunecurfgrrhgrmhepmhgrihhlfh hrohhmpehthhhomhgrshesmhhonhhjrghlohhnrdhnvght X-ME-Proxy: Feedback-ID: i47234305:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 30 Oct 2022 04:27:38 -0400 (EDT) From: Thomas Monjalon To: dev@dpdk.org Cc: valex@nvidia.com, ferruh.yigit@amd.com, andrew.rybchenko@oktetlabs.ru, rasland@nvidia.com, david.marchand@redhat.com, Matan Azrad , Fan Zhang , Ashish Gupta , Viacheslav Ovsiienko , Ori Kam Subject: [PATCH v2 1/2] common/mlx5: fix build disabling Date: Sun, 30 Oct 2022 09:27:21 +0100 Message-Id: <20221030082722.1333530-2-thomas@monjalon.net> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20221030082722.1333530-1-thomas@monjalon.net> References: <20221030082722.1333530-1-thomas@monjalon.net> MIME-Version: 1.0 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 If the dependency common/mlx5 is explicitly disabled, but net/mlx5 is not explicitly disabled, Meson will read the full recipe of net/mlx5 and will fail when accessing a variable from common/mlx5: drivers/net/mlx5/meson.build:76:4: ERROR: Unknown variable "mlx5_config". The solution is to stop parsing net/mlx5 if common/mlx5 is disabled. The deps array must be defined before stopping, in order to automatically disable the build of net/mlx5 and print the reason. The same protection is applied to other mlx5 drivers, so it will allow using the variable mlx5_config in future. Fixes: 22681deead3e ("net/mlx5/hws: enable hardware steering") Reported-by: Andrew Rybchenko Signed-off-by: Thomas Monjalon Tested-by: Andrew Rybchenko Acked-by: Matan Azrad --- drivers/compress/mlx5/meson.build | 5 +++++ drivers/crypto/mlx5/meson.build | 5 +++++ drivers/net/mlx5/meson.build | 5 +++++ drivers/regex/mlx5/meson.build | 5 +++++ drivers/vdpa/mlx5/meson.build | 5 +++++ 5 files changed, 25 insertions(+) diff --git a/drivers/compress/mlx5/meson.build b/drivers/compress/mlx5/meson.build index 7aac329986..49ce3aff46 100644 --- a/drivers/compress/mlx5/meson.build +++ b/drivers/compress/mlx5/meson.build @@ -9,6 +9,11 @@ endif fmt_name = 'mlx5_compress' deps += ['common_mlx5', 'eal', 'compressdev'] +if not ('mlx5' in common_drivers) + # avoid referencing undefined variables from common/mlx5 + subdir_done() +endif + sources = files( 'mlx5_compress.c', ) diff --git a/drivers/crypto/mlx5/meson.build b/drivers/crypto/mlx5/meson.build index 9d9c9c00bc..7521c4c671 100644 --- a/drivers/crypto/mlx5/meson.build +++ b/drivers/crypto/mlx5/meson.build @@ -9,6 +9,11 @@ endif fmt_name = 'mlx5_crypto' deps += ['common_mlx5', 'eal', 'cryptodev'] +if not ('mlx5' in common_drivers) + # avoid referencing undefined variables from common/mlx5 + subdir_done() +endif + sources = files( 'mlx5_crypto.c', 'mlx5_crypto_dek.c', diff --git a/drivers/net/mlx5/meson.build b/drivers/net/mlx5/meson.build index ff84448186..fa15158039 100644 --- a/drivers/net/mlx5/meson.build +++ b/drivers/net/mlx5/meson.build @@ -9,6 +9,11 @@ if not (is_linux or is_windows) endif deps += ['hash', 'common_mlx5'] +if not ('mlx5' in common_drivers) + # avoid referencing undefined variables from common/mlx5 + subdir_done() +endif + headers = files('rte_pmd_mlx5.h') sources = files( 'mlx5.c', diff --git a/drivers/regex/mlx5/meson.build b/drivers/regex/mlx5/meson.build index e553dcb83d..70edc5b6da 100644 --- a/drivers/regex/mlx5/meson.build +++ b/drivers/regex/mlx5/meson.build @@ -8,6 +8,11 @@ if not is_linux endif deps += ['common_mlx5', 'eal', 'regexdev'] +if not ('mlx5' in common_drivers) + # avoid referencing undefined variables from common/mlx5 + subdir_done() +endif + sources = files( 'mlx5_regex.c', 'mlx5_rxp.c', diff --git a/drivers/vdpa/mlx5/meson.build b/drivers/vdpa/mlx5/meson.build index 9d8dbb1a82..54a4eac6f4 100644 --- a/drivers/vdpa/mlx5/meson.build +++ b/drivers/vdpa/mlx5/meson.build @@ -8,6 +8,11 @@ if not is_linux endif deps += ['hash', 'common_mlx5', 'vhost', 'pci', 'eal', 'sched'] +if not ('mlx5' in common_drivers) + # avoid referencing undefined variables from common/mlx5 + subdir_done() +endif + sources = files( 'mlx5_vdpa.c', 'mlx5_vdpa_mem.c', From patchwork Sun Oct 30 08:27:22 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Monjalon X-Patchwork-Id: 119291 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 A4980A00C2; Sun, 30 Oct 2022 09:27:54 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5916440A7F; Sun, 30 Oct 2022 09:27:46 +0100 (CET) Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) by mails.dpdk.org (Postfix) with ESMTP id 7616E410D1 for ; Sun, 30 Oct 2022 09:27:43 +0100 (CET) Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 32C2E5C00C3; Sun, 30 Oct 2022 04:27:43 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Sun, 30 Oct 2022 04:27:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= cc:cc:content-transfer-encoding:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm3; t=1667118463; x=1667204863; bh=eu xx7cVwfiEQK1NfzCzy8eNwku8cHyUPoZpzdgypBwE=; b=pwRuU7sfXvHXn2WC3K XtWD6vBWwAe9PGNquFDDwaqFNQifNyirEdd5fN/hPBGqspfwLOoSR9GDYJNFp82r tp2qZEIjZBkbvzdBIoZ70EqvJ6nZOqaYSXQwE8m5P8PB1P6ku0WGzFrqqWq61gFG TMufasgNjOaZOLeQfkJbKtHLvs5izccrsNWTtNRS+VU6M7/PweRiTWlKeigIbRzm x2sxGG58FLmOz7bYn7bmFQ41KMbalV9z9+lbV7M9dPywqEM3LAHyVvpGh5Gvu4CP S8jcHyhGEp/tWirXUN6W625A8oNU1XacakB+kB1H+e3mKcsXlEQKxf282H+SJkoG lL8Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; t=1667118463; x=1667204863; bh=euxx7cVwfiEQK 1NfzCzy8eNwku8cHyUPoZpzdgypBwE=; b=UZ1OcmH39TX46/VoPpUBoqYabJ6Nr /kybZUTc4kreHIc2GFLMv85J7psPmLwkbL3vmVluphRyWmXjjTI7VfcT68WwwVh4 9waDM1C+KyCFjKi5o2o4E2d29OFlV4UkYtoiwSlTGvqSy2sUav0U+kEsLsJZrU9c NJOmvf78aY4+x2ux7q/tHuYSqSwnsg0z+/+oyjtQCQbBElC1ZXhYYFqjByOfIYHY jjFjpJqPBx6K1vfqOMdQifGmSjKnPrxEGvvRh/lXaDTISUvVae9TCkuqiz8hFWJ5 dROBfnJwXouKBHd927oATDbL6cPlvwJS7TmdIpEGSibbpYKfl9ItsnY1g== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvgedrtdelgddufeefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvvefufffkofgjfhgggfestdekredtredttdenucfhrhhomhepvfhhohhm rghsucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenuc ggtffrrghtthgvrhhnpedvjefhudeghedvtdeijeeigeetuedugfejueekieeltdfhteev keehhfeilefhtdenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfh hrohhmpehthhhomhgrshesmhhonhhjrghlohhnrdhnvght X-ME-Proxy: Feedback-ID: i47234305:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 30 Oct 2022 04:27:41 -0400 (EDT) From: Thomas Monjalon To: dev@dpdk.org Cc: valex@nvidia.com, ferruh.yigit@amd.com, andrew.rybchenko@oktetlabs.ru, rasland@nvidia.com, david.marchand@redhat.com, Matan Azrad , Viacheslav Ovsiienko Subject: [PATCH v2 2/2] common/mlx5: move Meson config initialization and check Date: Sun, 30 Oct 2022 09:27:22 +0100 Message-Id: <20221030082722.1333530-3-thomas@monjalon.net> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20221030082722.1333530-1-thomas@monjalon.net> References: <20221030082722.1333530-1-thomas@monjalon.net> MIME-Version: 1.0 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 variable mlx5_config may be used by other mlx5 drivers and should be always initialized. By moving its initialization (with configuration file generation), it is made consistent for Linux and Windows builds. And the check of mlx5_config in net/mlx5 is moved at the top of net/mlx5/hws/meson.build so HWS requirements are in the right context. Signed-off-by: Thomas Monjalon Tested-by: Andrew Rybchenko Acked-by: Matan Azrad --- drivers/common/mlx5/linux/meson.build | 2 -- drivers/common/mlx5/meson.build | 2 ++ drivers/common/mlx5/windows/meson.build | 4 ---- drivers/net/mlx5/hws/meson.build | 4 ++++ drivers/net/mlx5/meson.build | 4 +--- 5 files changed, 7 insertions(+), 9 deletions(-) diff --git a/drivers/common/mlx5/linux/meson.build b/drivers/common/mlx5/linux/meson.build index 84e2a1ad8c..2b57b299bd 100644 --- a/drivers/common/mlx5/linux/meson.build +++ b/drivers/common/mlx5/linux/meson.build @@ -8,7 +8,6 @@ dlopen_ibverbs = (get_option('ibverbs_link') == 'dlopen') LIB_GLUE_BASE = 'librte_common_mlx5_glue.so' LIB_GLUE_VERSION = abi_version LIB_GLUE = LIB_GLUE_BASE + '.' + LIB_GLUE_VERSION -mlx5_config = configuration_data() if dlopen_ibverbs dpdk_conf.set('RTE_IBVERBS_LINK_DLOPEN', 1) cflags += [ @@ -232,7 +231,6 @@ foreach arg:has_member_args file_prefix = '#include <' + arg[1] + '>' mlx5_config.set(arg[0], cc.has_member(arg[2], arg[3], prefix : file_prefix, dependencies: libs)) endforeach -configure_file(output : 'mlx5_autoconf.h', configuration : mlx5_config) # Build Glue Library if dlopen_ibverbs diff --git a/drivers/common/mlx5/meson.build b/drivers/common/mlx5/meson.build index 6ddbde7e8f..d7ca21d2cf 100644 --- a/drivers/common/mlx5/meson.build +++ b/drivers/common/mlx5/meson.build @@ -37,4 +37,6 @@ else cflags += [ '-UPEDANTIC' ] endif +mlx5_config = configuration_data() subdir(exec_env) +configure_file(output : 'mlx5_autoconf.h', configuration : mlx5_config) diff --git a/drivers/common/mlx5/windows/meson.build b/drivers/common/mlx5/windows/meson.build index edbbaa9ae1..cc486014a8 100644 --- a/drivers/common/mlx5/windows/meson.build +++ b/drivers/common/mlx5/windows/meson.build @@ -39,7 +39,3 @@ if get_option('buildtype').contains('debug') else cflags += [ '-UPEDANTIC' ] endif - -# Generate an empty mlx5_autoconf.h file for compatibility with Linux -config = configuration_data() -configure_file(output : 'mlx5_autoconf.h', configuration : config) diff --git a/drivers/net/mlx5/hws/meson.build b/drivers/net/mlx5/hws/meson.build index d2bb864fd2..38776d5163 100644 --- a/drivers/net/mlx5/hws/meson.build +++ b/drivers/net/mlx5/hws/meson.build @@ -1,6 +1,10 @@ # SPDX-License-Identifier: BSD-3-Clause # Copyright (c) 2022 NVIDIA Corporation & Affiliates +if not (is_linux and mlx5_config.get('HAVE_IBV_FLOW_DV_SUPPORT', false)) + subdir_done() +endif + includes += include_directories('.') sources += files( 'mlx5dr_context.c', diff --git a/drivers/net/mlx5/meson.build b/drivers/net/mlx5/meson.build index fa15158039..f1aab18f82 100644 --- a/drivers/net/mlx5/meson.build +++ b/drivers/net/mlx5/meson.build @@ -78,6 +78,4 @@ testpmd_sources += files('mlx5_testpmd.c') subdir(exec_env) -if (is_linux and mlx5_config.get('HAVE_IBV_FLOW_DV_SUPPORT', false)) - subdir('hws') -endif +subdir('hws')