From patchwork Thu Jan 5 16:10:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Monjalon X-Patchwork-Id: 121627 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 66121A00C2; Thu, 5 Jan 2023 17:10:42 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5855A42D38; Thu, 5 Jan 2023 17:10:42 +0100 (CET) Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) by mails.dpdk.org (Postfix) with ESMTP id 102364021E; Thu, 5 Jan 2023 17:10:41 +0100 (CET) Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 9BABA5C0172; Thu, 5 Jan 2023 11:10:40 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Thu, 05 Jan 2023 11:10:40 -0500 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=fm2; t=1672935040; x=1673021440; bh=QN 6Am80DuS29IzYzy2Jw8Xre3qiy6dVzwF1PQLBRuMk=; b=Iljrt5M31XgkzWQVVC pd39mXxYWlZg0Upb7uPIDAnuUZxGV9E0byyfQOz6HnJjOvefU9Dxyc86/jyYRupP IQWpmXd8PUqqnOAlDU5KdAIu7CiQsf3fksUb1GMigT9o1Dqu6pJ/rBphdubKG9PK XWuZNK9uYHhOrUu7U+e71h+uxf7tZ24PglfsilE/hL1LovDzn0E/InY52tfc1NZs 8y4JoTEKi7TqcBJ/HrnlUvDM0+ZSVADbzJh60XLcR/mtvY21cZri4eHT41ZC41tn n1wQ2INYBxp08O2QOs8iJ+hdrpgHWWhVLvA+AUTiiaM6LiX6MdNz/DpASBEhUTVr PDog== 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=fm2; t=1672935040; x=1673021440; bh=QN6Am80DuS29I zYzy2Jw8Xre3qiy6dVzwF1PQLBRuMk=; b=mFGN41il9ELZhTNhSBRPdVnmP8rLa oatW+BvUlqenmUqBcasyTO3DXSY6Z+2OVTsUmo7r9uH6XsTK21zQgZe/U4DeXnqa My/wU2muHEWiVoihn5LhhAGRNbHco99gtsQWFQ7CQRDou2VZTmksseTcc8fDn7hD bI6eZ+QOgk/QetBuAoGuACom3cqlr0ihzyYxpzsESxJhio/+gmYdbFNS1lOKhs/m kNvGTjEWHL/atNBYu6s2EiBM18iUCJJIOE/5GEvT1PjS5KPxU+/qcbJECuSkdvU0 B/9og5yAKC2Gfpq9rbv+DAxOCL6ikqZBwsyRh6V6I1kjXypf+niQnLb7w== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrjeekgdekjecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvfevufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefvhhhomhgr shcuofhonhhjrghlohhnuceothhhohhmrghssehmohhnjhgrlhhonhdrnhgvtheqnecugg ftrfgrthhtvghrnhepvdejhfdugeehvddtieejieegteeuudfgjeeukeeiledthfetveek hefhieelhfdtnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrh homhepthhhohhmrghssehmohhnjhgrlhhonhdrnhgvth X-ME-Proxy: Feedback-ID: i47234305:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 5 Jan 2023 11:10:38 -0500 (EST) From: Thomas Monjalon To: dev@dpdk.org Cc: Tal Shnaiderman , stable@dpdk.org, Dmitry Kozlyuk , Narcisa Ana Maria Vasile , Dmitry Malloy , Pallavi Kadam , Narcisa Vasile <"navasile@linux.microsoft.comnavasile"@microsoft.com>, Bruce Richardson , Keith Wiles Subject: [PATCH 1/3] eal/windows: fix pedantic build Date: Thu, 5 Jan 2023 17:10:18 +0100 Message-Id: <20230105161020.247780-2-thomas@monjalon.net> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230105161020.247780-1-thomas@monjalon.net> References: <20230105161020.247780-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 MinGW GCC 12 shows an illegal pointer conversion when included in a pedantic module: lib/eal/windows/include/pthread.h:137:41: error: ISO C forbids conversion of object pointer to function pointer type [-Werror=pedantic] 137 | hThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)threadfunc, | ^ Fixes: e8428a9d89f1 ("eal/windows: add some basic functions and macros") Cc: stable@dpdk.org By using uintptr_t, the compiler is forced to accept the conversion. Signed-off-by: Thomas Monjalon Acked-by: Tyler Retzlaff --- lib/eal/windows/include/pthread.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/eal/windows/include/pthread.h b/lib/eal/windows/include/pthread.h index 27fd2cca52..f7cf0e9ddf 100644 --- a/lib/eal/windows/include/pthread.h +++ b/lib/eal/windows/include/pthread.h @@ -134,7 +134,8 @@ pthread_create(void *threadid, const void *threadattr, void *threadfunc, { RTE_SET_USED(threadattr); HANDLE hThread; - hThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)threadfunc, + hThread = CreateThread(NULL, 0, + (LPTHREAD_START_ROUTINE)(uintptr_t)threadfunc, args, 0, (LPDWORD)threadid); if (hThread) { SetPriorityClass(GetCurrentProcess(), NORMAL_PRIORITY_CLASS); From patchwork Thu Jan 5 16:10:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Monjalon X-Patchwork-Id: 121628 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 110FCA00C2; Thu, 5 Jan 2023 17:10:48 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 74C1F42D3E; Thu, 5 Jan 2023 17:10:44 +0100 (CET) Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) by mails.dpdk.org (Postfix) with ESMTP id 374F542D3C for ; Thu, 5 Jan 2023 17:10:43 +0100 (CET) Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id AF5C55C019B; Thu, 5 Jan 2023 11:10:42 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Thu, 05 Jan 2023 11:10:42 -0500 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=fm2; t=1672935042; x=1673021442; bh=ib 7O1LGwUD2a+Fc+GF+TMgShESWR+pgoLmv/rJeBiQM=; b=UkwEel9IKeWKpLnrnw gMHR3yshX3JW6dWmp0EdI4rsN84jVZ3SnkLFFumGW9un6WSGd6DbZtrJfs92Dz1Z ZfrrZwjgH3l6KHO/DhqC5zh9Ea/LK1cPhKe+JjdCMU0vT7/kNC+QvK1A1wH4qB9y 2FgXri5i2b+xU4y2KcTGIf6PaFqfnwM1JMb89/lo508q39l+J4nlAM5oqPdo5JaC CFd8RCv136U1UCzNRa6dIIZCKiniqMuHQF6Y2DNxT510pohC731+q+DmnprfWg4P mQhuhqKwTf+Yxq8VmeBkQU7u/bjmW9M/uTtz/K/IkrQQVCN7LR/iBB4TVidjmIcg fiYg== 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=fm2; t=1672935042; x=1673021442; bh=ib7O1LGwUD2a+ Fc+GF+TMgShESWR+pgoLmv/rJeBiQM=; b=ilfWKhLR2YFsEyZdHspa54uMDs1Ro NHSnbZhn7SnKDbdG9xFmZV0Fbl+mkschPxLgO1KoDwbi+Vmq2MoFO74awCBuJhl2 NJBJ5C9wiCYXP46OZ/SuQGdqcQe7jDRWC2bJJxejdshzf4DMocLzKkQNbqVa8GsQ WuJPURALMeg3OmxpG11se4wHkGDRxJSM8k/mzcm4YbyfoVf/ny1NTzd41QNf3eEe yKoOHzECJW0P+2Yqa4GXyCkEthnhIh7Xfp48jWmdILX5SCoS1NwMiQfpDCuARV9X /NbhWaZ7tfBZlga3KpkzStXyRroM9BhOXwyCHzMKPykfpP/ZFcPfWdnkA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrjeekgdekjecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvfevufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefvhhhomhgr shcuofhonhhjrghlohhnuceothhhohhmrghssehmohhnjhgrlhhonhdrnhgvtheqnecugg ftrfgrthhtvghrnhepvdejhfdugeehvddtieejieegteeuudfgjeeukeeiledthfetveek hefhieelhfdtnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrh homhepthhhohhmrghssehmohhnjhgrlhhonhdrnhgvth X-ME-Proxy: Feedback-ID: i47234305:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 5 Jan 2023 11:10:41 -0500 (EST) From: Thomas Monjalon To: dev@dpdk.org Cc: Tal Shnaiderman , Matan Azrad , Viacheslav Ovsiienko Subject: [PATCH 2/3] common/mlx5: get Windows dependency from standard variables Date: Thu, 5 Jan 2023 17:10:19 +0100 Message-Id: <20230105161020.247780-3-thomas@monjalon.net> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230105161020.247780-1-thomas@monjalon.net> References: <20230105161020.247780-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 It was requested to provide path to DevX library through DEVX_INC_PATH and DEVX_LIB_PATH. It was non-standard and triggers some issues with recent Meson. Using CFLAGS/LDFLAGS is standard and simpler. It is also possible to use the Meson options -Dc_args and -Dc_link_args. There are 2 options to provide: -I -L Signed-off-by: Thomas Monjalon --- doc/guides/platform/mlx5.rst | 12 ++++++----- drivers/common/mlx5/windows/meson.build | 28 ++++++++++++------------- 2 files changed, 21 insertions(+), 19 deletions(-) diff --git a/doc/guides/platform/mlx5.rst b/doc/guides/platform/mlx5.rst index 5784b9a87b..33eb8627b5 100644 --- a/doc/guides/platform/mlx5.rst +++ b/doc/guides/platform/mlx5.rst @@ -259,13 +259,15 @@ configured by the ``ibverbs_link`` build option: Compilation on Windows ~~~~~~~~~~~~~~~~~~~~~~ -The DevX SDK location must be set through two environment variables: +The DevX SDK location must be set through CFLAGS/LDFLAGS, +either:: -``DEVX_LIB_PATH`` - path to the DevX lib file. + meson -Dc_args=-Idevx/inc -Dc_link_args=-Ldevx/lib -``DEVX_INC_PATH`` - path to the DevX header files. +or:: + + export CFLAGS=-Idevx/inc + export LDFLAGS=-Ldevx/lib .. _mlx5_common_env: diff --git a/drivers/common/mlx5/windows/meson.build b/drivers/common/mlx5/windows/meson.build index cc486014a8..f60daed840 100644 --- a/drivers/common/mlx5/windows/meson.build +++ b/drivers/common/mlx5/windows/meson.build @@ -1,6 +1,20 @@ # SPDX-License-Identifier: BSD-3-Clause # Copyright 2019 Mellanox Technologies, Ltd +if not cc.has_header('mlx5devx.h') + build = false + reason = 'missing dependency, "mlx5devx.h"' + subdir_done() +endif + +devxlib = cc.find_library('mlx5devx', required: true) +if not devxlib.found() + build = false + reason = 'missing dependency, "mlx5devx"' + subdir_done() +endif +ext_deps += devxlib + includes += include_directories('.') sources += files( @@ -8,20 +22,6 @@ sources += files( 'mlx5_common_os.c', ) -res_lib = run_command(python3, '-c', 'import os; print(os.environ["DEVX_LIB_PATH"])', check: false) -res_inc = run_command(python3, '-c', 'import os; print(os.environ["DEVX_INC_PATH"])', check: false) - -if (res_lib.returncode() != 0 or res_inc.returncode() != 0) - build = false - reason = 'DevX environment variables are not set, DEVX_LIB_PATH and DEVX_INC_PATH vars must be exported' - subdir_done() -endif - -devx_lib_dir = res_lib.stdout().strip() -devx_inc_dir = res_inc.stdout().strip() - -ext_deps += cc.find_library('mlx5devx', dirs: devx_lib_dir, required: true) -includes += include_directories(devx_inc_dir) cflags_options = [ '-std=c11', '-Wno-strict-prototypes', From patchwork Thu Jan 5 16:10:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Monjalon X-Patchwork-Id: 121629 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 D5DFAA00C2; Thu, 5 Jan 2023 17:10:54 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8C28A42D3B; Thu, 5 Jan 2023 17:10:47 +0100 (CET) Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) by mails.dpdk.org (Postfix) with ESMTP id 8714B4021E; Thu, 5 Jan 2023 17:10:46 +0100 (CET) Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id 2A7515C0036; Thu, 5 Jan 2023 11:10:46 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Thu, 05 Jan 2023 11:10:46 -0500 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=fm2; t=1672935046; x=1673021446; bh=eo 8ulix52WP2VxKmQa386eLKgRl38si7EwPtu/mDNeo=; b=ag4flPzKUCNQP/sqW6 sbnKAPB76y9YJo5agPi99hG29MdbB3cQk/tMLK168WjVUt8xYUWxYz4btaljGBri MpHoc2WmIop3Fwj/8jiBZcZtKhuE2CmJk0lUh8BPOPqa33iOwOrK1g3cbrwPf85y jJ4jl/LWeBSAON4Y4dqg85sgl5n4Se/pZ6ieOKuz6z2eD3uF0Y6z3ioJsB+ag7WF ySFBy4/tg0ZlIU1vV2/UR9lKSchWilL2qvh8tMJcmAxqDjUxlPfxWUXyNZo5YnP/ vd8YhzUXYdqoLbhMc+/DSiSNSxYkenkACTxvAMtz2YFaoRmNUWdFfp36jH3r9K1S dRIw== 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=fm2; t=1672935046; x=1673021446; bh=eo8ulix52WP2V xKmQa386eLKgRl38si7EwPtu/mDNeo=; b=VaVsPdchBycsJ19noHQVKThg5r0Ce DKgfHPl7nwzHSX5A90YLMLPyk45cphq3FWvRkGv4cq9gBSp0MD2PeSVZDnFp3BUu doqhbKE+nG1NhvsmM0i9lLy2lTuq9EistR5XVk3x0CCudLLcI/Houy0U4qw+seyp k8INkK7mALyOJyYC6Ae4PrMIxWnhAZU9a/EAsd7fuKEi965tKaO/8Jis2ZPTP/rg mJrFBb1bp51o4k6cHQKzoJIrP5beRpCZvXGZhunBsHDZE5VrTjM/jZYnkqmBCDqT KTdOEdDP7O4qcfpFbdxHgZc/F5lv6DaUsiuEVlUbQTieMxNpH76WbBj3Q== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrjeekgdekjecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvfevufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefvhhhomhgr shcuofhonhhjrghlohhnuceothhhohhmrghssehmohhnjhgrlhhonhdrnhgvtheqnecugg ftrfgrthhtvghrnhepvdejhfdugeehvddtieejieegteeuudfgjeeukeeiledthfetveek hefhieelhfdtnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrh homhepthhhohhmrghssehmohhnjhgrlhhonhdrnhgvth X-ME-Proxy: Feedback-ID: i47234305:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 5 Jan 2023 11:10:45 -0500 (EST) From: Thomas Monjalon To: dev@dpdk.org Cc: Tal Shnaiderman , stable@dpdk.org, Matan Azrad , Viacheslav Ovsiienko Subject: [PATCH 3/3] net/mlx5: fix Windows build with MinGW GCC 12 Date: Thu, 5 Jan 2023 17:10:20 +0100 Message-Id: <20230105161020.247780-4-thomas@monjalon.net> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230105161020.247780-1-thomas@monjalon.net> References: <20230105161020.247780-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 With recent changes in Meson and MinGW toolchain, the driver mlx5 was not able to compile on Linux for Windows. There were errors due to non-typed constants, constant going over int range forbidden in pedantic mode, vector Rx functions undefined in Windows case, and minimum-comparison of different types. Cc: stable@dpdk.org Signed-off-by: Thomas Monjalon --- drivers/common/mlx5/meson.build | 4 +- drivers/common/mlx5/windows/mlx5_win_defs.h | 100 +++++++++++--------- drivers/net/mlx5/meson.build | 11 ++- drivers/net/mlx5/windows/mlx5_os.c | 4 +- 4 files changed, 66 insertions(+), 53 deletions(-) diff --git a/drivers/common/mlx5/meson.build b/drivers/common/mlx5/meson.build index 60ccd95cbc..aea3ae4927 100644 --- a/drivers/common/mlx5/meson.build +++ b/drivers/common/mlx5/meson.build @@ -1,9 +1,9 @@ # SPDX-License-Identifier: BSD-3-Clause # Copyright 2019 Mellanox Technologies, Ltd -if not (is_linux or (is_windows and is_ms_linker)) +if not (is_linux or is_windows) build = false - reason = 'only supported on Linux and Windows build with clang' + reason = 'only supported on Linux and Windows' subdir_done() endif diff --git a/drivers/common/mlx5/windows/mlx5_win_defs.h b/drivers/common/mlx5/windows/mlx5_win_defs.h index 3554e4a7ff..65da820c5e 100644 --- a/drivers/common/mlx5/windows/mlx5_win_defs.h +++ b/drivers/common/mlx5/windows/mlx5_win_defs.h @@ -2,8 +2,10 @@ * Copyright (C) Mellanox Technologies, Ltd. 2001-2020. */ -#ifndef __MLX5_WIN_DEFS_H__ -#define __MLX5_WIN_DEFS_H__ +#ifndef MLX5_WIN_DEFS_H +#define MLX5_WIN_DEFS_H + +#include enum { MLX5_CQE_OWNER_MASK = 1, @@ -40,29 +42,29 @@ enum { }; enum mlx5dv_cq_init_attr_mask { - MLX5DV_CQ_INIT_ATTR_MASK_COMPRESSED_CQE = 1 << 0, - MLX5DV_CQ_INIT_ATTR_MASK_FLAGS = 1 << 1, - MLX5DV_CQ_INIT_ATTR_MASK_CQE_SIZE = 1 << 2, + MLX5DV_CQ_INIT_ATTR_MASK_COMPRESSED_CQE = RTE_BIT32(0), + MLX5DV_CQ_INIT_ATTR_MASK_FLAG = RTE_BIT32(1), + MLX5DV_CQ_INIT_ATTR_MASK_CQE_SIZE = RTE_BIT32(2), }; enum mlx5dv_cqe_comp_res_format { - MLX5DV_CQE_RES_FORMAT_HASH = 1 << 0, - MLX5DV_CQE_RES_FORMAT_CSUM = 1 << 1, - MLX5DV_CQE_RES_FORMAT_CSUM_STRIDX = 1 << 2, + MLX5DV_CQE_RES_FORMAT_HASH = RTE_BIT32(0), + MLX5DV_CQE_RES_FORMAT_CSUM = RTE_BIT32(1), + MLX5DV_CQE_RES_FORMAT_CSUM_STRIDX = RTE_BIT32(2), }; enum ibv_access_flags { - IBV_ACCESS_LOCAL_WRITE = 1, - IBV_ACCESS_REMOTE_WRITE = 1 << 1, - IBV_ACCESS_REMOTE_READ = 1 << 2, - IBV_ACCESS_REMOTE_ATOMIC = 1 << 3, - IBV_ACCESS_MW_BIND = 1 << 4, - IBV_ACCESS_ZERO_BASED = 1 << 5, - IBV_ACCESS_ON_DEMAND = 1 << 6, + IBV_ACCESS_LOCAL_WRITE = RTE_BIT32(0), + IBV_ACCESS_REMOTE_WRITE = RTE_BIT32(1), + IBV_ACCESS_REMOTE_READ = RTE_BIT32(2), + IBV_ACCESS_REMOTE_ATOMIC = RTE_BIT32(3), + IBV_ACCESS_MW_BIND = RTE_BIT32(4), + IBV_ACCESS_ZERO_BASED = RTE_BIT32(5), + IBV_ACCESS_ON_DEMAND = RTE_BIT32(6), }; enum mlx5_ib_uapi_devx_create_event_channel_flags { - MLX5_IB_UAPI_DEVX_CR_EV_CH_FLAGS_OMIT_DATA = 1 << 0, + MLX5_IB_UAPI_DEVX_CR_EV_CH_FLAGS_OMIT_DATA = RTE_BIT32(0), }; #define MLX5DV_DEVX_CREATE_EVENT_CHANNEL_FLAGS_OMIT_EV_DATA \ @@ -85,15 +87,15 @@ enum { }; enum { - MLX5_ETH_WQE_L3_CSUM = (1 << 6), - MLX5_ETH_WQE_L4_CSUM = (1 << 7), + MLX5_ETH_WQE_L3_CSUM = RTE_BIT32(6), + MLX5_ETH_WQE_L4_CSUM = RTE_BIT32(7), }; enum { - MLX5_WQE_CTRL_CQ_UPDATE = 2 << 2, - MLX5_WQE_CTRL_SOLICITED = 1 << 1, - MLX5_WQE_CTRL_FENCE = 4 << 5, - MLX5_WQE_CTRL_INITIATOR_SMALL_FENCE = 1 << 5, + MLX5_WQE_CTRL_SOLICITED = RTE_BIT32(1), + MLX5_WQE_CTRL_CQ_UPDATE = RTE_BIT32(3), + MLX5_WQE_CTRL_INITIATOR_SMALL_FENCE = RTE_BIT32(5), + MLX5_WQE_CTRL_FENCE = RTE_BIT32(7), }; enum { @@ -101,6 +103,11 @@ enum { MLX5_SEND_WQE_SHIFT = 6, }; +/* Verbs headers do not support -pedantic. */ +#ifdef PEDANTIC +#pragma GCC diagnostic ignored "-Wpedantic" +#endif + /* * RX Hash fields enable to set which incoming packet's field should * participates in RX Hash. Each flag represent certain packet's field, @@ -110,18 +117,22 @@ enum { * TCP and UDP flags can't be enabled together on the same QP. */ enum ibv_rx_hash_fields { - IBV_RX_HASH_SRC_IPV4 = 1 << 0, - IBV_RX_HASH_DST_IPV4 = 1 << 1, - IBV_RX_HASH_SRC_IPV6 = 1 << 2, - IBV_RX_HASH_DST_IPV6 = 1 << 3, - IBV_RX_HASH_SRC_PORT_TCP = 1 << 4, - IBV_RX_HASH_DST_PORT_TCP = 1 << 5, - IBV_RX_HASH_SRC_PORT_UDP = 1 << 6, - IBV_RX_HASH_DST_PORT_UDP = 1 << 7, - IBV_RX_HASH_IPSEC_SPI = 1 << 8, - IBV_RX_HASH_INNER = (1 << 31), + IBV_RX_HASH_SRC_IPV4 = RTE_BIT32(0), + IBV_RX_HASH_DST_IPV4 = RTE_BIT32(1), + IBV_RX_HASH_SRC_IPV6 = RTE_BIT32(2), + IBV_RX_HASH_DST_IPV6 = RTE_BIT32(3), + IBV_RX_HASH_SRC_PORT_TCP = RTE_BIT32(4), + IBV_RX_HASH_DST_PORT_TCP = RTE_BIT32(5), + IBV_RX_HASH_SRC_PORT_UDP = RTE_BIT32(6), + IBV_RX_HASH_DST_PORT_UDP = RTE_BIT32(7), + IBV_RX_HASH_IPSEC_SPI = RTE_BIT32(8), + IBV_RX_HASH_INNER = RTE_BIT32(31), }; +#ifdef PEDANTIC +#pragma GCC diagnostic error "-Wpedantic" +#endif + enum { MLX5_RCV_DBR = 0, MLX5_SND_DBR = 1, @@ -141,9 +152,9 @@ enum { #endif enum ibv_flow_flags { - IBV_FLOW_ATTR_FLAGS_ALLOW_LOOP_BACK = 1 << 0, - IBV_FLOW_ATTR_FLAGS_DONT_TRAP = 1 << 1, - IBV_FLOW_ATTR_FLAGS_EGRESS = 1 << 2, + IBV_FLOW_ATTR_FLAGS_ALLOW_LOOP_BACK = RTE_BIT32(0), + IBV_FLOW_ATTR_FLAGS_DONT_TRAP = RTE_BIT32(1), + IBV_FLOW_ATTR_FLAGS_EGRESS = RTE_BIT32(2), }; enum ibv_flow_attr_type { @@ -240,11 +251,11 @@ struct mlx5_wqe_data_seg { rte_be64_t addr; }; -#define MLX5DV_CONTEXT_FLAGS_CQE_128B_COMP (1 << 4) -#define IBV_DEVICE_RAW_IP_CSUM (1 << 26) -#define IBV_RAW_PACKET_CAP_CVLAN_STRIPPING (1 << 0) -#define IBV_RAW_PACKET_CAP_SCATTER_FCS (1 << 1) -#define IBV_QPT_RAW_PACKET 8 +#define MLX5DV_CONTEXT_FLAGS_CQE_128B_COMP RTE_BIT32(4) +#define IBV_DEVICE_RAW_IP_CSUM RTE_BIT32(26) +#define IBV_RAW_PACKET_CAP_CVLAN_STRIPPING RTE_BIT32(0) +#define IBV_RAW_PACKET_CAP_SCATTER_FCS RTE_BIT32(1) +#define IBV_QPT_RAW_PACKET 8 enum { MLX5_FLOW_CONTEXT_DEST_TYPE_VPORT = 0x0, @@ -254,8 +265,9 @@ enum { }; enum { - MLX5_MATCH_OUTER_HEADERS = 1 << 0, - MLX5_MATCH_MISC_PARAMETERS = 1 << 1, - MLX5_MATCH_INNER_HEADERS = 1 << 2, + MLX5_MATCH_OUTER_HEADERS = RTE_BIT32(0), + MLX5_MATCH_MISC_PARAMETERS = RTE_BIT32(1), + MLX5_MATCH_INNER_HEADERS = RTE_BIT32(2), }; -#endif /* __MLX5_WIN_DEFS_H__ */ + +#endif /* MLX5_WIN_DEFS_H */ diff --git a/drivers/net/mlx5/meson.build b/drivers/net/mlx5/meson.build index abd507bd88..fe704b1477 100644 --- a/drivers/net/mlx5/meson.build +++ b/drivers/net/mlx5/meson.build @@ -49,11 +49,12 @@ if is_linux 'mlx5_hws_cnt.c', 'mlx5_flow_verbs.c', ) - if (dpdk_conf.has('RTE_ARCH_X86_64') - or dpdk_conf.has('RTE_ARCH_ARM64') - or dpdk_conf.has('RTE_ARCH_PPC_64')) - sources += files('mlx5_rxtx_vec.c') - endif +endif + +if (dpdk_conf.has('RTE_ARCH_X86_64') + or dpdk_conf.has('RTE_ARCH_ARM64') + or dpdk_conf.has('RTE_ARCH_PPC_64')) + sources += files('mlx5_rxtx_vec.c') endif cflags_options = [ diff --git a/drivers/net/mlx5/windows/mlx5_os.c b/drivers/net/mlx5/windows/mlx5_os.c index 77f04cc931..7795c0a065 100644 --- a/drivers/net/mlx5/windows/mlx5_os.c +++ b/drivers/net/mlx5/windows/mlx5_os.c @@ -193,8 +193,8 @@ mlx5_os_capabilities_prepare(struct mlx5_dev_ctx_shared *sh) * Once DPDK supports it, take max size from device attr. */ sh->dev_cap.ind_table_max_size = - RTE_MIN(1 << hca_attr->rss_ind_tbl_cap, - (unsigned int)RTE_ETH_RSS_RETA_SIZE_512); + RTE_MIN((uint32_t) 1 << hca_attr->rss_ind_tbl_cap, + (uint32_t)RTE_ETH_RSS_RETA_SIZE_512); DRV_LOG(DEBUG, "Maximum Rx indirection table size is %u", sh->dev_cap.ind_table_max_size); }