From patchwork Sun Feb 28 12:53:36 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Monjalon X-Patchwork-Id: 88271 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 9D935A0548; Sun, 28 Feb 2021 13:54:09 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B9AEA22A262; Sun, 28 Feb 2021 13:54:02 +0100 (CET) Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) by mails.dpdk.org (Postfix) with ESMTP id 4EE9E22A240; Sun, 28 Feb 2021 13:54:00 +0100 (CET) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id A03385C00C4; Sun, 28 Feb 2021 07:53:59 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Sun, 28 Feb 2021 07:53:59 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm3; bh=+3QYb0+BockA8 5YHwjczCtwISoXT3WOu17HquhtISuE=; b=Y4U0l/oXKFrSeUhYGOd9Es9hHBjTQ /FqLibE0AhYJ816qhEoRCuKpjgRzvoSBkObg9fC6Xb6zFVCyVnPBAFAzJ7/QpSVK Ui9TMiAVjXjInM5Aq1njeGHBkAtVSG4R8CoGp4oN2Cr+KbLLRBK+qVIbU8986+AV 4gBq/4xhQXY6YqC1t4oqj5v7gYsrBbtnzCzeAsD4fptSe2inKC1aC0oGSkkiajPh IK1FTDPZx1N0Ta53VYxrOj1AdYSSr+BBMIJe3d/LZIutQXMbJ+fC0sBRlNvDpCIy O6TipBJOgR+jQY7sSIKg6jOBVH85ppFTiwqQ1NkW0On9xWxOyXZ6nJIdA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=+3QYb0+BockA85YHwjczCtwISoXT3WOu17HquhtISuE=; b=kQ9s86Ap Itef/AG08vrNVYlUpIQz9tieU6qpRltJLdSWRHk1FiW5H+GdZ38J9W5Gvuy459HV LIB6+0uP95dnZhG13qD2BZK3zHGUpRAWNOm1IymdqTBX17JnLxSD6lDOGP7bSmf1 LE4DBo32GbeVMejMJ9w/NTojd+YmpUJGOoBii3I524VlaveyWfa/EzYVVYbGaTJd 9gbBQ0bO4tDi3tschvkHvpKtgctDv/4DPr559ybeSiG/+etXLNvnC6IxtmpySEtC FWPeIJ7+Nj4jv8J8r1BSsobmiHPmhtMZ4SfMKecObMIUo3VuxxcKGt5GErPyCJ3w 4OaSATKwfEJcow== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrleeigdegjecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomhepvfhhohhmrghs ucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenucggtf frrghtthgvrhhnpedvhefgiedvjeegtdevheefhfetleefgfeivefgffevfeejgedtgfeu tdehtdegveenucfkphepjeejrddufeegrddvtdefrddukeegnecuvehluhhsthgvrhfuih iivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepthhhohhmrghssehmohhnjhgrlhho nhdrnhgvth X-ME-Proxy: Received: from xps.monjalon.net (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id 611821080057; Sun, 28 Feb 2021 07:53:58 -0500 (EST) From: Thomas Monjalon To: dev@dpdk.org Cc: ncopa@alpinelinux.org, stable@dpdk.org, Bruce Richardson , Dmitry Kozlyuk , Narcisa Ana Maria Vasile , Dmitry Malloy , Pallavi Kadam , Anand Rawat , Harini Ramakrishnan Date: Sun, 28 Feb 2021 13:53:36 +0100 Message-Id: <20210228125353.2436562-2-thomas@monjalon.net> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210228125353.2436562-1-thomas@monjalon.net> References: <20190313170657.16688-1-ncopa@alpinelinux.org> <20210228125353.2436562-1-thomas@monjalon.net> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v6 01/17] eal: fix comment of OS-specific header files 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 Sender: "dev" The same comment is on top of each rte_os.h file. It is reworded to remove the mention of "future releases". Fixes: 428eb983f5f7 ("eal: add OS specific header file") Cc: stable@dpdk.org Signed-off-by: Thomas Monjalon --- lib/librte_eal/freebsd/include/rte_os.h | 5 ++--- lib/librte_eal/linux/include/rte_os.h | 5 ++--- lib/librte_eal/windows/include/rte_os.h | 5 ++--- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/lib/librte_eal/freebsd/include/rte_os.h b/lib/librte_eal/freebsd/include/rte_os.h index eeb750cd81..c16f2a30e9 100644 --- a/lib/librte_eal/freebsd/include/rte_os.h +++ b/lib/librte_eal/freebsd/include/rte_os.h @@ -6,9 +6,8 @@ #define _RTE_OS_H_ /** - * This is header should contain any function/macro definition - * which are not supported natively or named differently in the - * freebsd OS. Functions will be added in future releases. + * This header should contain any definition + * which is not supported natively or named differently in FreeBSD. */ #include diff --git a/lib/librte_eal/linux/include/rte_os.h b/lib/librte_eal/linux/include/rte_os.h index 218d4fa86e..390b87b3a1 100644 --- a/lib/librte_eal/linux/include/rte_os.h +++ b/lib/librte_eal/linux/include/rte_os.h @@ -6,9 +6,8 @@ #define _RTE_OS_H_ /** - * This is header should contain any function/macro definition - * which are not supported natively or named differently in the - * linux OS. Functions will be added in future releases. + * This header should contain any definition + * which is not supported natively or named differently in Linux. */ #include diff --git a/lib/librte_eal/windows/include/rte_os.h b/lib/librte_eal/windows/include/rte_os.h index 7ef38ff06c..f0512f20a6 100644 --- a/lib/librte_eal/windows/include/rte_os.h +++ b/lib/librte_eal/windows/include/rte_os.h @@ -6,9 +6,8 @@ #define _RTE_OS_H_ /** - * This is header should contain any function/macro definition - * which are not supported natively or named differently in the - * Windows OS. It must not include Windows-specific headers. + * This header should contain any definition + * which is not supported natively or named differently in Windows. */ #include From patchwork Sun Feb 28 12:53:37 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Monjalon X-Patchwork-Id: 88272 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 51EB2A0548; Sun, 28 Feb 2021 13:54:18 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3AC9D22A276; Sun, 28 Feb 2021 13:54:05 +0100 (CET) Received: from wout3-smtp.messagingengine.com (wout3-smtp.messagingengine.com [64.147.123.19]) by mails.dpdk.org (Postfix) with ESMTP id 2B19522A26A; Sun, 28 Feb 2021 13:54:04 +0100 (CET) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.west.internal (Postfix) with ESMTP id B05A05C4; Sun, 28 Feb 2021 07:54:02 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Sun, 28 Feb 2021 07:54:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm3; bh=tHE4Ihilo2d1S /gAe3FbUUEeqknUKRqxynfsUG0icG0=; b=Cu7S9itLkx3R2tZlIhfYxGQg5X1l2 EDRzTBSih5/z/ySUIUhI33VrGvgo+YKSSPeBrGUzr0YbXw9CWcFsoVwLDKgkiriZ RUzzyaKbAicS7LszjJD2722w57r1lu7lap25ypUhAp7oREGp10dIEpoK379GbTKe j9i1mVKL1iZdhv99Xt63ETuJHEKNUNzsUhUxjUfn8e2BMmE/uS+h6xX+dAxrBBdt zPphF8kK++WxY3JvK2s9me3dawUiPS/2IABkm97VuCuSR6Ycj+8ySwuLf3w/BsnL +4nnRTJyD1/fAmpDQUsRQB65vnOaIM/LI46RxTFUQ0UQhmzxSj1q+1jVg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=tHE4Ihilo2d1S/gAe3FbUUEeqknUKRqxynfsUG0icG0=; b=GpS+Y0nl IfSJFmO8wEGp5tKhl4uqVboO3TWEatUC3iDsoT5ndLkY3teCwvN3GXz5wrBpUEAT VMp/LsNXe01sKWAyvPn5yVtJZnqexq9FX6Iuvd0r71CzMyfuxvBGF6buxWc9glE2 9zKwelPWpr1/JA/13nXeJ7XVnflFPp03mLrFVdGIMvfTCz7n81eOy9GYzUd+Xl5E pXqeAyTf/Kium448tjLekFWIwlQSiQK6M5wX9vesQonymkv+L6IHR5ghZ3o+HooQ n2wV0Hq5/W8vONeRLRUtL1Lko1rjJX7czYoag143EcUiAW0Y7f6kB48ebPGcHj/3 r/M11BXqNGAEDg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrleeigdegjecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomhepvfhhohhmrghs ucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenucggtf frrghtthgvrhhnpeduudehvefgffevtdetfeetkeehhfehffekfffgvddtfeejgfetieff hffftddutdenucffohhmrghinhepghhnuhdrohhrghenucfkphepjeejrddufeegrddvtd efrddukeegnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhho mhepthhhohhmrghssehmohhnjhgrlhhonhdrnhgvth X-ME-Proxy: Received: from xps.monjalon.net (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id 89F071080057; Sun, 28 Feb 2021 07:54:00 -0500 (EST) From: Thomas Monjalon To: dev@dpdk.org Cc: ncopa@alpinelinux.org, stable@dpdk.org, Bruce Richardson , Konstantin Ananyev , Ray Kinsella , Neil Horman , David Marchand , Haiyue Wang , Adrien Mazarguil Date: Sun, 28 Feb 2021 13:53:37 +0100 Message-Id: <20210228125353.2436562-3-thomas@monjalon.net> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210228125353.2436562-1-thomas@monjalon.net> References: <20190313170657.16688-1-ncopa@alpinelinux.org> <20210228125353.2436562-1-thomas@monjalon.net> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v6 02/17] buildtools: fix build with busybox 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 Sender: "dev" If using busybox for mktemp and awk (as in Alpine), some bugs prevent the script from running: 1/ It seems busybox mktemp requires the pattern to have at least 6 X and no other suffix. The same has been fixed for other scripts in the past: commit 3771edc35438 ("buildtools: fix build for some mktemp") 2/ It seems busybox awk does not accept the regex ^.*{ except if the opening curly brace is escaped. Fixes: 4c82473412e8 ("build: add internal tag check") Fixes: 68b1f1cda5b4 ("build: check AVX512 rather than binutils version") Fixes: 3290ac14eb94 ("buildtools: detect discrepancies for experimental symbols") Cc: stable@dpdk.org Signed-off-by: Thomas Monjalon Acked-by: Bruce Richardson --- buildtools/binutils-avx512-check.sh | 2 +- buildtools/check-symbols.sh | 2 +- buildtools/map-list-symbol.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/buildtools/binutils-avx512-check.sh b/buildtools/binutils-avx512-check.sh index a7e068140f..2a833b64b7 100755 --- a/buildtools/binutils-avx512-check.sh +++ b/buildtools/binutils-avx512-check.sh @@ -3,7 +3,7 @@ # Copyright(c) 2020 Intel Corporation AS=${AS:-as} -OBJFILE=$(mktemp -t dpdk.binutils-check.XXXXXX.o) +OBJFILE=$(mktemp -t dpdk.binutils-check.XXXXXX) trap 'rm -f "$OBJFILE"' EXIT # from https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90028 GATHER_PARAMS='0x8(,%ymm1,1),%ymm0{%k2}' diff --git a/buildtools/check-symbols.sh b/buildtools/check-symbols.sh index e407553a34..6723e38450 100755 --- a/buildtools/check-symbols.sh +++ b/buildtools/check-symbols.sh @@ -18,7 +18,7 @@ then exit 0 fi -DUMPFILE=$(mktemp -t dpdk.${0##*/}.XXX.objdump) +DUMPFILE=$(mktemp -t dpdk.${0##*/}.XXXXXX) trap 'rm -f "$DUMPFILE"' EXIT objdump -t $OBJFILE >$DUMPFILE diff --git a/buildtools/map-list-symbol.sh b/buildtools/map-list-symbol.sh index 5509b4a7fa..3bf9bd66f8 100755 --- a/buildtools/map-list-symbol.sh +++ b/buildtools/map-list-symbol.sh @@ -44,7 +44,7 @@ for file in $@; do ret = 1; } } - /^.*{/ { + /^.*\{/ { if ("'$section'" == "all" || $1 == "'$section'") { current_section = $1; } From patchwork Sun Feb 28 12:53:38 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Monjalon X-Patchwork-Id: 88273 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 AF6ADA0548; Sun, 28 Feb 2021 13:54:27 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9581522A275; Sun, 28 Feb 2021 13:54:06 +0100 (CET) Received: from wout3-smtp.messagingengine.com (wout3-smtp.messagingengine.com [64.147.123.19]) by mails.dpdk.org (Postfix) with ESMTP id 9AEC722A26A; Sun, 28 Feb 2021 13:54:04 +0100 (CET) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.west.internal (Postfix) with ESMTP id 93A625D4; Sun, 28 Feb 2021 07:54:03 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Sun, 28 Feb 2021 07:54:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm3; bh=xdj9HOKcUYReE mi2Y/XsMU997JCJbBiR+6Yy23h8tmU=; b=g7zjO80IOr4ZsPqNcIQbl2sL2rsRL CbkIRd40anG3FAb/b64KWf2cBtDO766yGvOOx0f6mw4uYxk9FIsOtltgxjIURyiU T1HbYFp2OY8uIyGn1lHNdn9lxzisweCLx2pqPeTH1OPYe/rcIXO6uIZHm7oNvBVv SJ2uzgL1qUQK2ctQcKMQYVUOkjuJ6OrBzOjvbde7tu8lMIx9yrAvXjrGntpPH40c ryT0scUlmgQzOp1ghYYlsfG0bmFWTse7yNc1jwuDSUgNgTJ0q8RRAb5seE6nQC/k r2ICzpxMebGz52+kBLp+L78sporLfHFzKytd663+drrURpLpXSEOdsdKA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=xdj9HOKcUYReEmi2Y/XsMU997JCJbBiR+6Yy23h8tmU=; b=HHqlVKk3 FmXFFTP+Mj8pdUHpfX5+vzp3l2cBrFwC8MWTuCkANu2BuZgNsC/Q/KW61jLQzKO0 efxgHoBRugVGOfqWkqr6/1kIl2SWAvZpa0XlC3rta797keLh1pYZnKpZg5y0tIG2 SgKdQljLnmT2NoNHzK+Ny4tp3Dht8V0+bl8Zpp65tOiMspKtOItFMQqTglHsDBgx a+vwOVpFTdQAM6ERrXYfICGhT0cFy2S+szLwyEsegQgfntYavG/7bMV3uCyi4+AF vrWbXf9ApmubD/3mHtQ1SHHTDdxyAe0HaRSjBWuPNUka87qEm99Bkd0fVwZvNDNb ukMq5rcGLx1vsw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrleeigdegjecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomhepvfhhohhmrghs ucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenucggtf frrghtthgvrhhnpedvhefgiedvjeegtdevheefhfetleefgfeivefgffevfeejgedtgfeu tdehtdegveenucfkphepjeejrddufeegrddvtdefrddukeegnecuvehluhhsthgvrhfuih iivgepudenucfrrghrrghmpehmrghilhhfrhhomhepthhhohhmrghssehmohhnjhgrlhho nhdrnhgvth X-ME-Proxy: Received: from xps.monjalon.net (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id 945771080059; Sun, 28 Feb 2021 07:54:02 -0500 (EST) From: Thomas Monjalon To: dev@dpdk.org Cc: ncopa@alpinelinux.org, stable@dpdk.org, Bruce Richardson Date: Sun, 28 Feb 2021 13:53:38 +0100 Message-Id: <20210228125353.2436562-4-thomas@monjalon.net> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210228125353.2436562-1-thomas@monjalon.net> References: <20190313170657.16688-1-ncopa@alpinelinux.org> <20210228125353.2436562-1-thomas@monjalon.net> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v6 03/17] build: detect execinfo library on Linux 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 Sender: "dev" The library execinfo and its header file can be installed on Alpine Linux where the backtrace feature is not part of musl libc: apk add libexecinfo-dev As a consequence, this library should not be restricted to BSD only. At the same time, the library and header are detected once and added globally to be linked with any application, internal or external. Fixes: 9065b1fac65f ("build: fix dependency on execinfo for BSD meson builds") Cc: stable@dpdk.org Signed-off-by: Thomas Monjalon Acked-by: Bruce Richardson --- app/meson.build | 4 ---- app/test/meson.build | 1 - config/meson.build | 9 ++++++--- examples/meson.build | 4 +--- 4 files changed, 7 insertions(+), 11 deletions(-) diff --git a/app/meson.build b/app/meson.build index 87fc195dbf..50a53dbde8 100644 --- a/app/meson.build +++ b/app/meson.build @@ -21,9 +21,6 @@ apps = [ 'test-regex', 'test-sad'] -# for BSD only -lib_execinfo = cc.find_library('execinfo', required: false) - default_cflags = machine_args + ['-DALLOW_EXPERIMENTAL_API'] default_ldflags = [] if get_option('default_library') == 'static' and not is_windows @@ -53,7 +50,6 @@ foreach app:apps dep_objs += get_variable(get_option('default_library') + '_rte_' + d) endforeach - dep_objs += lib_execinfo link_libs = [] if get_option('default_library') == 'static' diff --git a/app/test/meson.build b/app/test/meson.build index 561e493a29..099895fc87 100644 --- a/app/test/meson.build +++ b/app/test/meson.build @@ -426,7 +426,6 @@ foreach d:test_deps def_lib = get_option('default_library') test_dep_objs += get_variable(def_lib + '_rte_' + d) endforeach -test_dep_objs += cc.find_library('execinfo', required: false) link_libs = [] if get_option('default_library') == 'static' diff --git a/config/meson.build b/config/meson.build index 3cf560b8a3..66a2edcc47 100644 --- a/config/meson.build +++ b/config/meson.build @@ -125,11 +125,8 @@ if cc.find_library('m', required : false).found() dpdk_extra_ldflags += '-lm' endif -# for linux link against dl, for bsd execinfo if is_linux link_lib = 'dl' -elif is_freebsd - link_lib = 'execinfo' else link_lib = '' endif @@ -166,6 +163,12 @@ if fdt_dep.found() and cc.has_header('fdt.h') dpdk_extra_ldflags += '-lfdt' endif +libexecinfo = cc.find_library('libexecinfo', required: false) +if libexecinfo.found() and cc.has_header('execinfo.h') + add_project_link_arguments('-lexecinfo', language: 'c') + dpdk_extra_ldflags += '-lexecinfo' +endif + # check for libbsd libbsd = dependency('libbsd', required: false, method: 'pkg-config') if libbsd.found() diff --git a/examples/meson.build b/examples/meson.build index b9ab24223f..ab06e2da33 100644 --- a/examples/meson.build +++ b/examples/meson.build @@ -6,8 +6,6 @@ if get_option('default_library') == 'static' link_whole_libs = dpdk_static_libraries + dpdk_drivers endif -execinfo = cc.find_library('execinfo', required: false) - # list of all example apps. Keep 1-3 per line, in alphabetical order. all_examples = [ 'bbdev_app', 'bond', @@ -76,7 +74,7 @@ foreach example: examples cflags = default_cflags ldflags = default_ldflags - ext_deps = [execinfo] + ext_deps = [] includes = [include_directories(example)] deps = ['eal', 'mempool', 'net', 'mbuf', 'ethdev', 'cmdline'] subdir(example) From patchwork Sun Feb 28 12:53:39 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Monjalon X-Patchwork-Id: 88274 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 526C0A0548; Sun, 28 Feb 2021 13:54:38 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 762DE22A27F; Sun, 28 Feb 2021 13:54:08 +0100 (CET) Received: from new2-smtp.messagingengine.com (new2-smtp.messagingengine.com [66.111.4.224]) by mails.dpdk.org (Postfix) with ESMTP id 2B65C22A268; Sun, 28 Feb 2021 13:54:06 +0100 (CET) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailnew.nyi.internal (Postfix) with ESMTP id C652A5800D9; Sun, 28 Feb 2021 07:54:05 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Sun, 28 Feb 2021 07:54:05 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm3; bh=kXjTeIfaRFwMF 283cB7YA65ARcTmowfSjYiQL8TpI4c=; b=r+iu5VeKFc6zYkOW2ku+adPVcHvKi laiNPcLDGSOjKm4fiGEzhSiVU4wbHGsgZtm4dDr3r1tcRVXL7BS9C8Siz6+uTc+i 35yIqq+4LI9pFGA9dXbt+TquG0ydqVn17uu/Xq7zmmbfaGc91X3iGVDI6ZZqjKGQ oa86OXUxmW7+TNz0mIxxT2z/l1G7ywN4BJZf8hz2PlBCgWnH7UefmNlzWqqDwyCU pBKqiYAfvNHZ7sXwAAM6dhLwReWq0vt+AOGZ+c+4829al7Agvr/Qcc4HbDbF1OSo Voo6t9yFoOzTTXS/oVfuL5fClasIBT84D/xBBOV9koToWoFWVPNsd5ZeQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=kXjTeIfaRFwMF283cB7YA65ARcTmowfSjYiQL8TpI4c=; b=oSvRaNPz Ll2G5uLga1LT8eixkzMVe9bbBQLuvVWP6w14Uv4DxqXqflHKRFRGG7fUKH0/aWHK luAtfjxKJoEw0hnTYD0RirKL6fWWK/0wJFTqkdsVlWe5qF9kO0aouA8nbnkykM+L Te/fzpEyXt4QcUk7DAa2ncbHKR2Hvcfz80TRALDbbGsBQs5yektrGqyJ6e6QjPyn pC/Ddd+6i9KENfaBuzpuxs9gS5Jg6FFis0G+vYOaX6/t+er+u3+pA3sxvW/5mcWJ pKPI6zUAYPWuX8BdVNLmvzcBkHGi5gWAeIs6TtRPvvUrv9A5M475x1K+UevSP7H3 6+S7Ed7rrfGlvg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrleeigdegjecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomhepvfhhohhmrghs ucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenucggtf frrghtthgvrhhnpedvhefgiedvjeegtdevheefhfetleefgfeivefgffevfeejgedtgfeu tdehtdegveenucfkphepjeejrddufeegrddvtdefrddukeegnecuvehluhhsthgvrhfuih iivgepudenucfrrghrrghmpehmrghilhhfrhhomhepthhhohhmrghssehmohhnjhgrlhho nhdrnhgvth X-ME-Proxy: Received: from xps.monjalon.net (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id 30EF11080057; Sun, 28 Feb 2021 07:54:04 -0500 (EST) From: Thomas Monjalon To: dev@dpdk.org Cc: ncopa@alpinelinux.org, stable@dpdk.org, Hemant Agrawal , Sachin Saxena , Jakub Grajciar , Matan Azrad , Shahaf Shuler , Viacheslav Ovsiienko , Anatoly Burakov , Marcin Smoczynski , Konstantin Ananyev , Xueming Li , Xiaoyu Min Date: Sun, 28 Feb 2021 13:53:39 +0100 Message-Id: <20210228125353.2436562-5-thomas@monjalon.net> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210228125353.2436562-1-thomas@monjalon.net> References: <20190313170657.16688-1-ncopa@alpinelinux.org> <20210228125353.2436562-1-thomas@monjalon.net> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v6 04/17] build: remove redundant _GNU_SOURCE definitions 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 Sender: "dev" The feature macro _GNU_SOURCE is defined globally, but there was some remaining useless settings. The internal definition in config/meson.build is kept, all other internal definitions of _GNU_SOURCE are removed, except in examples, which can be built as external applications. Note: external applications do not inherit of _GNU_SOURCE. Fixes: 5d7b673d5fd6 ("mk: build with _GNU_SOURCE defined by default") Fixes: 28188cee2aa0 ("build: enable BSD features visibility for FreeBSD") Fixes: e6cdc54cc0ef ("net/mlx5: add socket server for external tools") Cc: stable@dpdk.org Signed-off-by: Thomas Monjalon --- app/test/meson.build | 2 -- drivers/bus/fslmc/qbman/include/compat.h | 3 --- drivers/common/dpaax/compat.h | 4 ---- drivers/common/dpaax/meson.build | 1 - drivers/net/memif/rte_eth_memif.h | 4 ---- drivers/net/mlx5/linux/mlx5_socket.c | 4 ---- 6 files changed, 18 deletions(-) diff --git a/app/test/meson.build b/app/test/meson.build index 099895fc87..76eaaea457 100644 --- a/app/test/meson.build +++ b/app/test/meson.build @@ -398,8 +398,6 @@ if cc.has_argument('-Wno-format-truncation') cflags += '-Wno-format-truncation' endif -# specify -D_GNU_SOURCE unconditionally -cflags += '-D_GNU_SOURCE' # Strict-aliasing rules are violated by uint8_t[] to context size casts. cflags += '-fno-strict-aliasing' diff --git a/drivers/bus/fslmc/qbman/include/compat.h b/drivers/bus/fslmc/qbman/include/compat.h index 1ddd69e127..a4471a80af 100644 --- a/drivers/bus/fslmc/qbman/include/compat.h +++ b/drivers/bus/fslmc/qbman/include/compat.h @@ -8,9 +8,6 @@ #ifndef HEADER_COMPAT_H #define HEADER_COMPAT_H -#ifndef _GNU_SOURCE -#define _GNU_SOURCE -#endif #include #include #include diff --git a/drivers/common/dpaax/compat.h b/drivers/common/dpaax/compat.h index 1a5f36e99e..c69e76ab96 100644 --- a/drivers/common/dpaax/compat.h +++ b/drivers/common/dpaax/compat.h @@ -10,10 +10,6 @@ #define __COMPAT_H #include - -#ifndef _GNU_SOURCE -#define _GNU_SOURCE -#endif #include #include #include diff --git a/drivers/common/dpaax/meson.build b/drivers/common/dpaax/meson.build index 4535482701..b7f177a62e 100644 --- a/drivers/common/dpaax/meson.build +++ b/drivers/common/dpaax/meson.build @@ -10,7 +10,6 @@ sources = files('dpaax_iova_table.c', 'dpaa_of.c', 'caamflib.c') includes += include_directories('caamflib') -cflags += ['-D_GNU_SOURCE'] if cc.has_argument('-Wno-cast-qual') cflags += '-Wno-cast-qual' endif diff --git a/drivers/net/memif/rte_eth_memif.h b/drivers/net/memif/rte_eth_memif.h index 24321d3a39..2038bda742 100644 --- a/drivers/net/memif/rte_eth_memif.h +++ b/drivers/net/memif/rte_eth_memif.h @@ -5,10 +5,6 @@ #ifndef _RTE_ETH_MEMIF_H_ #define _RTE_ETH_MEMIF_H_ -#ifndef _GNU_SOURCE -#define _GNU_SOURCE -#endif /* GNU_SOURCE */ - #include #include diff --git a/drivers/net/mlx5/linux/mlx5_socket.c b/drivers/net/mlx5/linux/mlx5_socket.c index 1938453980..b1f41bc102 100644 --- a/drivers/net/mlx5/linux/mlx5_socket.c +++ b/drivers/net/mlx5/linux/mlx5_socket.c @@ -2,10 +2,6 @@ * Copyright 2019 Mellanox Technologies, Ltd */ -#ifndef _GNU_SOURCE -#define _GNU_SOURCE -#endif - #include #include #include From patchwork Sun Feb 28 12:53:40 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Monjalon X-Patchwork-Id: 88275 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 92EC7A0548; Sun, 28 Feb 2021 13:54:47 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E21DE22A29A; Sun, 28 Feb 2021 13:54:09 +0100 (CET) Received: from new2-smtp.messagingengine.com (new2-smtp.messagingengine.com [66.111.4.224]) by mails.dpdk.org (Postfix) with ESMTP id 20B2D22A27F; Sun, 28 Feb 2021 13:54:08 +0100 (CET) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailnew.nyi.internal (Postfix) with ESMTP id C3187580393; Sun, 28 Feb 2021 07:54:07 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Sun, 28 Feb 2021 07:54:07 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm3; bh=hkc05ZdljT4cA 9nopi4moqKwTYjl5bTiHKhiEmHXke0=; b=s0SqI7rzMxdbalE1jf6LAs1USOfZ1 AdzXJqU4PNui6ekTYxB7YeT3omSjUaq9x/Xx0iDd4HOW5n7B2/VQ0lSEmB1kjb7T M8NCKaYe3mGl9IALtig7YnPhi/21/fJr8ic261ZwpjlcRwlPRY3stNeuRLRIJrX5 pb0T4+wowWp29H/wL4N1KYPBXcD7fLribh3Y4OnTvBX0KxOUVZ9RSUXNelTgxTWB yCwZFr/gZzE+wKmFruqhZO31iIe7EesElT2YX/losaKMQMsBqVbtgjZtxsd6+Evl OfLm7BMj8xACILrfpOy3MeBj6kNnX+l0fpXiADXzl3EZ2DTKXwm43Cn9Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=hkc05ZdljT4cA9nopi4moqKwTYjl5bTiHKhiEmHXke0=; b=Q+L1ExGq Skdl201rNVb/nZsC9xwHIWHrtPtFgO4yKmjxIdSEIWYtK68WTzKkOUIwlMaUd3Jh VNEWMhND+gRG6Vps+lls/3zQpwe04Xm4xWLAmMDGpbEMUiRemyuAL2TR3JHX7xZV kxS3g/dMbTg15b7BWOC57pf3R2YZbLU3I2p8/LFpnBbindVLrfWzxOesv1Fuok+g pJET9q9XDQsc7bN0+T8KAX+PtUxM4Q+NzIF/HlPuTzYqvMISN3q1YvO9F9vwBYKm IZbH0PuWofvFwTI8QoS7h0CaCxvZjM8z2VybB6mQeZtHoRf8StQ62Nq9pveqo6Gn FYEagi+bwFggZw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrleeigdegkecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomhepvfhhohhmrghs ucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenucggtf frrghtthgvrhhnpeehjefhvdffueehieevuddvfeeigefhtddvvddtheehgfekfefhtdfh teffgeetueenucffohhmrghinheptghonhhfrdhinhenucfkphepjeejrddufeegrddvtd efrddukeegnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhho mhepthhhohhmrghssehmohhnjhgrlhhonhdrnhgvth X-ME-Proxy: Received: from xps.monjalon.net (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id 8219C1080054; Sun, 28 Feb 2021 07:54:06 -0500 (EST) From: Thomas Monjalon To: dev@dpdk.org Cc: ncopa@alpinelinux.org, stable@dpdk.org, Bruce Richardson , Dmitry Kozlyuk , Narcisa Ana Maria Vasile , Dmitry Malloy , Pallavi Kadam , Kevin Laatz , Ferruh Yigit , Jerin Jacob Date: Sun, 28 Feb 2021 13:53:40 +0100 Message-Id: <20210228125353.2436562-6-thomas@monjalon.net> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210228125353.2436562-1-thomas@monjalon.net> References: <20190313170657.16688-1-ncopa@alpinelinux.org> <20210228125353.2436562-1-thomas@monjalon.net> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v6 05/17] eal: fix build with musl 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 Sender: "dev" In musl libc, cpu_set_t is defined only if _GNU_SOURCE is defined. In case _GNU_SOURCE is undefined, as in eal_common_errno.c, it was not possible to include rte_os.h which uses cpu_set_t. This limitation is removed: if CPU_SETSIZE is not defined, cpu_set_t related definitions and functions are skipped. Note: such definitions are unneeded in eal_common_errno.c. Applications which do not define _GNU_SOURCE may miss cpu_set_t related features on musl. Such case is detected by RTE_HAS_CPUSET being undefined, so functions which depend on rte_cpuset_t will be unavailable. A missing include of fcntl.h is also added. Bugzilla ID: 35 Fixes: 11b57c698005 ("eal: fix error string function") Fixes: 176bb37ca6f3 ("eal: introduce internal wrappers for file operations") Cc: stable@dpdk.org Signed-off-by: Thomas Monjalon Signed-off-by: Natanael Copa --- doc/api/doxy-api.conf.in | 3 ++- lib/librte_eal/freebsd/include/rte_os.h | 1 + lib/librte_eal/include/rte_lcore.h | 4 ++++ lib/librte_eal/include/rte_thread.h | 4 ++++ lib/librte_eal/linux/include/rte_os.h | 3 +++ lib/librte_eal/unix/eal_file.c | 1 + lib/librte_eal/windows/include/sched.h | 1 + lib/librte_telemetry/rte_telemetry.h | 4 ++++ 8 files changed, 20 insertions(+), 1 deletion(-) diff --git a/doc/api/doxy-api.conf.in b/doc/api/doxy-api.conf.in index 5c883b613b..a536bcb493 100644 --- a/doc/api/doxy-api.conf.in +++ b/doc/api/doxy-api.conf.in @@ -80,7 +80,8 @@ INPUT += @API_EXAMPLES@ FILE_PATTERNS = rte_*.h \ cmdline.h PREDEFINED = __DOXYGEN__ \ - VFIO_PRESENT \ + RTE_HAS_CPUSET \ + VFIO_PRESENT \ __attribute__(x)= OPTIMIZE_OUTPUT_FOR_C = YES diff --git a/lib/librte_eal/freebsd/include/rte_os.h b/lib/librte_eal/freebsd/include/rte_os.h index c16f2a30e9..627f0483ab 100644 --- a/lib/librte_eal/freebsd/include/rte_os.h +++ b/lib/librte_eal/freebsd/include/rte_os.h @@ -13,6 +13,7 @@ #include typedef cpuset_t rte_cpuset_t; +#define RTE_HAS_CPUSET #define RTE_CPU_AND(dst, src1, src2) do \ { \ cpuset_t tmp; \ diff --git a/lib/librte_eal/include/rte_lcore.h b/lib/librte_eal/include/rte_lcore.h index 0fe0bd839c..1550b75da0 100644 --- a/lib/librte_eal/include/rte_lcore.h +++ b/lib/librte_eal/include/rte_lcore.h @@ -186,6 +186,8 @@ __rte_experimental int rte_lcore_to_cpu_id(int lcore_id); +#ifdef RTE_HAS_CPUSET + /** * @warning * @b EXPERIMENTAL: this API may change without prior notice. @@ -200,6 +202,8 @@ __rte_experimental rte_cpuset_t rte_lcore_cpuset(unsigned int lcore_id); +#endif /* RTE_HAS_CPUSET */ + /** * Test if an lcore is enabled. * diff --git a/lib/librte_eal/include/rte_thread.h b/lib/librte_eal/include/rte_thread.h index e640ea1857..ac5a89b1ad 100644 --- a/lib/librte_eal/include/rte_thread.h +++ b/lib/librte_eal/include/rte_thread.h @@ -25,6 +25,8 @@ extern "C" { */ typedef struct eal_tls_key *rte_tls_key; +#ifdef RTE_HAS_CPUSET + /** * Set core affinity of the current thread. * Support both EAL and non-EAL thread and update TLS. @@ -46,6 +48,8 @@ int rte_thread_set_affinity(rte_cpuset_t *cpusetp); */ void rte_thread_get_affinity(rte_cpuset_t *cpusetp); +#endif /* RTE_HAS_CPUSET */ + /** * Create a TLS data key visible to all threads in the process. * the created key is later used to get/set a value. diff --git a/lib/librte_eal/linux/include/rte_os.h b/lib/librte_eal/linux/include/rte_os.h index 390b87b3a1..1618b4df22 100644 --- a/lib/librte_eal/linux/include/rte_os.h +++ b/lib/librte_eal/linux/include/rte_os.h @@ -12,7 +12,9 @@ #include +#ifdef CPU_SETSIZE /* may require _GNU_SOURCE */ typedef cpu_set_t rte_cpuset_t; +#define RTE_HAS_CPUSET #define RTE_CPU_AND(dst, src1, src2) CPU_AND(dst, src1, src2) #define RTE_CPU_OR(dst, src1, src2) CPU_OR(dst, src1, src2) #define RTE_CPU_FILL(set) do \ @@ -28,5 +30,6 @@ typedef cpu_set_t rte_cpuset_t; RTE_CPU_FILL(&tmp); \ CPU_XOR(dst, &tmp, src); \ } while (0) +#endif #endif /* _RTE_OS_H_ */ diff --git a/lib/librte_eal/unix/eal_file.c b/lib/librte_eal/unix/eal_file.c index 1b26475ba4..ec554e0096 100644 --- a/lib/librte_eal/unix/eal_file.c +++ b/lib/librte_eal/unix/eal_file.c @@ -4,6 +4,7 @@ #include #include +#include #include #include diff --git a/lib/librte_eal/windows/include/sched.h b/lib/librte_eal/windows/include/sched.h index fbe07f742c..ff572b5dcb 100644 --- a/lib/librte_eal/windows/include/sched.h +++ b/lib/librte_eal/windows/include/sched.h @@ -28,6 +28,7 @@ extern "C" { typedef struct _rte_cpuset_s { long long _bits[_NUM_SETS(CPU_SETSIZE)]; } rte_cpuset_t; +#define RTE_HAS_CPUSET #define CPU_SET(b, s) ((s)->_bits[_WHICH_SET(b)] |= (1LL << _WHICH_BIT(b))) diff --git a/lib/librte_telemetry/rte_telemetry.h b/lib/librte_telemetry/rte_telemetry.h index f8e54dc68e..3ff3a42d78 100644 --- a/lib/librte_telemetry/rte_telemetry.h +++ b/lib/librte_telemetry/rte_telemetry.h @@ -292,6 +292,8 @@ __rte_experimental int rte_telemetry_register_cmd(const char *cmd, telemetry_cb fn, const char *help); +#ifdef RTE_HAS_CPUSET + /** * @internal * Initialize Telemetry. @@ -314,6 +316,8 @@ int rte_telemetry_init(const char *runtime_dir, rte_cpuset_t *cpuset, const char **err_str); +#endif /* RTE_HAS_CPUSET */ + /** * Get a pointer to a container with memory allocated. The container is to be * used embedded within an existing telemetry dict/array. From patchwork Sun Feb 28 12:53:41 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Monjalon X-Patchwork-Id: 88276 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 80384A0548; Sun, 28 Feb 2021 13:54:56 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 46B3522A294; Sun, 28 Feb 2021 13:54:12 +0100 (CET) Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) by mails.dpdk.org (Postfix) with ESMTP id F1E4722A29C; Sun, 28 Feb 2021 13:54:09 +0100 (CET) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id 9FFAC5C00C4; Sun, 28 Feb 2021 07:54:09 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Sun, 28 Feb 2021 07:54:09 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm3; bh=E0rcPQHIg33RF HPXZv9oLgv14gAKtY+2Hr+YilEpXxM=; b=Rb2mp5QCLx720qroeErhJibbovev3 oMMk+NmqZg33YIgIsd9GKju0SPSdFkwiDLCHRGGoKoNncemDv76Xgz++7MyfBQdF wom9iOIeyuAA1dD1SzHGhjThbknVFV2kP4ZFdRRJpB8Gf0QR/+VMGIf42hVvrzXK xrENodMkhqoIPgmativha68byLBprEXRF3JSHdfwVyfwmHxkRQP3O9U8zNI0+bY/ EoQMyGwLdR+5g/+L2dd7yB+IFh5L7UBwoIKJP5lJIqrngOCYM7IRd5AXPPEruPDX BuEysMzLupBF7iFYAYNn33N+hOxlcCapQtALdH1RghuRQs7M4Z53hTtfg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=E0rcPQHIg33RFHPXZv9oLgv14gAKtY+2Hr+YilEpXxM=; b=EdBOd3oM AnQ8Jwi175MgDS871ACnIbNOU2YAcMj1F/EFgf5St1rieg60oFpGHIt2TBclqanQ pdmQyj2GE/ans0NFk1Z1/kPpOHe9r3bIRtugkTIBi/rJ4Q87PMgS97OaOYHgACph vnTLkdSHNVe31jY6UEL+2KcJkT7WfKLuu880RKPLmLGe81Kjp3f+nfqmBPFmjyB+ V0aAuG14DLz5W73BL9E+2wC/mWBP8HYtgn9t9KleKUkPEP9oxp75j97edAzeGWS7 /49iJAiA3QBizLjlztq0M61JFrtq6Bj2N4mnwjGjFYuUq5tlDMnHCnrGMXYSo2PC +B/1I3hn7Po4ww== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrleeigdegkecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomhepvfhhohhmrghs ucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenucggtf frrghtthgvrhhnpedvhefgiedvjeegtdevheefhfetleefgfeivefgffevfeejgedtgfeu tdehtdegveenucfkphepjeejrddufeegrddvtdefrddukeegnecuvehluhhsthgvrhfuih iivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepthhhohhmrghssehmohhnjhgrlhho nhdrnhgvth X-ME-Proxy: Received: from xps.monjalon.net (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id 892E41080057; Sun, 28 Feb 2021 07:54:08 -0500 (EST) From: Thomas Monjalon To: dev@dpdk.org Cc: ncopa@alpinelinux.org, stable@dpdk.org, Hemant Agrawal , Sachin Saxena , Timothy McDaniel , Shreyansh Jain , Geoff Thorpe , Gage Eads Date: Sun, 28 Feb 2021 13:53:41 +0100 Message-Id: <20210228125353.2436562-7-thomas@monjalon.net> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210228125353.2436562-1-thomas@monjalon.net> References: <20190313170657.16688-1-ncopa@alpinelinux.org> <20210228125353.2436562-1-thomas@monjalon.net> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v6 06/17] drivers: fix header includes for musl 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 Sender: "dev" The header files argp.h and error.h do not exist in musl libc and are not needed in dpaa code. The header file fcntl.h should not be included from sys/ directory as done in dlb drivers, it is an error with musl libc. Fixes: 5b22cf744689 ("bus/dpaa: introducing FMan configurations") Fixes: 39f373cf015a ("bus/dpaa: add compatibility and helper macros") Fixes: 19980083fd57 ("event/dlb: add eventdev probe") Fixes: 5433956d5185 ("event/dlb2: add eventdev probe") Cc: stable@dpdk.org Signed-off-by: Thomas Monjalon --- drivers/bus/dpaa/include/netcfg.h | 1 - drivers/common/dpaax/compat.h | 1 - drivers/event/dlb/dlb.c | 2 +- drivers/event/dlb/pf/dlb_pf.c | 3 ++- drivers/event/dlb2/dlb2.c | 2 +- drivers/event/dlb2/pf/dlb2_pf.c | 3 ++- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/bus/dpaa/include/netcfg.h b/drivers/bus/dpaa/include/netcfg.h index d7d1befd24..bb18a34e3d 100644 --- a/drivers/bus/dpaa/include/netcfg.h +++ b/drivers/bus/dpaa/include/netcfg.h @@ -9,7 +9,6 @@ #define __NETCFG_H #include -#include /* Configuration information related to a specific ethernet port */ struct fm_eth_port_cfg { diff --git a/drivers/common/dpaax/compat.h b/drivers/common/dpaax/compat.h index c69e76ab96..7166f8cceb 100644 --- a/drivers/common/dpaax/compat.h +++ b/drivers/common/dpaax/compat.h @@ -30,7 +30,6 @@ #include #include #include -#include #include #include #include diff --git a/drivers/event/dlb/dlb.c b/drivers/event/dlb/dlb.c index 8b26d1d2d2..2fbfc6aed4 100644 --- a/drivers/event/dlb/dlb.c +++ b/drivers/event/dlb/dlb.c @@ -10,7 +10,7 @@ #include #include #include -#include +#include #include #include diff --git a/drivers/event/dlb/pf/dlb_pf.c b/drivers/event/dlb/pf/dlb_pf.c index 3aeef6f91d..876c68e51d 100644 --- a/drivers/event/dlb/pf/dlb_pf.c +++ b/drivers/event/dlb/pf/dlb_pf.c @@ -6,12 +6,13 @@ #include #include #include -#include +#include #include #include #include #include #include + #include #include #include diff --git a/drivers/event/dlb2/dlb2.c b/drivers/event/dlb2/dlb2.c index b28ec58bfb..fb5ff012a4 100644 --- a/drivers/event/dlb2/dlb2.c +++ b/drivers/event/dlb2/dlb2.c @@ -11,7 +11,7 @@ #include #include #include -#include +#include #include #include diff --git a/drivers/event/dlb2/pf/dlb2_pf.c b/drivers/event/dlb2/pf/dlb2_pf.c index 1a7d8fc294..b85fd3ec56 100644 --- a/drivers/event/dlb2/pf/dlb2_pf.c +++ b/drivers/event/dlb2/pf/dlb2_pf.c @@ -6,12 +6,13 @@ #include #include #include -#include +#include #include #include #include #include #include + #include #include #include From patchwork Sun Feb 28 12:53:42 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Monjalon X-Patchwork-Id: 88277 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 1712CA0548; Sun, 28 Feb 2021 13:55:04 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 89FA122A29D; Sun, 28 Feb 2021 13:54:14 +0100 (CET) Received: from new2-smtp.messagingengine.com (new2-smtp.messagingengine.com [66.111.4.224]) by mails.dpdk.org (Postfix) with ESMTP id 195EA22A29D for ; Sun, 28 Feb 2021 13:54:13 +0100 (CET) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailnew.nyi.internal (Postfix) with ESMTP id 692575800D9; Sun, 28 Feb 2021 07:54:12 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Sun, 28 Feb 2021 07:54:12 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm3; bh=8gpzf0Sjg0pFg z0tirn8khUVRosbgkJrdOOzJgHtKUA=; b=Oq6Ua77A2zm+ZRmTfX31x4Ayx/bBt 6oCa+8SqKHd4nNoeOYi6MVQrWiJHmjLS4UDk6vAI48RbAdmkESTUpcoBc3m2HXd/ YBKBW3aGlNPnawo8InT7kp/W5IjRwx6o/EGP8ZQGiImBXjr57inlKPdmEeff6RP5 Masq/YoX8IGYMFrxQ/YAtk7Xhoh8AukbGeSnWkBT+0w7HzMZeKK6H4FmEV1VrI1w nc8G4g+0u8xXCtPXC/q4wXStpAVWC4yrox+xXHfsTw4/KELn6QpXT019d6XKIXq4 n4G5nIIuEGyOM2/oISGPyNXuYSwDkk6snPR1vUKSqEpPhouYsQ9e/H6Ow== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=8gpzf0Sjg0pFgz0tirn8khUVRosbgkJrdOOzJgHtKUA=; b=ioL13El0 Fc+ds5t7Q1c5NMGpiMfw6t1gtGQrOcc55k/EYnFC+N4SSEyiP7M+c7XJP7QYtCZ0 9737z6XGomn+6Gwdbv4QnhUnYqeY4doNRTosfQ0n9ssXeSN4NwVW/0IZmqh7ICR5 04Tz6guHjM6X1+VGFw66jGgx0zFDObbw2K02+kkMkgfva5/a1AOyNVvbDjZCPiG2 TTh+tPI55GX/24MeZByfozQ0oNKMSkCoILjd3cEhiQkcWhHPEa9/51IUvu9usv7C 91bjsktZDz8ykpx1dEUlQLwoQ2ogvHwWPAAAn/XdfFjnNt/cZDQ5AsHd9s4Pool1 FSGWpGFsGm/9cw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrleeigdegkecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomhepvfhhohhmrghs ucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenucggtf frrghtthgvrhhnpeehfeeikeelfeeileejtddvheegjedvveefudefteeljeeftefhlefg ffdukedtueenucffohhmrghinhepphhmugdrnhgvthenucfkphepjeejrddufeegrddvtd efrddukeegnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhho mhepthhhohhmrghssehmohhnjhgrlhhonhdrnhgvth X-ME-Proxy: Received: from xps.monjalon.net (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id 735C01080057; Sun, 28 Feb 2021 07:54:10 -0500 (EST) From: Thomas Monjalon To: dev@dpdk.org Cc: ncopa@alpinelinux.org, Anatoly Burakov , Stephen Hemminger , Long Li , Jay Zhou , Timothy McDaniel , Rasesh Mody , Shahed Shaikh , Andrew Boyer , Maxime Coquelin , Chenbo Xia , Xiao Wang Date: Sun, 28 Feb 2021 13:53:42 +0100 Message-Id: <20210228125353.2436562-8-thomas@monjalon.net> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210228125353.2436562-1-thomas@monjalon.net> References: <20190313170657.16688-1-ncopa@alpinelinux.org> <20210228125353.2436562-1-thomas@monjalon.net> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v6 07/17] drivers: replace page size definitions with function 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 Sender: "dev" The page size is often retrieved from the macro PAGE_SIZE. If PAGE_SIZE is not defined, it is either using hard coded default, or getting the system value from the UNIX-only function sysconf(). Such definitions are replaced with the generic function rte_mem_page_size() defined for each supported OS. Removing PAGE_SIZE definitions will fix dlb drivers for musl libc, because #ifdef checks were missing, causing redefinition errors. Signed-off-by: Thomas Monjalon Acked-by: Andrew Boyer --- drivers/bus/pci/linux/pci_vfio.c | 9 ++------- drivers/bus/vmbus/linux/vmbus_uio.c | 4 ++-- drivers/bus/vmbus/private.h | 5 +---- drivers/bus/vmbus/rte_vmbus_reg.h | 2 +- drivers/bus/vmbus/vmbus_common_uio.c | 4 ++-- drivers/crypto/virtio/virtio_pci.h | 3 ++- drivers/event/dlb/dlb.c | 7 +++++-- drivers/event/dlb/dlb_priv.h | 2 -- drivers/event/dlb/pf/base/dlb_osdep.h | 2 +- drivers/event/dlb/pf/dlb_main.h | 5 +---- drivers/event/dlb/pf/dlb_pf.c | 10 ++++++---- drivers/event/dlb2/dlb2_priv.h | 2 -- drivers/event/dlb2/pf/base/dlb2_osdep.h | 2 +- drivers/event/dlb2/pf/dlb2_main.h | 5 +---- drivers/event/dlb2/pf/dlb2_pf.c | 8 ++++---- drivers/net/bnx2x/ecore_fw_defs.h | 18 ++++++++++++------ drivers/net/ionic/ionic_lif.c | 25 ++++++++++++++----------- drivers/net/ionic/ionic_main.c | 3 ++- drivers/net/ionic/ionic_osdep.h | 2 +- drivers/net/netvsc/hn_rndis.c | 12 ++++++------ drivers/net/netvsc/hn_rxtx.c | 10 ++++++---- drivers/net/netvsc/hn_var.h | 9 +++------ drivers/net/virtio/virtio.h | 2 +- drivers/net/virtio/virtio_ethdev.c | 6 +++--- drivers/net/virtio/virtio_ethdev.h | 4 ---- drivers/vdpa/ifc/ifcvf_vdpa.c | 17 +++++++---------- 26 files changed, 84 insertions(+), 94 deletions(-) diff --git a/drivers/bus/pci/linux/pci_vfio.c b/drivers/bus/pci/linux/pci_vfio.c index e3f7b6abeb..9d689d6fd9 100644 --- a/drivers/bus/pci/linux/pci_vfio.c +++ b/drivers/bus/pci/linux/pci_vfio.c @@ -38,11 +38,6 @@ #ifdef VFIO_PRESENT -#ifndef PAGE_SIZE -#define PAGE_SIZE (sysconf(_SC_PAGESIZE)) -#endif -#define PAGE_MASK (~(PAGE_SIZE - 1)) - static struct rte_tailq_elem rte_vfio_tailq = { .name = "VFIO_RESOURCE_LIST", }; @@ -507,8 +502,8 @@ pci_vfio_mmap_bar(int vfio_dev_fd, struct mapped_pci_resource *vfio_res, */ uint32_t table_start = msix_table->offset; uint32_t table_end = table_start + msix_table->size; - table_end = RTE_ALIGN(table_end, PAGE_SIZE); - table_start = RTE_ALIGN_FLOOR(table_start, PAGE_SIZE); + table_end = RTE_ALIGN(table_end, rte_mem_page_size()); + table_start = RTE_ALIGN_FLOOR(table_start, rte_mem_page_size()); /* If page-aligned start of MSI-X table is less than the * actual MSI-X table start address, reassign to the actual diff --git a/drivers/bus/vmbus/linux/vmbus_uio.c b/drivers/bus/vmbus/linux/vmbus_uio.c index 5dc0c47de6..b52ca5bf1d 100644 --- a/drivers/bus/vmbus/linux/vmbus_uio.c +++ b/drivers/bus/vmbus/linux/vmbus_uio.c @@ -154,7 +154,7 @@ vmbus_uio_map_resource_by_index(struct rte_vmbus_device *dev, int idx, vmbus_map_addr = vmbus_find_max_end_va(); /* offset is special in uio it indicates which resource */ - offset = idx * PAGE_SIZE; + offset = idx * rte_mem_page_size(); mapaddr = vmbus_map_resource(vmbus_map_addr, fd, offset, size, flags); close(fd); @@ -224,7 +224,7 @@ static int vmbus_uio_map_subchan(const struct rte_vmbus_device *dev, } file_size = sb.st_size; - if (file_size == 0 || (file_size & (PAGE_SIZE - 1))) { + if (file_size == 0 || (file_size & (rte_mem_page_size() - 1))) { VMBUS_LOG(ERR, "incorrect size %s: %zu", ring_path, file_size); diff --git a/drivers/bus/vmbus/private.h b/drivers/bus/vmbus/private.h index f19b14e4a6..528d60a42f 100644 --- a/drivers/bus/vmbus/private.h +++ b/drivers/bus/vmbus/private.h @@ -9,13 +9,10 @@ #include #include #include +#include #include #include -#ifndef PAGE_SIZE -#define PAGE_SIZE 4096 -#endif - extern struct rte_vmbus_bus rte_vmbus_bus; extern int vmbus_logtype_bus; diff --git a/drivers/bus/vmbus/rte_vmbus_reg.h b/drivers/bus/vmbus/rte_vmbus_reg.h index f5a0693dcb..8562672979 100644 --- a/drivers/bus/vmbus/rte_vmbus_reg.h +++ b/drivers/bus/vmbus/rte_vmbus_reg.h @@ -100,7 +100,7 @@ struct vmbus_bufring { uint32_t value; } feature_bits; - /* Pad it to PAGE_SIZE so that data starts on page boundary */ + /* Pad it to rte_mem_page_size() so that data starts on page boundary */ uint8_t reserved2[4028]; /* diff --git a/drivers/bus/vmbus/vmbus_common_uio.c b/drivers/bus/vmbus/vmbus_common_uio.c index a689bf11b3..8582e32c1d 100644 --- a/drivers/bus/vmbus/vmbus_common_uio.c +++ b/drivers/bus/vmbus/vmbus_common_uio.c @@ -63,7 +63,7 @@ vmbus_uio_map_secondary(struct rte_vmbus_device *dev) for (i = 0; i != uio_res->nb_maps; i++) { void *mapaddr; - off_t offset = i * PAGE_SIZE; + off_t offset = i * rte_mem_page_size(); mapaddr = vmbus_map_resource(uio_res->maps[i].addr, fd, offset, @@ -175,7 +175,7 @@ vmbus_uio_map_resource(struct rte_vmbus_device *dev) } dev->int_page = (uint32_t *)((char *)uio_res->maps[HV_INT_PAGE_MAP].addr - + (PAGE_SIZE >> 1)); + + (rte_mem_page_size() >> 1)); dev->monitor_page = uio_res->maps[HV_MON_PAGE_MAP].addr; return 0; } diff --git a/drivers/crypto/virtio/virtio_pci.h b/drivers/crypto/virtio/virtio_pci.h index d9a214dfd0..0a7ea1bb64 100644 --- a/drivers/crypto/virtio/virtio_pci.h +++ b/drivers/crypto/virtio/virtio_pci.h @@ -7,6 +7,7 @@ #include +#include #include #include #include @@ -67,7 +68,7 @@ struct virtqueue; * * Note the sizeof(struct vring_desc) is 16 bytes. */ -#define VIRTIO_MAX_INDIRECT ((int) (PAGE_SIZE / 16)) +#define VIRTIO_MAX_INDIRECT ((int) (rte_mem_page_size() / 16)) /* Do we get callbacks when the ring is completely used, even if we've * suppressed them? diff --git a/drivers/event/dlb/dlb.c b/drivers/event/dlb/dlb.c index 2fbfc6aed4..60084ced3b 100644 --- a/drivers/event/dlb/dlb.c +++ b/drivers/event/dlb/dlb.c @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include @@ -991,7 +992,8 @@ dlb_hw_create_ldb_port(struct dlb_eventdev *dlb, goto error_exit; } - qm_port->pp_mmio_base = DLB_LDB_PP_BASE + PAGE_SIZE * qm_port_id; + qm_port->pp_mmio_base = DLB_LDB_PP_BASE + + rte_mem_page_size() * qm_port_id; qm_port->id = qm_port_id; /* The credit window is one high water mark of QEs */ @@ -1181,7 +1183,8 @@ dlb_hw_create_dir_port(struct dlb_eventdev *dlb, goto error_exit; } - qm_port->pp_mmio_base = DLB_DIR_PP_BASE + PAGE_SIZE * qm_port_id; + qm_port->pp_mmio_base = DLB_DIR_PP_BASE + + rte_mem_page_size() * qm_port_id; qm_port->id = qm_port_id; /* The credit window is one high water mark of QEs */ diff --git a/drivers/event/dlb/dlb_priv.h b/drivers/event/dlb/dlb_priv.h index 272e17482f..ca4d6a84cf 100644 --- a/drivers/event/dlb/dlb_priv.h +++ b/drivers/event/dlb/dlb_priv.h @@ -76,8 +76,6 @@ #define PP_BASE(is_dir) ((is_dir) ? DLB_DIR_PP_BASE : DLB_LDB_PP_BASE) -#define PAGE_SIZE (sysconf(_SC_PAGESIZE)) - #define DLB_NUM_QES_PER_CACHE_LINE 4 #define DLB_MAX_ENQUEUE_DEPTH 64 diff --git a/drivers/event/dlb/pf/base/dlb_osdep.h b/drivers/event/dlb/pf/base/dlb_osdep.h index 0c119b759a..dee20660ed 100644 --- a/drivers/event/dlb/pf/base/dlb_osdep.h +++ b/drivers/event/dlb/pf/base/dlb_osdep.h @@ -92,7 +92,7 @@ static inline void *os_map_producer_port(struct dlb_hw *hw, pp_dma_base = (uintptr_t)hw->func_kva + DLB_PP_BASE(is_ldb); - addr = (pp_dma_base + (PAGE_SIZE * port_id)); + addr = (pp_dma_base + (rte_mem_page_size() * port_id)); return (void *)(uintptr_t)addr; diff --git a/drivers/event/dlb/pf/dlb_main.h b/drivers/event/dlb/pf/dlb_main.h index 22e215223d..e66ba228d1 100644 --- a/drivers/event/dlb/pf/dlb_main.h +++ b/drivers/event/dlb/pf/dlb_main.h @@ -10,10 +10,7 @@ #include #include #include - -#ifndef PAGE_SIZE -#define PAGE_SIZE (sysconf(_SC_PAGESIZE)) -#endif +#include #include "base/dlb_hw_types.h" #include "../dlb_user.h" diff --git a/drivers/event/dlb/pf/dlb_pf.c b/drivers/event/dlb/pf/dlb_pf.c index 876c68e51d..5445c2d57d 100644 --- a/drivers/event/dlb/pf/dlb_pf.c +++ b/drivers/event/dlb/pf/dlb_pf.c @@ -304,7 +304,7 @@ dlb_pf_ldb_port_create(struct dlb_hw_dev *handle, alloc_sz = RTE_CACHE_LINE_ROUNDUP(alloc_sz); port_base = dlb_alloc_coherent_aligned(&mz, &pc_dma_base, - alloc_sz, PAGE_SIZE); + alloc_sz, rte_mem_page_size()); if (port_base == NULL) return -ENOMEM; @@ -329,7 +329,8 @@ dlb_pf_ldb_port_create(struct dlb_hw_dev *handle, pp_dma_base = (uintptr_t)dlb_dev->hw.func_kva + PP_BASE(is_dir); dlb_port[response.id][DLB_LDB].pp_addr = - (void *)(uintptr_t)(pp_dma_base + (PAGE_SIZE * response.id)); + (void *)(uintptr_t)(pp_dma_base + + (rte_mem_page_size() * response.id)); dlb_port[response.id][DLB_LDB].cq_base = (void *)(uintptr_t)(port_base + (2 * RTE_CACHE_LINE_SIZE)); @@ -382,7 +383,7 @@ dlb_pf_dir_port_create(struct dlb_hw_dev *handle, alloc_sz = RTE_CACHE_LINE_ROUNDUP(alloc_sz); port_base = dlb_alloc_coherent_aligned(&mz, &pc_dma_base, - alloc_sz, PAGE_SIZE); + alloc_sz, rte_mem_page_size()); if (port_base == NULL) return -ENOMEM; @@ -407,7 +408,8 @@ dlb_pf_dir_port_create(struct dlb_hw_dev *handle, pp_dma_base = (uintptr_t)dlb_dev->hw.func_kva + PP_BASE(is_dir); dlb_port[response.id][DLB_DIR].pp_addr = - (void *)(uintptr_t)(pp_dma_base + (PAGE_SIZE * response.id)); + (void *)(uintptr_t)(pp_dma_base + + (rte_mem_page_size() * response.id)); dlb_port[response.id][DLB_DIR].cq_base = (void *)(uintptr_t)(port_base + (2 * RTE_CACHE_LINE_SIZE)); diff --git a/drivers/event/dlb2/dlb2_priv.h b/drivers/event/dlb2/dlb2_priv.h index b73cf3ff14..eb1a932399 100644 --- a/drivers/event/dlb2/dlb2_priv.h +++ b/drivers/event/dlb2/dlb2_priv.h @@ -78,8 +78,6 @@ DLB2_LDB_CQ_MAX_SIZE) #define PP_BASE(is_dir) ((is_dir) ? DLB2_DIR_PP_BASE : DLB2_LDB_PP_BASE) -#define PAGE_SIZE (sysconf(_SC_PAGESIZE)) - #define DLB2_NUM_QES_PER_CACHE_LINE 4 #define DLB2_MAX_ENQUEUE_DEPTH 64 diff --git a/drivers/event/dlb2/pf/base/dlb2_osdep.h b/drivers/event/dlb2/pf/base/dlb2_osdep.h index c4c34eba5f..aa101a49a3 100644 --- a/drivers/event/dlb2/pf/base/dlb2_osdep.h +++ b/drivers/event/dlb2/pf/base/dlb2_osdep.h @@ -89,7 +89,7 @@ static inline void *os_map_producer_port(struct dlb2_hw *hw, uint64_t pp_dma_base; pp_dma_base = (uintptr_t)hw->func_kva + DLB2_PP_BASE(is_ldb); - addr = (pp_dma_base + (PAGE_SIZE * port_id)); + addr = (pp_dma_base + (rte_mem_page_size() * port_id)); return (void *)(uintptr_t)addr; } diff --git a/drivers/event/dlb2/pf/dlb2_main.h b/drivers/event/dlb2/pf/dlb2_main.h index f3bee71fb6..9eeda482a3 100644 --- a/drivers/event/dlb2/pf/dlb2_main.h +++ b/drivers/event/dlb2/pf/dlb2_main.h @@ -10,10 +10,7 @@ #include #include #include - -#ifndef PAGE_SIZE -#define PAGE_SIZE (sysconf(_SC_PAGESIZE)) -#endif +#include #include "base/dlb2_hw_types.h" #include "../dlb2_user.h" diff --git a/drivers/event/dlb2/pf/dlb2_pf.c b/drivers/event/dlb2/pf/dlb2_pf.c index b85fd3ec56..cfb22efe8a 100644 --- a/drivers/event/dlb2/pf/dlb2_pf.c +++ b/drivers/event/dlb2/pf/dlb2_pf.c @@ -285,7 +285,7 @@ dlb2_pf_ldb_port_create(struct dlb2_hw_dev *handle, alloc_sz = RTE_CACHE_LINE_ROUNDUP(alloc_sz); port_base = dlb2_alloc_coherent_aligned(&mz, &cq_base, alloc_sz, - PAGE_SIZE); + rte_mem_page_size()); if (port_base == NULL) return -ENOMEM; @@ -308,7 +308,7 @@ dlb2_pf_ldb_port_create(struct dlb2_hw_dev *handle, pp_base = (uintptr_t)dlb2_dev->hw.func_kva + PP_BASE(is_dir); dlb2_port[response.id][DLB2_LDB_PORT].pp_addr = - (void *)(pp_base + (PAGE_SIZE * response.id)); + (void *)(pp_base + (rte_mem_page_size() * response.id)); dlb2_port[response.id][DLB2_LDB_PORT].cq_base = (void *)(port_base); memset(&port_memory, 0, sizeof(port_memory)); @@ -360,7 +360,7 @@ dlb2_pf_dir_port_create(struct dlb2_hw_dev *handle, alloc_sz = RTE_CACHE_LINE_ROUNDUP(alloc_sz); port_base = dlb2_alloc_coherent_aligned(&mz, &cq_base, alloc_sz, - PAGE_SIZE); + rte_mem_page_size()); if (port_base == NULL) return -ENOMEM; @@ -383,7 +383,7 @@ dlb2_pf_dir_port_create(struct dlb2_hw_dev *handle, pp_base = (uintptr_t)dlb2_dev->hw.func_kva + PP_BASE(is_dir); dlb2_port[response.id][DLB2_DIR_PORT].pp_addr = - (void *)(pp_base + (PAGE_SIZE * response.id)); + (void *)(pp_base + (rte_mem_page_size() * response.id)); dlb2_port[response.id][DLB2_DIR_PORT].cq_base = (void *)(port_base); diff --git a/drivers/net/bnx2x/ecore_fw_defs.h b/drivers/net/bnx2x/ecore_fw_defs.h index 5397a701aa..93bca8ad33 100644 --- a/drivers/net/bnx2x/ecore_fw_defs.h +++ b/drivers/net/bnx2x/ecore_fw_defs.h @@ -13,6 +13,8 @@ #ifndef ECORE_FW_DEFS_H #define ECORE_FW_DEFS_H +#include + #define CSTORM_ASSERT_LIST_INDEX_OFFSET (IRO[152].base) #define CSTORM_ASSERT_LIST_OFFSET(assertListEntry) \ (IRO[151].base + ((assertListEntry) * IRO[151].m1)) @@ -252,7 +254,8 @@ #define X_ETH_LOCAL_RING_SIZE 13 #define FIRST_BD_IN_PKT 0 #define PARSE_BD_INDEX 1 -#define NUM_OF_ETH_BDS_IN_PAGE ((PAGE_SIZE)/(STRUCT_SIZE(eth_tx_bd)/8)) +#define NUM_OF_ETH_BDS_IN_PAGE \ + (rte_mem_page_size() / (STRUCT_SIZE(eth_tx_bd) / 8)) #define U_ETH_NUM_OF_SGES_TO_FETCH 8 #define U_ETH_MAX_SGES_FOR_PACKET 3 @@ -265,11 +268,14 @@ #define IP_HEADER_ALIGNMENT_PADDING 2 #define U_ETH_SGES_PER_PAGE_INVERSE_MASK \ - (0xFFFF - ((PAGE_SIZE/((STRUCT_SIZE(eth_rx_sge))/8))-1)) + (0xFFFF - ((rte_mem_page_size() / ((STRUCT_SIZE(eth_rx_sge)) / 8)) - 1)) -#define TU_ETH_CQES_PER_PAGE (PAGE_SIZE/(STRUCT_SIZE(eth_rx_cqe)/8)) -#define U_ETH_BDS_PER_PAGE (PAGE_SIZE/(STRUCT_SIZE(eth_rx_bd)/8)) -#define U_ETH_SGES_PER_PAGE (PAGE_SIZE/(STRUCT_SIZE(eth_rx_sge)/8)) +#define TU_ETH_CQES_PER_PAGE \ + (rte_mem_page_size() / (STRUCT_SIZE(eth_rx_cqe) / 8)) +#define U_ETH_BDS_PER_PAGE \ + (rte_mem_page_size() / (STRUCT_SIZE(eth_rx_bd) / 8)) +#define U_ETH_SGES_PER_PAGE \ + (rte_mem_page_size() / (STRUCT_SIZE(eth_rx_sge) / 8)) #define U_ETH_BDS_PER_PAGE_MASK (U_ETH_BDS_PER_PAGE-1) #define U_ETH_CQE_PER_PAGE_MASK (TU_ETH_CQES_PER_PAGE-1) @@ -396,7 +402,7 @@ /* Event Ring definitions */ #define C_ERES_PER_PAGE \ - (PAGE_SIZE / BITS_TO_BYTES(STRUCT_SIZE(event_ring_elem))) + (rte_mem_page_size() / BITS_TO_BYTES(STRUCT_SIZE(event_ring_elem))) #define C_ERE_PER_PAGE_MASK (C_ERES_PER_PAGE - 1) /* number of statistic command */ diff --git a/drivers/net/ionic/ionic_lif.c b/drivers/net/ionic/ionic_lif.c index e083f92417..395e5acc8b 100644 --- a/drivers/net/ionic/ionic_lif.c +++ b/drivers/net/ionic/ionic_lif.c @@ -617,18 +617,18 @@ ionic_qcq_alloc(struct ionic_lif *lif, uint8_t type, cq_size = num_descs * cq_desc_size; sg_size = num_descs * sg_desc_size; - total_size = RTE_ALIGN(q_size, PAGE_SIZE) + - RTE_ALIGN(cq_size, PAGE_SIZE); + total_size = RTE_ALIGN(q_size, rte_mem_page_size()) + + RTE_ALIGN(cq_size, rte_mem_page_size()); /* * Note: aligning q_size/cq_size is not enough due to cq_base address * aligning as q_base could be not aligned to the page. - * Adding PAGE_SIZE. + * Adding rte_mem_page_size(). */ - total_size += PAGE_SIZE; + total_size += rte_mem_page_size(); if (flags & IONIC_QCQ_F_SG) { - total_size += RTE_ALIGN(sg_size, PAGE_SIZE); - total_size += PAGE_SIZE; + total_size += RTE_ALIGN(sg_size, rte_mem_page_size()); + total_size += rte_mem_page_size(); } new = rte_zmalloc("ionic", sizeof(*new), 0); @@ -679,13 +679,16 @@ ionic_qcq_alloc(struct ionic_lif *lif, uint8_t type, q_base = new->base; q_base_pa = new->base_pa; - cq_base = (void *)RTE_ALIGN((uintptr_t)q_base + q_size, PAGE_SIZE); - cq_base_pa = RTE_ALIGN(q_base_pa + q_size, PAGE_SIZE); + cq_base = (void *)RTE_ALIGN((uintptr_t)q_base + q_size, + rte_mem_page_size()); + cq_base_pa = RTE_ALIGN(q_base_pa + q_size, + rte_mem_page_size()); if (flags & IONIC_QCQ_F_SG) { sg_base = (void *)RTE_ALIGN((uintptr_t)cq_base + cq_size, - PAGE_SIZE); - sg_base_pa = RTE_ALIGN(cq_base_pa + cq_size, PAGE_SIZE); + rte_mem_page_size()); + sg_base_pa = RTE_ALIGN(cq_base_pa + cq_size, + rte_mem_page_size()); ionic_q_sg_map(&new->q, sg_base, sg_base_pa); } @@ -975,7 +978,7 @@ ionic_lif_alloc(struct ionic_lif *lif) IONIC_PRINT(DEBUG, "Allocating Lif Info"); - lif->info_sz = RTE_ALIGN(sizeof(*lif->info), PAGE_SIZE); + lif->info_sz = RTE_ALIGN(sizeof(*lif->info), rte_mem_page_size()); lif->info_z = rte_eth_dma_zone_reserve(lif->eth_dev, "lif_info", 0 /* queue_idx*/, diff --git a/drivers/net/ionic/ionic_main.c b/drivers/net/ionic/ionic_main.c index 3f1a764888..3ee4999fa5 100644 --- a/drivers/net/ionic/ionic_main.c +++ b/drivers/net/ionic/ionic_main.c @@ -375,7 +375,8 @@ ionic_port_init(struct ionic_adapter *adapter) if (idev->port_info) return 0; - idev->port_info_sz = RTE_ALIGN(sizeof(*idev->port_info), PAGE_SIZE); + idev->port_info_sz = RTE_ALIGN(sizeof(*idev->port_info), + rte_mem_page_size()); snprintf(z_name, sizeof(z_name), "%s_port_%s_info", IONIC_DRV_NAME, adapter->name); diff --git a/drivers/net/ionic/ionic_osdep.h b/drivers/net/ionic/ionic_osdep.h index a6575c36b5..89ed106d11 100644 --- a/drivers/net/ionic/ionic_osdep.h +++ b/drivers/net/ionic/ionic_osdep.h @@ -17,6 +17,7 @@ #include #include #include +#include #include "ionic_logs.h" @@ -25,7 +26,6 @@ #ifndef PAGE_SHIFT #define PAGE_SHIFT 12 -#define PAGE_SIZE (1 << PAGE_SHIFT) #endif #define __iomem diff --git a/drivers/net/netvsc/hn_rndis.c b/drivers/net/netvsc/hn_rndis.c index e317539de7..e3f7e636d7 100644 --- a/drivers/net/netvsc/hn_rndis.c +++ b/drivers/net/netvsc/hn_rndis.c @@ -67,7 +67,7 @@ hn_rndis_rid(struct hn_data *hv) static void *hn_rndis_alloc(size_t size) { - return rte_zmalloc("RNDIS", size, PAGE_SIZE); + return rte_zmalloc("RNDIS", size, rte_mem_page_size()); } #ifdef RTE_LIBRTE_NETVSC_DEBUG_DUMP @@ -265,17 +265,17 @@ static int hn_nvs_send_rndis_ctrl(struct vmbus_channel *chan, return -EINVAL; } - if (unlikely(reqlen > PAGE_SIZE)) { + if (unlikely(reqlen > rte_mem_page_size())) { PMD_DRV_LOG(ERR, "RNDIS request %u greater than page size", reqlen); return -EINVAL; } - sg.page = addr / PAGE_SIZE; + sg.page = addr / rte_mem_page_size(); sg.ofs = addr & PAGE_MASK; sg.len = reqlen; - if (sg.ofs + reqlen > PAGE_SIZE) { + if (sg.ofs + reqlen > rte_mem_page_size()) { PMD_DRV_LOG(ERR, "RNDIS request crosses page boundary"); return -EINVAL; } @@ -479,7 +479,7 @@ hn_rndis_query(struct hn_data *hv, uint32_t oid, return -ENOMEM; comp_len = sizeof(*comp) + odlen; - comp = rte_zmalloc("QUERY", comp_len, PAGE_SIZE); + comp = rte_zmalloc("QUERY", comp_len, rte_mem_page_size()); if (!comp) { error = -ENOMEM; goto done; @@ -736,7 +736,7 @@ hn_rndis_set(struct hn_data *hv, uint32_t oid, const void *data, uint32_t dlen) int error; reqlen = sizeof(*req) + dlen; - req = rte_zmalloc("RNDIS_SET", reqlen, PAGE_SIZE); + req = rte_zmalloc("RNDIS_SET", reqlen, rte_mem_page_size()); if (!req) return -ENOMEM; diff --git a/drivers/net/netvsc/hn_rxtx.c b/drivers/net/netvsc/hn_rxtx.c index 0f4ef0100b..c6bf7cc132 100644 --- a/drivers/net/netvsc/hn_rxtx.c +++ b/drivers/net/netvsc/hn_rxtx.c @@ -1387,7 +1387,8 @@ static unsigned int hn_get_slots(const struct rte_mbuf *m) unsigned int size = rte_pktmbuf_data_len(m); unsigned int offs = rte_mbuf_data_iova(m) & PAGE_MASK; - slots += (offs + size + PAGE_SIZE - 1) / PAGE_SIZE; + slots += (offs + size + rte_mem_page_size() - 1) / + rte_mem_page_size(); m = m->next; } @@ -1402,12 +1403,13 @@ static unsigned int hn_fill_sg(struct vmbus_gpa *sg, while (m) { rte_iova_t addr = rte_mbuf_data_iova(m); - unsigned int page = addr / PAGE_SIZE; + unsigned int page = addr / rte_mem_page_size(); unsigned int offset = addr & PAGE_MASK; unsigned int len = rte_pktmbuf_data_len(m); while (len > 0) { - unsigned int bytes = RTE_MIN(len, PAGE_SIZE - offset); + unsigned int bytes = RTE_MIN(len, + rte_mem_page_size() - offset); sg[segs].page = page; sg[segs].ofs = offset; @@ -1450,7 +1452,7 @@ static int hn_xmit_sg(struct hn_tx_queue *txq, addr = txq->tx_rndis_iova + ((char *)txd->rndis_pkt - (char *)txq->tx_rndis); - sg[0].page = addr / PAGE_SIZE; + sg[0].page = addr / rte_mem_page_size(); sg[0].ofs = addr & PAGE_MASK; sg[0].len = RNDIS_PACKET_MSG_OFFSET_ABS(hn_rndis_pktlen(txd->rndis_pkt)); segs = 1; diff --git a/drivers/net/netvsc/hn_var.h b/drivers/net/netvsc/hn_var.h index b7405ca726..43642408bc 100644 --- a/drivers/net/netvsc/hn_var.h +++ b/drivers/net/netvsc/hn_var.h @@ -6,6 +6,8 @@ * All rights reserved. */ +#include + /* * Tunable ethdev params */ @@ -28,13 +30,8 @@ #define HN_RX_EXTMBUF_ENABLE 0 -/* Buffers need to be aligned */ -#ifndef PAGE_SIZE -#define PAGE_SIZE 4096 -#endif - #ifndef PAGE_MASK -#define PAGE_MASK (PAGE_SIZE - 1) +#define PAGE_MASK (rte_mem_page_size() - 1) #endif struct hn_data; diff --git a/drivers/net/virtio/virtio.h b/drivers/net/virtio/virtio.h index 21d54904e7..2c987d19ab 100644 --- a/drivers/net/virtio/virtio.h +++ b/drivers/net/virtio/virtio.h @@ -98,7 +98,7 @@ * * Note the sizeof(struct vring_desc) is 16 bytes. */ -#define VIRTIO_MAX_INDIRECT ((int)(PAGE_SIZE / 16)) +#define VIRTIO_MAX_INDIRECT ((int)(rte_mem_page_size() / 16)) /* * Maximum number of virtqueues per device. diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c index 333a5243a9..289b240c4e 100644 --- a/drivers/net/virtio/virtio_ethdev.c +++ b/drivers/net/virtio/virtio_ethdev.c @@ -21,8 +21,8 @@ #include #include #include - #include +#include #include #include #include @@ -469,7 +469,7 @@ virtio_init_queue(struct rte_eth_dev *dev, uint16_t queue_idx) sz_hdr_mz = vq_size * sizeof(struct virtio_tx_region); } else if (queue_type == VTNET_CQ) { /* Allocate a page for control vq command, data and status */ - sz_hdr_mz = PAGE_SIZE; + sz_hdr_mz = rte_mem_page_size(); } vq = rte_zmalloc_socket(vq_name, size, RTE_CACHE_LINE_SIZE, @@ -568,7 +568,7 @@ virtio_init_queue(struct rte_eth_dev *dev, uint16_t queue_idx) cvq->mz = mz; cvq->virtio_net_hdr_mz = hdr_mz; cvq->virtio_net_hdr_mem = hdr_mz->iova; - memset(cvq->virtio_net_hdr_mz->addr, 0, PAGE_SIZE); + memset(cvq->virtio_net_hdr_mz->addr, 0, rte_mem_page_size()); hw->cvq = cvq; } diff --git a/drivers/net/virtio/virtio_ethdev.h b/drivers/net/virtio/virtio_ethdev.h index 873327d989..5a501e7890 100644 --- a/drivers/net/virtio/virtio_ethdev.h +++ b/drivers/net/virtio/virtio_ethdev.h @@ -11,10 +11,6 @@ #include "virtio.h" -#ifndef PAGE_SIZE -#define PAGE_SIZE 4096 -#endif - #define VIRTIO_MAX_RX_QUEUES 128U #define VIRTIO_MAX_TX_QUEUES 128U #define VIRTIO_MAX_MAC_ADDRS 64 diff --git a/drivers/vdpa/ifc/ifcvf_vdpa.c b/drivers/vdpa/ifc/ifcvf_vdpa.c index 6a1b44bc77..39237aecf7 100644 --- a/drivers/vdpa/ifc/ifcvf_vdpa.c +++ b/drivers/vdpa/ifc/ifcvf_vdpa.c @@ -11,6 +11,7 @@ #include #include +#include #include #include #include @@ -30,10 +31,6 @@ RTE_LOG_REGISTER(ifcvf_vdpa_logtype, pmd.net.ifcvf_vdpa, NOTICE); rte_log(RTE_LOG_ ## level, ifcvf_vdpa_logtype, \ "IFCVF %s(): " fmt "\n", __func__, ##args) -#ifndef PAGE_SIZE -#define PAGE_SIZE 4096 -#endif - #define IFCVF_USED_RING_LEN(size) \ ((size) * sizeof(struct vring_used_elem) + sizeof(uint16_t) * 3) @@ -600,11 +597,11 @@ m_ifcvf_start(struct ifcvf_internal *internal) for (i = 0; i < nr_vring; i++) { rte_vhost_get_vhost_vring(vid, i, &vq); - size = RTE_ALIGN_CEIL(vring_size(vq.size, PAGE_SIZE), - PAGE_SIZE); - vring_buf = rte_zmalloc("ifcvf", size, PAGE_SIZE); + size = RTE_ALIGN_CEIL(vring_size(vq.size, rte_mem_page_size()), + rte_mem_page_size()); + vring_buf = rte_zmalloc("ifcvf", size, rte_mem_page_size()); vring_init(&internal->m_vring[i], vq.size, vring_buf, - PAGE_SIZE); + rte_mem_page_size()); ret = rte_vfio_container_dma_map(internal->vfio_container_fd, (uint64_t)(uintptr_t)vring_buf, m_vring_iova, size); @@ -686,8 +683,8 @@ m_ifcvf_stop(struct ifcvf_internal *internal) len = IFCVF_USED_RING_LEN(vq.size); rte_vhost_log_used_vring(vid, i, 0, len); - size = RTE_ALIGN_CEIL(vring_size(vq.size, PAGE_SIZE), - PAGE_SIZE); + size = RTE_ALIGN_CEIL(vring_size(vq.size, rte_mem_page_size()), + rte_mem_page_size()); rte_vfio_container_dma_unmap(internal->vfio_container_fd, (uint64_t)(uintptr_t)internal->m_vring[i].desc, m_vring_iova, size); From patchwork Sun Feb 28 12:53:43 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Monjalon X-Patchwork-Id: 88278 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 9AB8EA0548; Sun, 28 Feb 2021 13:55:16 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 47DC522A2AD; Sun, 28 Feb 2021 13:54:17 +0100 (CET) Received: from wout3-smtp.messagingengine.com (wout3-smtp.messagingengine.com [64.147.123.19]) by mails.dpdk.org (Postfix) with ESMTP id A369022A2A2; Sun, 28 Feb 2021 13:54:15 +0100 (CET) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.west.internal (Postfix) with ESMTP id 7B87D5D4; Sun, 28 Feb 2021 07:54:14 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Sun, 28 Feb 2021 07:54:14 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm3; bh=jkmR8jre9iG6r 4EPvIelfidmLMPcmV65reNxetXbfb0=; b=jF50Rt6MLilXok6ar2EwstAHWqBbr 1N+AY2dElKTD+BwJPZuzhEN6n0HJHBSNnfTzKkOXTxooEnoG0vb0NwjkPpe0uequ lOVSiTza7NXUdkXmSufEWvoE4xX1fKDCSVWyRfV23ktYD0d61fz2Y+cMlU/0BhxR 5UZTBOFiUc9XEk0THH5dCYc6FcdtZOBrGbjufPG4ApkFwlgdNmqHwhQ/VyHhay+t mVF6KP8CAj3fOaUgg8hzCAwRlacAiSa1jzfXEeL2AjV1i6rkm6cRlZDNgkXUzy9M kgyQd9wj1IdlzEfTPzbHtWgXgshfSFo+9GymHt60cbc7yD9IiWIB6j3iQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=jkmR8jre9iG6r4EPvIelfidmLMPcmV65reNxetXbfb0=; b=Z8uMlNO1 wXw7OQWJXbgVDKXLUrfPyMCb5IoF/CjdC1LUMoqVUum7XNTDtFuaAwU5z3w3wqCh UIL391O9Ll/TWbbrCpbx2tHUIrxpe/6WpFKnO2AO55YGugEaVsTPq6etLtOyL8kJ PBCSCqfl3qmzFhc0lu7pXsqAOE1EyUS5ceMCLT1wk0eE4XVKIWTtGv7e9eBFIfTU SZEX+9LIoBYxGrEvmikb7ZsWLkn3eijCQ33wxI9yrDNBZCXSGmvHY0iUjT/yQXiL +k3mS1589eBCn0BIbo4POybmijCl/8Z2u1VWLcpc8t2KmZ/iicgO4UfUNzYYI7Uo f4jnVYaGWgNA+A== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrleeigdegjecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomhepvfhhohhmrghs ucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenucggtf frrghtthgvrhhnpedvhefgiedvjeegtdevheefhfetleefgfeivefgffevfeejgedtgfeu tdehtdegveenucfkphepjeejrddufeegrddvtdefrddukeegnecuvehluhhsthgvrhfuih iivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepthhhohhmrghssehmohhnjhgrlhho nhdrnhgvth X-ME-Proxy: Received: from xps.monjalon.net (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id AC3CC1080057; Sun, 28 Feb 2021 07:54:12 -0500 (EST) From: Thomas Monjalon To: dev@dpdk.org Cc: ncopa@alpinelinux.org, stable@dpdk.org, Ferruh Yigit , Yuanhan Liu , David Marchand Date: Sun, 28 Feb 2021 13:53:43 +0100 Message-Id: <20210228125353.2436562-9-thomas@monjalon.net> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210228125353.2436562-1-thomas@monjalon.net> References: <20190313170657.16688-1-ncopa@alpinelinux.org> <20210228125353.2436562-1-thomas@monjalon.net> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v6 08/17] bus/pci: support I/O port operations with musl 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 Sender: "dev" From: Natanael Copa Add a fallback for non-GNU libc systems like musl libc for the non-standard functions outl_p, outw_p and outb_p. This solves the following buildtime errors when building with musl libc: pci_uio.c:(.text+0xaa1): undefined reference to `outw_p' pci_uio.c:(.text+0xac5): undefined reference to `outl_p' pci_uio.c:(.text+0xadf): undefined reference to `outb_p' The non-x86 case are handled with macros to factor out various ifdefs. Bugzilla ID: 35 Fixes: 756ce64b1ecd ("eal: introduce PCI ioport API") Cc: stable@dpdk.org Signed-off-by: Natanael Copa Signed-off-by: Thomas Monjalon --- drivers/bus/pci/linux/pci_uio.c | 91 ++++++++++++++++++++++----------- 1 file changed, 61 insertions(+), 30 deletions(-) diff --git a/drivers/bus/pci/linux/pci_uio.c b/drivers/bus/pci/linux/pci_uio.c index f3305a2f28..1294f505be 100644 --- a/drivers/bus/pci/linux/pci_uio.c +++ b/drivers/bus/pci/linux/pci_uio.c @@ -489,6 +489,16 @@ pci_uio_ioport_map(struct rte_pci_device *dev, int bar, } #endif +#ifdef RTE_ARCH_X86 +#define pci_uio_inl(reg) inl(reg) +#define pci_uio_inw(reg) inw(reg) +#define pci_uio_inb(reg) inb(reg) +#else /* !RTE_ARCH_X86 */ +#define pci_uio_inl(reg) (*(volatile uint32_t *)(reg)) +#define pci_uio_inw(reg) (*(volatile uint16_t *)(reg)) +#define pci_uio_inb(reg) (*(volatile uint8_t *)(reg)) +#endif + void pci_uio_ioport_read(struct rte_pci_ioport *p, void *data, size_t len, off_t offset) @@ -500,29 +510,62 @@ pci_uio_ioport_read(struct rte_pci_ioport *p, for (d = data; len > 0; d += size, reg += size, len -= size) { if (len >= 4) { size = 4; -#if defined(RTE_ARCH_X86) - *(uint32_t *)d = inl(reg); -#else - *(uint32_t *)d = *(volatile uint32_t *)reg; -#endif + *(uint32_t *)d = pci_uio_inl(reg); } else if (len >= 2) { size = 2; -#if defined(RTE_ARCH_X86) - *(uint16_t *)d = inw(reg); -#else - *(uint16_t *)d = *(volatile uint16_t *)reg; -#endif + *(uint16_t *)d = pci_uio_inw(reg); } else { size = 1; -#if defined(RTE_ARCH_X86) - *d = inb(reg); -#else - *d = *(volatile uint8_t *)reg; -#endif + *d = pci_uio_inb(reg); } } } +#ifdef RTE_ARCH_X86 +static inline void +pci_uio_outl_p(unsigned int value, unsigned short int port) +{ +#ifdef __GLIBC__ + outl_p(value, port); +#else + __asm__ __volatile__ ("outl %0,%w1\noutb %%al,$0x80" : : "a" (value), + "Nd" (port)); +#endif +} +#else /* !RTE_ARCH_X86 */ +#define pci_uio_outl_p(value, reg) (*(volatile uint32_t *)(reg) = (value)) +#endif + +#ifdef RTE_ARCH_X86 +static inline void +pci_uio_outw_p(unsigned short int value, unsigned short int port) +{ +#ifdef __GLIBC__ + outw_p(value, port); +#else + __asm__ __volatile__ ("outw %w0,%w1\noutb %%al,$0x80" : : "a" (value), + "Nd" (port)); +#endif +} +#else /* !RTE_ARCH_X86 */ +#define pci_uio_outw_p(value, reg) (*(volatile uint16_t *)(reg) = (value)) +#endif + +#ifdef RTE_ARCH_X86 +static inline void +pci_uio_outb_p(unsigned char value, unsigned short int port) +{ +#ifdef __GLIBC__ + outb_p(value, port); +#else + __asm__ __volatile__ ("outb %b0,%w1\noutb %%al,$0x80" : : "a" (value), + "Nd" (port)); +#endif +} +#else /* !RTE_ARCH_X86 */ +#define pci_uio_outb_p(value, reg) (*(volatile uint8_t *)(reg) = (value)) +#endif + void pci_uio_ioport_write(struct rte_pci_ioport *p, const void *data, size_t len, off_t offset) @@ -534,25 +577,13 @@ pci_uio_ioport_write(struct rte_pci_ioport *p, for (s = data; len > 0; s += size, reg += size, len -= size) { if (len >= 4) { size = 4; -#if defined(RTE_ARCH_X86) - outl_p(*(const uint32_t *)s, reg); -#else - *(volatile uint32_t *)reg = *(const uint32_t *)s; -#endif + pci_uio_outl_p(*(const uint32_t *)s, reg); } else if (len >= 2) { size = 2; -#if defined(RTE_ARCH_X86) - outw_p(*(const uint16_t *)s, reg); -#else - *(volatile uint16_t *)reg = *(const uint16_t *)s; -#endif + pci_uio_outw_p(*(const uint16_t *)s, reg); } else { size = 1; -#if defined(RTE_ARCH_X86) - outb_p(*s, reg); -#else - *(volatile uint8_t *)reg = *s; -#endif + pci_uio_outb_p(*s, reg); } } } From patchwork Sun Feb 28 12:53:44 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Monjalon X-Patchwork-Id: 88279 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 C1B49A0548; Sun, 28 Feb 2021 13:55:26 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C615A22A2BC; Sun, 28 Feb 2021 13:54:18 +0100 (CET) Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) by mails.dpdk.org (Postfix) with ESMTP id EDAEE22A2AD; Sun, 28 Feb 2021 13:54:15 +0100 (CET) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id 61B055C00C6; Sun, 28 Feb 2021 07:54:15 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Sun, 28 Feb 2021 07:54:15 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm3; bh=uKNtCLaRl165t 41Zw8dd6Y80pynR5lRv71HYgNtzFz4=; b=Wj4TxS8FJcLk8uwYSH19HVF6kbyQG oJVYYU7UT2uw/30Wmsiw3SCqCjxC0XBeer+jwJp7yaSG+9OqQefcWGjl36CcmeuJ KxkynJTLl7UekPgxQL7VuCMk7oz7eCscRHJcnwg/+GdDxvQqBPT4DXLR2xz1HfmI Xx+PO4qrKZBpftm9U4JvR1ii0KMM+xML1LMWNKhYUCvyO1ulsOUA2PJnRZSiWpe0 kEhgPwajgG30/mli2LPHGox0N2hojq1obAXUTdHAm4YVPvI0yJw8mXD2cI0qSD3y bMz9+WZPMtWFUZd6CfZWv16YFA/oFZ6S/buuVqaybxR61iJUq8Qu84eXA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=uKNtCLaRl165t41Zw8dd6Y80pynR5lRv71HYgNtzFz4=; b=sZ+YN88+ N3yFuX3n0rLdhM0pZ73HIy75QDvUOr0j83l2ND8hGHSsxe91g2ffTT4Al7UKouJk 2/n6Z/9uXBD1uajKOY1ZDTKU09wQ3CzuVxX+JOdilLehMJlL6pP98RGhCRf17n3c pTsAPK5Cl19XlJUmqBsjG143zO1UGEPAKINkJIGLS7DNUEQQQaxRmWnTA6LLFEVN BD2qg3vHrA0KA+CV4sdOx6wuZB5hzRYdcZ6fvynrJyYPqd+2yIdBbk0VE4avc32h lHKDiT9ox4EQROJSjmUD2yo+iuJLlCDRHoSi/fOijIaO71Ab/RdIKHcyIoJKdY6i lhYytbfmJBGKGw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrleeigdegkecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomhepvfhhohhmrghs ucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenucggtf frrghtthgvrhhnpedvhefgiedvjeegtdevheefhfetleefgfeivefgffevfeejgedtgfeu tdehtdegveenucfkphepjeejrddufeegrddvtdefrddukeegnecuvehluhhsthgvrhfuih iivgepudenucfrrghrrghmpehmrghilhhfrhhomhepthhhohhmrghssehmohhnjhgrlhho nhdrnhgvth X-ME-Proxy: Received: from xps.monjalon.net (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id 611461080059; Sun, 28 Feb 2021 07:54:14 -0500 (EST) From: Thomas Monjalon To: dev@dpdk.org Cc: ncopa@alpinelinux.org, stable@dpdk.org, Hemant Agrawal , Sachin Saxena , Shreyansh Jain , Geoff Thorpe , Roy Pledge Date: Sun, 28 Feb 2021 13:53:44 +0100 Message-Id: <20210228125353.2436562-10-thomas@monjalon.net> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210228125353.2436562-1-thomas@monjalon.net> References: <20190313170657.16688-1-ncopa@alpinelinux.org> <20210228125353.2436562-1-thomas@monjalon.net> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v6 09/17] bus/dpaa: fix 64-bit arch detection 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 Sender: "dev" From: Natanael Copa There is no standard saying that __WORDSIZE should be be defined or in what include it should be defined. Use RTE_ARCH_64 instead. This solves a warning when building with musl libc: warning: "__WORDSIZE" is not defined, evaluates to 0 [-Wundef] Fixes: 847ee3bd0d1f ("bus/dpaa: support FMAN frame queue lookup") Cc: stable@dpdk.org Signed-off-by: Natanael Copa --- drivers/bus/dpaa/include/fsl_qman.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/bus/dpaa/include/fsl_qman.h b/drivers/bus/dpaa/include/fsl_qman.h index 10212f0fd5..7ef2f3b2e3 100644 --- a/drivers/bus/dpaa/include/fsl_qman.h +++ b/drivers/bus/dpaa/include/fsl_qman.h @@ -16,7 +16,7 @@ extern "C" { #include /* FQ lookups (turn this on for 64bit user-space) */ -#if (__WORDSIZE == 64) +#ifdef RTE_ARCH_64 #define CONFIG_FSL_QMAN_FQ_LOOKUP /* if FQ lookups are supported, this controls the number of initialised, * s/w-consumed FQs that can be supported at any one time. From patchwork Sun Feb 28 12:53:45 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Monjalon X-Patchwork-Id: 88280 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 B95AAA0548; Sun, 28 Feb 2021 13:55:34 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id F0E9022A2BF; Sun, 28 Feb 2021 13:54:19 +0100 (CET) Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) by mails.dpdk.org (Postfix) with ESMTP id BBEB422A2BA; Sun, 28 Feb 2021 13:54:17 +0100 (CET) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id 609315C00C9; Sun, 28 Feb 2021 07:54:17 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Sun, 28 Feb 2021 07:54:17 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm3; bh=IR1dKuuMKcYmm GI8peHQqf42UQkAyb1clGQvXz1wfGk=; b=PeNKbQEC1+quxvMZB+iUCHxDQSzQk YtshoUTEVzH1HDvPr0ycD2zhrBcWC5JE9Se+xQXbLAPBNut7HkvS6ql4BwJUkUlM 1hAhmXBZikQAUPCh7hbNwxv2gIoUCcjSzwkTvOI8nO7YoaCMqjfOgqWR5UgUwcAb zDNw8qLk2NhPSLLfW6lxv6aFQRZJ06SKQzLlUYn5t5mXaqqV+jOe6mKDlDsKntxV bcJXs4H6LF0ef2vnujQQeMtnu9IGB9Ayg/yOMLVyxA0UUJMk0qPzN/W57a9q9FNv 9tfYPSd7JHslk8mILPq8atk5bdvHgO38hLN9SRjkdHuAX2qs3xPehE3jQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=IR1dKuuMKcYmmGI8peHQqf42UQkAyb1clGQvXz1wfGk=; b=QnXSe8K3 UcsmM0KPN31OnGTWLr6oLIIMkiPhL4NJenW6lYrHy6TuVi5CPGvCDRWpiHVP21Ba FQAd8tMfc9m5H5rBybnKrr9qK6OLzsp4MK3Qo9vX9qHkv3k5vzZwr+qPzHRXQZoK 3+O45Elb7GRf+V8RwP8ZO72kKopJ61WM6LSTwsov6JsumQEXjTDW1gIihDnhNpeS TxgUfQKTddFZ91sNSi7eNJ+4qGjIyw8CVl5ZT+pLl38/wypu7xnruGiukRJUQNjg v1kK+5YyeaolCaYVBk8PsCxuXXGonNK7Ur2Qhbtt4pbN7uDhMMjkd8BDvZ9jxA+g 803Whs46OGrUFQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrleeigdegkecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomhepvfhhohhmrghs ucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenucggtf frrghtthgvrhhnpedvhefgiedvjeegtdevheefhfetleefgfeivefgffevfeejgedtgfeu tdehtdegveenucfkphepjeejrddufeegrddvtdefrddukeegnecuvehluhhsthgvrhfuih iivgepudenucfrrghrrghmpehmrghilhhfrhhomhepthhhohhmrghssehmohhnjhgrlhho nhdrnhgvth X-ME-Proxy: Received: from xps.monjalon.net (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id 5CB091080054; Sun, 28 Feb 2021 07:54:16 -0500 (EST) From: Thomas Monjalon To: dev@dpdk.org Cc: ncopa@alpinelinux.org, stable@dpdk.org, Hemant Agrawal , Sachin Saxena , Geoff Thorpe , Shreyansh Jain , Roy Pledge Date: Sun, 28 Feb 2021 13:53:45 +0100 Message-Id: <20210228125353.2436562-11-thomas@monjalon.net> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210228125353.2436562-1-thomas@monjalon.net> References: <20190313170657.16688-1-ncopa@alpinelinux.org> <20210228125353.2436562-1-thomas@monjalon.net> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v6 10/17] bus/dpaa: fix build with musl 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 Sender: "dev" From: Natanael Copa Fix build with musl libc by using warn(3) instead of using the GNU specific error(3). `error(0, errno, ...)` is identical to `warn(...)` so replace: error(0, ret, ...); with the identical: errno = ret; warn(...); We could have used the identical `warnx("...: %s", strerror(ret))` but strerror(3) is not thread-safe and the strerror_r variant has two incompatible versions, one GNU specific and one XSI-compliant. Avoid the mess by letting `warn` use the thread-local errno. This also fixes error message for kzmalloc failures which previously would always have given "Unknown error -1", since that is what strerror(-1) returns. Let 'warn' use the proper error message from errno which is set by kzalloc. Fixes: 9d32ef0f5d61 ("bus/dpaa: support creating dynamic HW portal") Fixes: f09ede6c8fd1 ("bus/dpaa: add BMAN driver core") Fixes: 5b22cf744689 ("bus/dpaa: introducing FMan configurations") Cc: stable@dpdk.org Signed-off-by: Natanael Copa --- drivers/bus/dpaa/base/fman/netcfg_layer.c | 4 ++-- drivers/bus/dpaa/base/qbman/bman_driver.c | 13 +++++++++---- drivers/bus/dpaa/base/qbman/qman_driver.c | 17 ++++++++++++----- 3 files changed, 23 insertions(+), 11 deletions(-) diff --git a/drivers/bus/dpaa/base/fman/netcfg_layer.c b/drivers/bus/dpaa/base/fman/netcfg_layer.c index b7009f2299..bcedbaf68f 100644 --- a/drivers/bus/dpaa/base/fman/netcfg_layer.c +++ b/drivers/bus/dpaa/base/fman/netcfg_layer.c @@ -8,7 +8,7 @@ #include #include #include -#include +#include #include #include #include @@ -90,7 +90,7 @@ netcfg_acquire(void) */ skfd = socket(AF_PACKET, SOCK_RAW, 0); if (unlikely(skfd < 0)) { - error(0, errno, "%s(): open(SOCK_RAW)", __func__); + warn("%s(): open(SOCK_RAW)", __func__); return NULL; } diff --git a/drivers/bus/dpaa/base/qbman/bman_driver.c b/drivers/bus/dpaa/base/qbman/bman_driver.c index 750b756b93..c0b9e3da77 100644 --- a/drivers/bus/dpaa/base/qbman/bman_driver.c +++ b/drivers/bus/dpaa/base/qbman/bman_driver.c @@ -11,6 +11,7 @@ #include #include "bman_priv.h" #include +#include /* * Global variables of the max portal/pool number this bman version supported @@ -40,7 +41,8 @@ static int fsl_bman_portal_init(uint32_t idx, int is_shared) ret = pthread_getaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset); if (ret) { - error(0, ret, "pthread_getaffinity_np()"); + errno = ret; + warn("pthread_getaffinity_np()"); return ret; } pcfg.cpu = -1; @@ -60,7 +62,8 @@ static int fsl_bman_portal_init(uint32_t idx, int is_shared) map.index = idx; ret = process_portal_map(&map); if (ret) { - error(0, ret, "process_portal_map()"); + errno = ret; + warn("process_portal_map()"); return ret; } /* Make the portal's cache-[enabled|inhibited] regions */ @@ -104,8 +107,10 @@ static int fsl_bman_portal_finish(void) cfg = bman_destroy_affine_portal(); DPAA_BUG_ON(cfg != &pcfg); ret = process_portal_unmap(&map.addr); - if (ret) - error(0, ret, "process_portal_unmap()"); + if (ret) { + errno = ret; + warn("process_portal_unmap()"); + } return ret; } diff --git a/drivers/bus/dpaa/base/qbman/qman_driver.c b/drivers/bus/dpaa/base/qbman/qman_driver.c index 6d9aaff164..93375d1ea8 100644 --- a/drivers/bus/dpaa/base/qbman/qman_driver.c +++ b/drivers/bus/dpaa/base/qbman/qman_driver.c @@ -9,6 +9,8 @@ #include #include "qman_priv.h" #include +#include + #include /* Global variable containing revision id (even on non-control plane systems @@ -50,7 +52,8 @@ static int fsl_qman_portal_init(uint32_t index, int is_shared) map.index = index; ret = process_portal_map(&map); if (ret) { - error(0, ret, "process_portal_map()"); + errno = ret; + warn("process_portal_map()"); return ret; } qpcfg.channel = map.channel; @@ -96,8 +99,10 @@ static int fsl_qman_portal_finish(void) cfg = qman_destroy_affine_portal(NULL); DPAA_BUG_ON(cfg != &qpcfg); ret = process_portal_unmap(&map.addr); - if (ret) - error(0, ret, "process_portal_unmap()"); + if (ret) { + errno = ret; + warn("process_portal_unmap()"); + } return ret; } @@ -146,7 +151,8 @@ struct qman_portal *fsl_qman_fq_portal_create(int *fd) q_pcfg = kzalloc((sizeof(struct qm_portal_config)), 0); if (!q_pcfg) { - error(0, -1, "q_pcfg kzalloc failed"); + /* kzalloc sets errno */ + warn("q_pcfg kzalloc failed"); return NULL; } @@ -155,7 +161,8 @@ struct qman_portal *fsl_qman_fq_portal_create(int *fd) q_map.index = QBMAN_ANY_PORTAL_IDX; ret = process_portal_map(&q_map); if (ret) { - error(0, ret, "process_portal_map()"); + errno = ret; + warn("process_portal_map()"); kfree(q_pcfg); return NULL; } From patchwork Sun Feb 28 12:53:46 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Monjalon X-Patchwork-Id: 88281 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 843BBA0548; Sun, 28 Feb 2021 13:55:44 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 734BE22A2CF; Sun, 28 Feb 2021 13:54:21 +0100 (CET) Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) by mails.dpdk.org (Postfix) with ESMTP id 5BFBF22A2A6; Sun, 28 Feb 2021 13:54:19 +0100 (CET) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id 0A3915C00C5; Sun, 28 Feb 2021 07:54:19 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Sun, 28 Feb 2021 07:54:19 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm3; bh=uISwnISfojzlS LUnfcyj5Tg8cxHN5puaGHRGdYqwvsY=; b=YYEmmLj1Ys2XkJQQxwXc04mcr0SQn EZ2pdjNYgVoGxs+OlnTBxZL/F/Lf3etalPcZTMYg8Bgck500sb81eFPYU4OxWOka Nhmq5rRPC9IVidhV60UnO3GmvynPo37YpsQXH5xgSbI8LQ/Q5DfkjiW8e6Ch/dAj 4vZWfZ6IlPdQ0eSsu2pysJVfKvGsDAH0oup73IBblpZ2DPLwmdRGnvju43O/DflI I3lMaJr2aRgnPe75KNyJPepfvWOFclC4yC/mmqE8oxr0NzEpTVksCLakIoKwfysr g/gk0wAFAcHKt8Uec/8GsSfwoAGA5Wu6gc5pkGgtH9AJEq1LUY/+AdGYg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=uISwnISfojzlSLUnfcyj5Tg8cxHN5puaGHRGdYqwvsY=; b=TGNQYkiF Si5kwkpjavYus/d58y4kCveY57RHHMwDyQaOCHM8+tMmgEk4Z5VcuVevirN/xL4O kT45tEFKM3dqNjUv7HjLHdTm8oVIMLzkcr9gMh7yePNWtCFPsePzozAhX2eWCjfY r8KeDsFWE3RhTjioS+pmXlIbh7Py568HezZa33KIgQfqEkw5pQjTqFVhnKQdsXiY UJkSiEFTX0LOY+cIMxhkgXWJ4HpqJ89PMzrDnajPGgrLx9S/MVc0cF/f6e497YDf +bsjtpjVKQ4pt4FMRIG2k4/J/b63+aS8zD8/0jyA6iv5wK6NByBkz1N/JgjT2Thh JMbmdkdbr/4OIA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrleeigdegkecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomhepvfhhohhmrghs ucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenucggtf frrghtthgvrhhnpedvhefgiedvjeegtdevheefhfetleefgfeivefgffevfeejgedtgfeu tdehtdegveenucfkphepjeejrddufeegrddvtdefrddukeegnecuvehluhhsthgvrhfuih iivgepudenucfrrghrrghmpehmrghilhhfrhhomhepthhhohhmrghssehmohhnjhgrlhho nhdrnhgvth X-ME-Proxy: Received: from xps.monjalon.net (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id 1D26A1080054; Sun, 28 Feb 2021 07:54:18 -0500 (EST) From: Thomas Monjalon To: dev@dpdk.org Cc: ncopa@alpinelinux.org, stable@dpdk.org, Hemant Agrawal , Sachin Saxena , Akhil Goyal , Horia Geanta Neag Date: Sun, 28 Feb 2021 13:53:46 +0100 Message-Id: <20210228125353.2436562-12-thomas@monjalon.net> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210228125353.2436562-1-thomas@monjalon.net> References: <20190313170657.16688-1-ncopa@alpinelinux.org> <20210228125353.2436562-1-thomas@monjalon.net> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v6 11/17] common/dpaax/caamflib: fix build with musl 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 Sender: "dev" From: Natanael Copa The swab16/swab32/swab64 are Linux specific and not GNU libc specific. Keep the check for __GLIBC__ just in case other GNU systems depends on this (Hurd or GNU/kFreeBSD). This fixes a build error with musl libc. Fixes: 04711d41a872 ("crypto/dpaa2_sec: add run-time assembler for descriptor") Cc: stable@dpdk.org Signed-off-by: Natanael Copa Acked-by: Hemant Agrawal Signed-off-by: Thomas Monjalon --- drivers/common/dpaax/caamflib/compat.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/common/dpaax/caamflib/compat.h b/drivers/common/dpaax/caamflib/compat.h index 36ee4b5335..c1a693498d 100644 --- a/drivers/common/dpaax/caamflib/compat.h +++ b/drivers/common/dpaax/caamflib/compat.h @@ -11,7 +11,7 @@ #include #include -#ifdef __GLIBC__ +#ifdef RTE_EXEC_ENV_LINUX #include #include #include @@ -24,7 +24,7 @@ #error "Undefined endianness" #endif -#else +#else /* !RTE_EXEC_ENV_LINUX */ #error Environment not supported! #endif @@ -40,7 +40,7 @@ #define __maybe_unused __rte_unused #endif -#if defined(__GLIBC__) && !defined(pr_debug) +#if !defined(pr_debug) #if !defined(SUPPRESS_PRINTS) && defined(RTA_DEBUG) #define pr_debug(fmt, ...) \ RTE_LOG(DEBUG, PMD, "%s(): " fmt "\n", __func__, ##__VA_ARGS__) @@ -49,7 +49,7 @@ #endif #endif /* pr_debug */ -#if defined(__GLIBC__) && !defined(pr_err) +#if !defined(pr_err) #if !defined(SUPPRESS_PRINTS) #define pr_err(fmt, ...) \ RTE_LOG(ERR, PMD, "%s(): " fmt "\n", __func__, ##__VA_ARGS__) @@ -58,7 +58,7 @@ #endif #endif /* pr_err */ -#if defined(__GLIBC__) && !defined(pr_warn) +#if !defined(pr_warn) #if !defined(SUPPRESS_PRINTS) #define pr_warn(fmt, ...) \ RTE_LOG(WARNING, PMD, "%s(): " fmt "\n", __func__, ##__VA_ARGS__) @@ -101,7 +101,7 @@ #endif /* Use Linux naming convention */ -#ifdef __GLIBC__ +#if defined(RTE_EXEC_ENV_LINUX) || defined(__GLIBC__) #define swab16(x) rte_bswap16(x) #define swab32(x) rte_bswap32(x) #define swab64(x) rte_bswap64(x) From patchwork Sun Feb 28 12:53:47 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Monjalon X-Patchwork-Id: 88282 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 6186DA0548; Sun, 28 Feb 2021 13:55:53 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B5C6822A2D4; Sun, 28 Feb 2021 13:54:22 +0100 (CET) Received: from wout3-smtp.messagingengine.com (wout3-smtp.messagingengine.com [64.147.123.19]) by mails.dpdk.org (Postfix) with ESMTP id DCA2922A2C3 for ; Sun, 28 Feb 2021 13:54:21 +0100 (CET) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.west.internal (Postfix) with ESMTP id D6DBD5D4; Sun, 28 Feb 2021 07:54:20 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Sun, 28 Feb 2021 07:54:21 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm3; bh=G1oqJfYuTS5fo +2YaxQNIcDkIeLpWlAW0XoBux5ubVE=; b=tP4hzNQ8U/l/7BRmREO0KMp3kx2Ba WPmm0tQ8KdE9dasJRnCxOjWxYFbWuAgByB6BaLfd01mvoB4T3J+Wnv+AfZmrwd6S SOtAGU10gAOGbP8BXNybGCalLU0DYNsibidRMEKh27amx+ZrJGpUbmVKNgf0sHS8 jIL0zxy6s7vWS2YkVaDisk/f3Tue7AhhvwlexMgWxmnxnBdMfH50VUsfatsd/eKx WNmGRp38Iv1I8t1h5JqRV25fHwK+FXVRQo0Fbd12Sp+L1jZIVLFtPupr72pLpYpw JJyjwIY50/00Ohjno1vSCwZLwWMJiGuXMP1cSuVYPFiG2O/Lp4w2zD8iA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=G1oqJfYuTS5fo+2YaxQNIcDkIeLpWlAW0XoBux5ubVE=; b=l+IkfDEP XXekLBkFfEH7m/2fAjI/hT+AgXLbZU1WVpr1xqMup9gewEL18qD756ZoEwJjYJrR mShk0ug8yqAXnJGyirbyrZdPi21kXF/MHgaiTMBEiaYuk1n4Q1UahlMSA445FDXn +/vfmsMS5zhFC8R082w9YxX5WFODnvjuO1LsTtBnGUic3iV+ddYo1xNlqOxxlLXm bUHuTk4KibGnnj5KtWgUQrQ1JPTGJoqDhHCDOboSWrzdYGNyX7k/+Y9MabCCErSS hg06Jb6ghuZbC5XWmkYZE0jniPrca1TIjh7vddF7AvDallpEQfOXVXJvr9i0oTP3 8x8x/tifvqnVug== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrleeigdegkecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomhepvfhhohhmrghs ucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenucggtf frrghtthgvrhhnpedvhefgiedvjeegtdevheefhfetleefgfeivefgffevfeejgedtgfeu tdehtdegveenucfkphepjeejrddufeegrddvtdefrddukeegnecuvehluhhsthgvrhfuih iivgepgeenucfrrghrrghmpehmrghilhhfrhhomhepthhhohhmrghssehmohhnjhgrlhho nhdrnhgvth X-ME-Proxy: Received: from xps.monjalon.net (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id D40EE1080054; Sun, 28 Feb 2021 07:54:19 -0500 (EST) From: Thomas Monjalon To: dev@dpdk.org Cc: ncopa@alpinelinux.org, Hemant Agrawal , Sachin Saxena Date: Sun, 28 Feb 2021 13:53:47 +0100 Message-Id: <20210228125353.2436562-13-thomas@monjalon.net> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210228125353.2436562-1-thomas@monjalon.net> References: <20190313170657.16688-1-ncopa@alpinelinux.org> <20210228125353.2436562-1-thomas@monjalon.net> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v6 12/17] common/dpaax/caamflib: simplify log macros 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 Sender: "dev" From: Natanael Copa Simplify pr_debug, pr_err and pr_warn macros by adding an intermediate pr_msg macro. This way we only need to test for SUPPRESS_PRINTS once. Signed-off-by: Natanael Copa Acked-by: Hemant Agrawal --- drivers/common/dpaax/caamflib/compat.h | 28 +++++++++++--------------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/drivers/common/dpaax/caamflib/compat.h b/drivers/common/dpaax/caamflib/compat.h index c1a693498d..9776eed437 100644 --- a/drivers/common/dpaax/caamflib/compat.h +++ b/drivers/common/dpaax/caamflib/compat.h @@ -40,31 +40,27 @@ #define __maybe_unused __rte_unused #endif +#if defined(SUPPRESS_PRINTS) +#define pr_msg(l, fmt, ...) do { } while (0) +#else +#define pr_msg(l, fmt, ...) \ + RTE_LOG(l, PMD, "%s(): " fmt "\n", __func__, ##__VA_ARGS__) +#endif + #if !defined(pr_debug) -#if !defined(SUPPRESS_PRINTS) && defined(RTA_DEBUG) -#define pr_debug(fmt, ...) \ - RTE_LOG(DEBUG, PMD, "%s(): " fmt "\n", __func__, ##__VA_ARGS__) +#if defined(RTA_DEBUG) +#define pr_debug(fmt, ...) pr_msg(DEBUG, fmt, ##__VA_ARGS__) #else -#define pr_debug(fmt, ...) do { } while (0) +#define pr_debug(fmt, ...) do { } while (0) #endif #endif /* pr_debug */ #if !defined(pr_err) -#if !defined(SUPPRESS_PRINTS) -#define pr_err(fmt, ...) \ - RTE_LOG(ERR, PMD, "%s(): " fmt "\n", __func__, ##__VA_ARGS__) -#else -#define pr_err(fmt, ...) do { } while (0) -#endif +#define pr_err(fmt, ...) pr_msg(ERR, fmt, ##__VA_ARGS__) #endif /* pr_err */ #if !defined(pr_warn) -#if !defined(SUPPRESS_PRINTS) -#define pr_warn(fmt, ...) \ - RTE_LOG(WARNING, PMD, "%s(): " fmt "\n", __func__, ##__VA_ARGS__) -#else -#define pr_warn(fmt, ...) do { } while (0) -#endif +#define pr_warn(fmt, ...) pr_msg(WARNING, fmt, ##__VA_ARGS__) #endif /* pr_warn */ /** From patchwork Sun Feb 28 12:53:48 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Monjalon X-Patchwork-Id: 88283 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 0EC4AA0548; Sun, 28 Feb 2021 13:56:06 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7CF9922A2E0; Sun, 28 Feb 2021 13:54:25 +0100 (CET) Received: from wout3-smtp.messagingengine.com (wout3-smtp.messagingengine.com [64.147.123.19]) by mails.dpdk.org (Postfix) with ESMTP id 1735C22A2DA; Sun, 28 Feb 2021 13:54:24 +0100 (CET) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.west.internal (Postfix) with ESMTP id DD1E45BB; Sun, 28 Feb 2021 07:54:22 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Sun, 28 Feb 2021 07:54:23 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; s=fm3; bh= IlDdTuvU5XgBwC/k9le6XyTJJ6A3XNYsZn7ANfL+Ppw=; b=GsZ3Yc5NoRqWf0yc j8rtWb7x2muV4C47LxeJY31I5vuDl3fsblTROdTZisLgo0UEkb4qEMFsxFyxZxkU HIhod6/onv74PMgG1IT2Gq0fznlyQDrsGWeK7cpBgnYVLG5TkH8821KAg/p4Mros Satsml2ebE9J18l8GH1pC0LRjDBOUyXKsb63USwGmhi2NBymqZUFEkp2t71if/LG M6Qcpx2xO8R5cuG7wB1mhBBZFzBi0uenopScpAGZ0FB3+cG3zRFbN54rQC+3vu9b cQtU3ARntcIaM1PQiHP643bjuhknDQygrQHvmu/uZEDpRfvtsCBCCxcP5+y9GxXl AhZBKg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; bh=IlDdTuvU5XgBwC/k9le6XyTJJ6A3XNYsZn7ANfL+P pw=; b=dHQnm5UbZSZJygjudmIXUGACVv6cG18CUljLfmSDwYOXjwopbtBzkvZIt g1x91hyNXWKPd0DOTYFSSs99vtZYz6x2vU5ArrFfNg/Tk+K7FXCzpnaD7kAasGr4 D0CEfsttaMEC0XeioYWRgE6ROVcyY+SsS5HuX/bLcuOrKMWvbsn1D2S19cabXkwF c1tda/9TgjQ+WnVUrDR+IHaluZsdyjISUp1PGBN6TMspz/1joryTpVzeni4zzOCh Hzp22vyc1Ab9WTQxkQP4eI1F17fHzgb5ff5TiF0gN6dRG0MpU1W32DQxgyP8PCO5 LCQyKftaLAcBWk7VkRRi2G/iXgp0Q== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrleeigdegkecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgjfhggtgfgsehtkeertdertdejnecuhfhrohhmpefvhhhomhgr shcuofhonhhjrghlohhnuceothhhohhmrghssehmohhnjhgrlhhonhdrnhgvtheqnecugg ftrfgrthhtvghrnhepvedutdevueevjeekveehheevffeugeejudekffeltdelkeeifeeg udehvdegjefhnecukfhppeejjedrudefgedrvddtfedrudekgeenucevlhhushhtvghruf hiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehthhhomhgrshesmhhonhhjrghl ohhnrdhnvght X-ME-Proxy: Received: from xps.monjalon.net (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id 4F1DD1080057; Sun, 28 Feb 2021 07:54:21 -0500 (EST) From: Thomas Monjalon To: dev@dpdk.org Cc: ncopa@alpinelinux.org, stable@dpdk.org, =?utf-8?q?Morten_Br=C3=B8rup?= , Rahul Lakkireddy , Kumar Sanghvi Date: Sun, 28 Feb 2021 13:53:48 +0100 Message-Id: <20210228125353.2436562-14-thomas@monjalon.net> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210228125353.2436562-1-thomas@monjalon.net> References: <20190313170657.16688-1-ncopa@alpinelinux.org> <20210228125353.2436562-1-thomas@monjalon.net> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v6 13/17] net/cxgbe: remove use of uint type 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 Sender: "dev" From: Natanael Copa Improve portability by replacing non-standard 'uint' with 'unsigned int'. This solves the build error with musl libc: In file included from ../drivers/net/cxgbe/cxgbe.h:9, from ../drivers/net/cxgbe/cxgbe_ethdev.c:37: ../drivers/net/cxgbe/base/common.h:201:4: error: unknown type name 'uint' 201 | uint synmapen:1; /* SYN Map Enable */ | ^~~~ Fixes: bfcb257d3014 ("net/cxgbe: enable RSS for VF") Cc: stable@dpdk.org Signed-off-by: Natanael Copa Reviewed-by: Morten Brørup --- drivers/net/cxgbe/base/common.h | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/net/cxgbe/base/common.h b/drivers/net/cxgbe/base/common.h index 202a2f4baf..ab100d784c 100644 --- a/drivers/net/cxgbe/base/common.h +++ b/drivers/net/cxgbe/base/common.h @@ -189,15 +189,15 @@ struct rss_params { unsigned int mode; /* RSS mode */ union { struct { - uint synmapen:1; /* SYN Map Enable */ - uint syn4tupenipv6:1; /* en 4-tuple IPv6 SYNs hash */ - uint syn2tupenipv6:1; /* en 2-tuple IPv6 SYNs hash */ - uint syn4tupenipv4:1; /* en 4-tuple IPv4 SYNs hash */ - uint syn2tupenipv4:1; /* en 2-tuple IPv4 SYNs hash */ - uint ofdmapen:1; /* Offload Map Enable */ - uint tnlmapen:1; /* Tunnel Map Enable */ - uint tnlalllookup:1; /* Tunnel All Lookup */ - uint hashtoeplitz:1; /* use Toeplitz hash */ + unsigned int synmapen:1; /* SYN Map Enable */ + unsigned int syn4tupenipv6:1; /* en 4-tuple IPv6 SYNs hash */ + unsigned int syn2tupenipv6:1; /* en 2-tuple IPv6 SYNs hash */ + unsigned int syn4tupenipv4:1; /* en 4-tuple IPv4 SYNs hash */ + unsigned int syn2tupenipv4:1; /* en 2-tuple IPv4 SYNs hash */ + unsigned int ofdmapen:1; /* Offload Map Enable */ + unsigned int tnlmapen:1; /* Tunnel Map Enable */ + unsigned int tnlalllookup:1; /* Tunnel All Lookup */ + unsigned int hashtoeplitz:1; /* use Toeplitz hash */ } basicvirtual; } u; }; From patchwork Sun Feb 28 12:53:49 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Monjalon X-Patchwork-Id: 88284 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 BFDD9A0548; Sun, 28 Feb 2021 13:56:13 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B64E622A2B9; Sun, 28 Feb 2021 13:54:27 +0100 (CET) Received: from wout3-smtp.messagingengine.com (wout3-smtp.messagingengine.com [64.147.123.19]) by mails.dpdk.org (Postfix) with ESMTP id B635122A2E3; Sun, 28 Feb 2021 13:54:25 +0100 (CET) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.west.internal (Postfix) with ESMTP id 69B7D5D4; Sun, 28 Feb 2021 07:54:24 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Sun, 28 Feb 2021 07:54:25 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm3; bh=Tng9biq6UIYWa AVboArNrq+zZmgfHLM7Fk7rOEuu0lQ=; b=aBdKSS84RkXbzMajVGJHCkkGBdyRx 2yf6mo5DE2++NusGR/6ukSb3vmMN1mm7A4o7pIEpzHCV4UpnNNIaUmFqNaiFrK2q SqHS8z/8L6H/aZlbUrYb5ACR2xvQPJMtR1OLf2LKV/f3PuxBaGTpbZUrvyikuDgi zR4Eu0Qn0SugflMh3DpGZLyMCzgFu+D0m/HH41qdmVfoz88SzSsGTrOlzMsGfH1A 02BdKNENkrbPzU/W/+JP8xLQ0tgBI6lPNOwzofe+Gu5c8OGRzWjfpJRFjxZAqSJp uuhm/zqwCwxPSWhsqv9LrVC3T3tYXnU8A7BYYvRUazSwxv2dxTX49Q3fQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=Tng9biq6UIYWaAVboArNrq+zZmgfHLM7Fk7rOEuu0lQ=; b=Yba8aylv zciaWjES4swsQ+I6aTXdpHu65yqikf0ya5iLOwdqSo6Uvi2C8ym7Y7sTpoNIx6O2 n/pz+RH81J9qqwSkCTe1su4FxkE91xLmixqj2cIercv/MGFZOPptoyWVjvY64v1Q RPONSSTnRfSuQxDIGOQqZiW14/cYb4Tc6+LH14YNGJ+fX0CrscApzG3iG9Z1ler2 dPX6hvq5wXUYbTzsmsTH0JgonNQMRSuBQdftkMO7ci39JxW9PcH9vTIhjMgLNpQC UUApCcIn7og98pbgFrJWOq+zNJd1NJDR6j/K7wrc49cNTqBxlQlUXSFUm/7Z/7MX HFQbJovysEGdZg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrleeigdegkecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomhepvfhhohhmrghs ucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenucggtf frrghtthgvrhhnpedvhefgiedvjeegtdevheefhfetleefgfeivefgffevfeejgedtgfeu tdehtdegveenucfkphepjeejrddufeegrddvtdefrddukeegnecuvehluhhsthgvrhfuih iivgepgeenucfrrghrrghmpehmrghilhhfrhhomhepthhhohhmrghssehmohhnjhgrlhho nhdrnhgvth X-ME-Proxy: Received: from xps.monjalon.net (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id 131B71080059; Sun, 28 Feb 2021 07:54:22 -0500 (EST) From: Thomas Monjalon To: dev@dpdk.org Cc: ncopa@alpinelinux.org, stable@dpdk.org, David Marchand , Haiyue Wang , Jeff Guo , Alvin Zhang , Ferruh Yigit Date: Sun, 28 Feb 2021 13:53:49 +0100 Message-Id: <20210228125353.2436562-15-thomas@monjalon.net> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210228125353.2436562-1-thomas@monjalon.net> References: <20190313170657.16688-1-ncopa@alpinelinux.org> <20210228125353.2436562-1-thomas@monjalon.net> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v6 14/17] net/igc: remove use of uint type 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 Sender: "dev" Improve portability (especially with musl libc) by replacing the non-standard type 'uint' with 'size_t'. Fixes: 746664d546fb ("net/igc: support flow API") Cc: stable@dpdk.org Suggested-by: David Marchand Signed-off-by: Thomas Monjalon Acked-by: Haiyue Wang --- drivers/net/igc/igc_flow.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/igc/igc_flow.c b/drivers/net/igc/igc_flow.c index 1bb64d323c..66053060af 100644 --- a/drivers/net/igc/igc_flow.c +++ b/drivers/net/igc/igc_flow.c @@ -656,7 +656,7 @@ igc_parse_action_rss(struct rte_eth_dev *dev, * Return the pointer of the flow, or NULL for failed **/ static inline struct rte_flow * -igc_alloc_flow(const void *filter, enum igc_filter_type type, uint inbytes) +igc_alloc_flow(const void *filter, enum igc_filter_type type, size_t inbytes) { /* allocate memory, 8 bytes boundary aligned */ struct rte_flow *flow = rte_malloc("igc flow filter", From patchwork Sun Feb 28 12:53:50 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Monjalon X-Patchwork-Id: 88285 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 3496BA0548; Sun, 28 Feb 2021 13:56:23 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 240D622A2C0; Sun, 28 Feb 2021 13:54:29 +0100 (CET) Received: from wout3-smtp.messagingengine.com (wout3-smtp.messagingengine.com [64.147.123.19]) by mails.dpdk.org (Postfix) with ESMTP id 4FBB922A2B9; Sun, 28 Feb 2021 13:54:27 +0100 (CET) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.west.internal (Postfix) with ESMTP id 147145DB; Sun, 28 Feb 2021 07:54:26 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Sun, 28 Feb 2021 07:54:26 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm3; bh=x0sjAmwEHobre 5Wb/pLeyfeXRaZJn3qbMF4ORYFQo7I=; b=TrC5L0zvEClUqF+RY3lwMaiSSWshb z+cV2bHwfgpSSyeSGdloxVgfrMmlar76QI7K6cHHJIff2oVYKwHeBwQcmZiQ/rNN w/hg9CkMIhxS+0bpGsf3JrNdDhRdUED4myl1Gvi9cy9U86ufEv/EUHkt/8JOsrY4 nfjrsvCArWzry/KrAGdJSXkbdeYUjhvq6fAorl/k4uj9diN+bw578XEPRAC7r8Uk FCQ5gUY2olDnXRHjHuyCWa0SsaM6J4Lj19BLU8oOABIFWQAWOmrbFbQDXuGepWMs OLDeROID4zlZePMMpMnM9scIpJnCXflD4FT0JWxLZfXuvZzgXrFdHbgcg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=x0sjAmwEHobre5Wb/pLeyfeXRaZJn3qbMF4ORYFQo7I=; b=L9KU4FhY qi3mNFtUTYyOfZhKgu2V0cnhg8VQt02qWiqGO+oCQsH+QLpJttqDJ67Y1gNWjb6w KcJu1XxiWsmgNckzln44wFlb8DZME5vRAMF4DJ0MEiAqEny2n6fiYHmimL7+W7LD s/mbrxx5OSGlPN1QjuypPpYtz+m90OCEhUSo5FUc7vLsXAokHZZM5A9VZ08eETdV aBGCePBEkP2Cu55lMrWCyNxvc3nCQ8W33jU3m0b6+0XjzUa4YFV63Ty2oklsII0Y bWvN3lxyPIk7uug5vK3ZN1Qm+4PeBHjrztXYfypKl7ttSRT641VEs52A45eH8X0K GRJG5uuNJCN/qQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrleeigdegkecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomhepvfhhohhmrghs ucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenucggtf frrghtthgvrhhnpedvhefgiedvjeegtdevheefhfetleefgfeivefgffevfeejgedtgfeu tdehtdegveenucfkphepjeejrddufeegrddvtdefrddukeegnecuvehluhhsthgvrhfuih iivgepieenucfrrghrrghmpehmrghilhhfrhhomhepthhhohhmrghssehmohhnjhgrlhho nhdrnhgvth X-ME-Proxy: Received: from xps.monjalon.net (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id D6C65108005F; Sun, 28 Feb 2021 07:54:24 -0500 (EST) From: Thomas Monjalon To: dev@dpdk.org Cc: ncopa@alpinelinux.org, stable@dpdk.org, Matan Azrad , Viacheslav Ovsiienko , Xueming Li , Maxime Coquelin Date: Sun, 28 Feb 2021 13:53:50 +0100 Message-Id: <20210228125353.2436562-16-thomas@monjalon.net> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210228125353.2436562-1-thomas@monjalon.net> References: <20190313170657.16688-1-ncopa@alpinelinux.org> <20210228125353.2436562-1-thomas@monjalon.net> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v6 15/17] vdpa/mlx5: replace pthread functions unavailable in musl 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 Sender: "dev" 1/ The function pthread_yield() does not exist in musl libc, and can be replaced with sched_yield() after including sched.h. 2/ The function pthread_attr_setaffinity_np() does not exist in musl libc, and can be replaced with pthread_setaffinity_np() after pthread_create(). Fixes: b7fa0bf4d5c6 ("vdpa/mlx5: fix polling threads scheduling") Fixes: 5cf3fd3af4df ("vdpa/mlx5: add CPU core parameter to bind polling thread") Cc: stable@dpdk.org Signed-off-by: Thomas Monjalon --- drivers/vdpa/mlx5/mlx5_vdpa_event.c | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/drivers/vdpa/mlx5/mlx5_vdpa_event.c b/drivers/vdpa/mlx5/mlx5_vdpa_event.c index 86adc864f5..49632dfaa7 100644 --- a/drivers/vdpa/mlx5/mlx5_vdpa_event.c +++ b/drivers/vdpa/mlx5/mlx5_vdpa_event.c @@ -3,6 +3,7 @@ */ #include #include +#include #include #include @@ -234,7 +235,7 @@ mlx5_vdpa_timer_sleep(struct mlx5_vdpa_priv *priv, uint32_t max) usleep(priv->timer_delay_us); else /* Give-up CPU to improve polling threads scheduling. */ - pthread_yield(); + sched_yield(); } static void * @@ -515,17 +516,6 @@ mlx5_vdpa_cqe_event_setup(struct mlx5_vdpa_priv *priv) pthread_cond_init(&priv->timer_cond, NULL); priv->timer_on = 0; pthread_attr_init(&attr); - CPU_ZERO(&cpuset); - if (priv->event_core != -1) - CPU_SET(priv->event_core, &cpuset); - else - cpuset = rte_lcore_cpuset(rte_get_main_lcore()); - ret = pthread_attr_setaffinity_np(&attr, sizeof(cpuset), - &cpuset); - if (ret) { - DRV_LOG(ERR, "Failed to set thread affinity."); - return -1; - } ret = pthread_attr_setschedpolicy(&attr, SCHED_RR); if (ret) { DRV_LOG(ERR, "Failed to set thread sched policy = RR."); @@ -542,6 +532,17 @@ mlx5_vdpa_cqe_event_setup(struct mlx5_vdpa_priv *priv) DRV_LOG(ERR, "Failed to create timer thread."); return -1; } + CPU_ZERO(&cpuset); + if (priv->event_core != -1) + CPU_SET(priv->event_core, &cpuset); + else + cpuset = rte_lcore_cpuset(rte_get_main_lcore()); + ret = pthread_setaffinity_np(priv->timer_tid, + sizeof(cpuset), &cpuset); + if (ret) { + DRV_LOG(ERR, "Failed to set thread affinity."); + goto error; + } snprintf(name, sizeof(name), "vDPA-mlx5-%d", priv->vid); ret = pthread_setname_np(priv->timer_tid, name); if (ret) { From patchwork Sun Feb 28 12:53:51 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Monjalon X-Patchwork-Id: 88286 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 16588A0548; Sun, 28 Feb 2021 13:56:33 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 74E6322A2F1; Sun, 28 Feb 2021 13:54:30 +0100 (CET) Received: from wout3-smtp.messagingengine.com (wout3-smtp.messagingengine.com [64.147.123.19]) by mails.dpdk.org (Postfix) with ESMTP id 2A68D22A2EC; Sun, 28 Feb 2021 13:54:29 +0100 (CET) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.west.internal (Postfix) with ESMTP id D5AAD5D4; Sun, 28 Feb 2021 07:54:27 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Sun, 28 Feb 2021 07:54:28 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; s=fm3; bh= uuctzikRObxp0/hu4uvMy6utWUI8ejyogHL8LYIO85g=; b=zQVbP9m+42ff17TV t8Of10ttZsawIjzEVcXEnNTj0scjNztb3rZ+SRo9J2jiYsKg9QyGXvlWkHr2PkqK t005Ah9sGnFyb9L2Skyb08qBDIUTfahAdW5m7DQTiW6jilqrSWCVolJDiQNcV2wr iyTsF/x3uWZGU4rjitLF2Qqs56nM4ifLFbPRMisYrk5U0e67MUFGvYUJrX8L5BG7 yIOqO4MMRcrz6h2Xmk5BybL633dJ5kUxtFH6waokc/qE/D9kEbqXLyW/CN7j4y2t vwgRu3F+sum2fAvtCLfYiX3W9cp90t/q1MmUwOKQ1U/sH71gB+rMZe6Vg28iRirU /xH+VA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; bh=uuctzikRObxp0/hu4uvMy6utWUI8ejyogHL8LYIO8 5g=; b=DMPMmeqxM/zPsGuhA91OhYqurej+vgkZU7MFpKMaF1+YHKxvCqMoHjTlu Fs1uwVQ5pTh9/81e7WsFeGCanD/Pc3J1ka/9pRWmrc9vJ9tbu2nRv9cMpdOdwFHW WIYvNdzm8QwSIXGsoFlLH+/SvxKGaYDP/NIX4CKn7FSoho5ZOVpNpqdBlVtfK39/ qvmVVCjLNhcEwo5gIsWsZuZ5HCYHPd+ud8QwliuJoTfpwyxvVfBE0bpMRoeCt04m 2Ehl7gRymWN2q5rgTZkkvva7PDDwQGAioiw0ILWSGbi59orrnImOdirvi9wQ3O4s g9/nEMIwUmizqmRQaSZvl1HvPKQng== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrleeigdegkecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgjfhggtgfgsehtkeertdertdejnecuhfhrohhmpefvhhhomhgr shcuofhonhhjrghlohhnuceothhhohhmrghssehmohhnjhgrlhhonhdrnhgvtheqnecugg ftrfgrthhtvghrnhepvedutdevueevjeekveehheevffeugeejudekffeltdelkeeifeeg udehvdegjefhnecukfhppeejjedrudefgedrvddtfedrudekgeenucevlhhushhtvghruf hiiigvpedunecurfgrrhgrmhepmhgrihhlfhhrohhmpehthhhomhgrshesmhhonhhjrghl ohhnrdhnvght X-ME-Proxy: Received: from xps.monjalon.net (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id 9056C1080057; Sun, 28 Feb 2021 07:54:26 -0500 (EST) From: Thomas Monjalon To: dev@dpdk.org Cc: ncopa@alpinelinux.org, stable@dpdk.org, =?utf-8?q?Morten_Br=C3=B8rup?= , Xiaoyun Li , =?utf-8?q?N=C3=A9lio_Laranjeiro?= , Konstantin Ananyev , Ferruh Yigit Date: Sun, 28 Feb 2021 13:53:51 +0100 Message-Id: <20210228125353.2436562-17-thomas@monjalon.net> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210228125353.2436562-1-thomas@monjalon.net> References: <20190313170657.16688-1-ncopa@alpinelinux.org> <20210228125353.2436562-1-thomas@monjalon.net> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v6 16/17] app/testpmd: fix build with musl 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 Sender: "dev" From: Natanael Copa 1/ Improve portability by avoiding use of non-standard 'uint'. Use uint8_t for hash_key_len as rss_key_len is a uint8_t type. This solves following build error when building with musl libc: app/test-pmd/testpmd.h:813:29: error: unknown type name 'uint' 2/ In musl libc, stdout is of type (FILE * const). Because of the const qualifier, a dark magic cast must be achieved through uintptr_t. Fixes: 8205e241b2b0 ("app/testpmd: add missing type to RSS hash commands") Fixes: e977e4199a8d ("app/testpmd: add commands to load/unload BPF filters") Cc: stable@dpdk.org Signed-off-by: Natanael Copa Reviewed-by: Morten Brørup Signed-off-by: Thomas Monjalon --- app/test-pmd/bpf_cmd.c | 2 +- app/test-pmd/config.c | 2 +- app/test-pmd/testpmd.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/test-pmd/bpf_cmd.c b/app/test-pmd/bpf_cmd.c index 066619e115..6980291f07 100644 --- a/app/test-pmd/bpf_cmd.c +++ b/app/test-pmd/bpf_cmd.c @@ -20,7 +20,7 @@ static const struct rte_bpf_xsym bpf_xsym[] = { .name = RTE_STR(stdout), .type = RTE_BPF_XTYPE_VAR, .var = { - .val = &stdout, + .val = (void *)(uintptr_t)&stdout, .desc = { .type = RTE_BPF_ARG_PTR, .size = sizeof(stdout), diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c index dab8afe5dd..9ca03c236e 100644 --- a/app/test-pmd/config.c +++ b/app/test-pmd/config.c @@ -2963,7 +2963,7 @@ port_rss_hash_conf_show(portid_t port_id, int show_rss_key) void port_rss_hash_key_update(portid_t port_id, char rss_type[], uint8_t *hash_key, - uint hash_key_len) + uint8_t hash_key_len) { struct rte_eth_rss_conf rss_conf; int diag; diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h index 4aca522859..5437b6229e 100644 --- a/app/test-pmd/testpmd.h +++ b/app/test-pmd/testpmd.h @@ -935,7 +935,7 @@ int set_vf_rate_limit(portid_t port_id, uint16_t vf, uint16_t rate, void port_rss_hash_conf_show(portid_t port_id, int show_rss_key); void port_rss_hash_key_update(portid_t port_id, char rss_type[], - uint8_t *hash_key, uint hash_key_len); + uint8_t *hash_key, uint8_t hash_key_len); int rx_queue_id_is_invalid(queueid_t rxq_id); int tx_queue_id_is_invalid(queueid_t txq_id); void setup_gro(const char *onoff, portid_t port_id); From patchwork Sun Feb 28 12:53:52 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Monjalon X-Patchwork-Id: 88287 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 CAE33A0548; Sun, 28 Feb 2021 13:56:42 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C605C22A300; Sun, 28 Feb 2021 13:54:31 +0100 (CET) Received: from wout3-smtp.messagingengine.com (wout3-smtp.messagingengine.com [64.147.123.19]) by mails.dpdk.org (Postfix) with ESMTP id 75E1C22A2F2; Sun, 28 Feb 2021 13:54:30 +0100 (CET) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.west.internal (Postfix) with ESMTP id 5D9D55EB; Sun, 28 Feb 2021 07:54:29 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Sun, 28 Feb 2021 07:54:29 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm3; bh=AKYSSaj9DUivy LMyWphW/zWS3fNHpj5co0R7gEe78hk=; b=yU8ZxpK7aFRiVIX00Ke4Xq5eoP/+R XKYQppCh4x7WuHOCgcwv7WFhFlDpstPDyKozbahd+hAbrvWKrdJPmUIoShsTVW20 6eppNLeEn5UvHXLfIm0lH+kWwGeP5hYo/hzvTD9khtBDeFsPn6UVFf7leHjunF7r uY2lu2L4ezSlxJmFkvo6K7p6mBuwB1YLm45UvH0ihqYO8oD0LneLCFTyeNp8s4Zo rM4QV3at8DDHXp5tPbnW9CZodCmwqqCLIFJZ9s4I1uLeHlk2AYfsY/avQliKV2Ea U/j3yoOJFqoPvIA3+TVcW7ufiNZeHj37RKJtNstMPZDhAAuIWwHVELfHA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=AKYSSaj9DUivyLMyWphW/zWS3fNHpj5co0R7gEe78hk=; b=MEmrq+57 FZb5onzk2xMPsiQgr59GRQmJRXrkFfAXaZ7/rMu0mB1tooqYDqQUcEikQH+dKlIe pmeeeYOlDZHU6Xn6w/3+35TuCz1hkQQ3qWVrYx1gRCprWMK2hblgenbWT3WbVn39 FIpJMRHolNlbf6qMItrQduqtfY4mqHex/MwMGfhf10yjVTcTNGgSiOlI4KTsQmzV MSFgLcUiiJtT0BGd/BGhos1DuirlaKlSDLPCgOVk55UNeDRTqYYTZvVQxfPXKxzN MtNxfJytmzMYFBW90iHOr2zEzVkcGDI12pv3lSHZYjbzIaelAUNRWf8jp6Uamnom aKTHx49gasAmXQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrleeigdegkecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomhepvfhhohhmrghs ucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenucggtf frrghtthgvrhhnpedvhefgiedvjeegtdevheefhfetleefgfeivefgffevfeejgedtgfeu tdehtdegveenucfkphepjeejrddufeegrddvtdefrddukeegnecuvehluhhsthgvrhfuih iivgepieenucfrrghrrghmpehmrghilhhfrhhomhepthhhohhmrghssehmohhnjhgrlhho nhdrnhgvth X-ME-Proxy: Received: from xps.monjalon.net (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id 3E40C1080059; Sun, 28 Feb 2021 07:54:28 -0500 (EST) From: Thomas Monjalon To: dev@dpdk.org Cc: ncopa@alpinelinux.org, stable@dpdk.org, Nicolas Chautru , Amr Mokhtar Date: Sun, 28 Feb 2021 13:53:52 +0100 Message-Id: <20210228125353.2436562-18-thomas@monjalon.net> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210228125353.2436562-1-thomas@monjalon.net> References: <20190313170657.16688-1-ncopa@alpinelinux.org> <20210228125353.2436562-1-thomas@monjalon.net> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v6 17/17] examples/bbdev: fix header include for musl 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 Sender: "dev" The header file unistd.h should not be included from sys/ directory, it is an error with musl libc. Fixes: 1ffee690eaa1 ("examples/bbdev: add sample app") Cc: stable@dpdk.org Signed-off-by: Thomas Monjalon --- examples/bbdev_app/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/bbdev_app/main.c b/examples/bbdev_app/main.c index 2e170caf84..20cfd327fb 100644 --- a/examples/bbdev_app/main.c +++ b/examples/bbdev_app/main.c @@ -8,7 +8,7 @@ #include #include #include -#include +#include #include #include #include