From patchwork Thu Feb 25 18:22:34 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Monjalon X-Patchwork-Id: 88240 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 46442A034F; Thu, 25 Feb 2021 19:23:21 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2FC961607EF; Thu, 25 Feb 2021 19:23:21 +0100 (CET) Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) by mails.dpdk.org (Postfix) with ESMTP id 30DBF1607EF; Thu, 25 Feb 2021 19:23:20 +0100 (CET) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id C6D905C00AE; Thu, 25 Feb 2021 13:23:18 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Thu, 25 Feb 2021 13:23:18 -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=FUbs+b9FhhW3bXQj28lyFTr/wjT4J hl1uPnsDVN+Ll3MYSmu23Y3qGP6YIJgCYccU8/Uja+GpO/kSFtflU1Y22q52S6CL a/k5sjMPPcrBxfGJzQyVLRA+wpQuKrpFXd1ejdRt76fHhld6X5OPGlsDuE1g6mKs vnn5Sn+VzvPwgt88GNUicBqtM95SeKy9KsNecqWNldNXfPoCebRtCMmZhThRjk+F +pbQKEL+vjE+QX0heIhCMFA9u+xckiDr+7mR/aYTww0P/DdMpp3L3g4V7f6I3EMr 0MBH9VqB8ePT+r7y8jmJeZGw24BammaehnrJZvDQhLnNO+A2cwE6uBitQ== 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=M/SravQm nOKySES0Dvw1+2P54tjFqgcWmfwdXW6lsE2J16hibJslpMXw6VgNcVv4bLUsIOrZ TBjfvWiQAJCOMy5w8upWdDklninm0PbcM0SMjf/od6L8NnnbrOAIkLVV8qAiP0Z5 cJoZ/stxjagoVyd+jTgZd2jK3iEMbSJXCdgSYGvbucRdgKrXJjSnxAS//3ToTLms vTpMEt3LiIvUSRXPLeTJ6eBU3jcZxpJIEO3YrFAkz0uFL4I4Tpjj1EUt6Qq7BibF yBS5X20cOih5VZ0BxS/2PAxjYyfVjZPfbZmZxvML7PC3ln09+UP6AfkuVLm2GsE+ iOILUkqqXyZ+sA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrkeelgdduudegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefvhhhomhgr shcuofhonhhjrghlohhnuceothhhohhmrghssehmohhnjhgrlhhonhdrnhgvtheqnecugg ftrfgrthhtvghrnhepvdehgfeivdejgedtveehfefhteelfefgieevgfffveefjeegtdfg uedthedtgeevnecukfhppeejjedrudefgedrvddtfedrudekgeenucevlhhushhtvghruf 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 1791F24005C; Thu, 25 Feb 2021 13:23:17 -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 , Harini Ramakrishnan , Anand Rawat Date: Thu, 25 Feb 2021 19:22:34 +0100 Message-Id: <20210225182250.1149592-2-thomas@monjalon.net> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210225182250.1149592-1-thomas@monjalon.net> References: <20190313170657.16688-1-ncopa@alpinelinux.org> <20210225182250.1149592-1-thomas@monjalon.net> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v5 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 Thu Feb 25 18:22:35 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Monjalon X-Patchwork-Id: 88241 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 5F3D8A034F; Thu, 25 Feb 2021 19:23:30 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id EBE52160807; Thu, 25 Feb 2021 19:23:25 +0100 (CET) Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) by mails.dpdk.org (Postfix) with ESMTP id 406991607FF; Thu, 25 Feb 2021 19:23:24 +0100 (CET) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id BBC185C00AF; Thu, 25 Feb 2021 13:23:23 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Thu, 25 Feb 2021 13:23: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-transfer-encoding; s=fm3; bh=P6ZUq25le0Cn9 OiQ1sfzjIeIyxejmhMqihl+Hz6lI4w=; b=ZEGU4hlRKncVuueB3WikJ8kW7jq5k jkutSS+c0ARwMHYLhcfJ4ueL5buO0RwS2ziYkJjjoNE4G2LBu2u1sfVORm0kSqEE cFp9T/+UED+Jn5guounfU/dXNrnMPfHhrAtRZSplRpUlDVgcMHSR5ndUggHO9moj PMIeaKMdJT0RjuDdewTnfsAddMs/Vw6qSqsMxtaoJxYBtRnM/ZzH4MBGTy35nBns BiaLFURQkACKMYpkHB7os0ZMV8LPcpkTOmbuJVq5H2CK/3DJjtVMq+N1MHbWp5wR kidaXuvFJFu14/t59TOjPqRTEDkcAgE9rLaRy16NqxCMOpLe7ATHKuqJQ== 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=P6ZUq25le0Cn9OiQ1sfzjIeIyxejmhMqihl+Hz6lI4w=; b=QocGGhB2 Wez+hUhVTaeaI1JgzQKR6I2PuULBn5dPbX8eJ60dwArRJlZKkeUB6fS0zCo6ZHRH kwv0Q80GY37wzZXyvW1zEWrv7eEZiOsIAYgv9R+1Xbggf66HAEOheMoVIx474lXv gavuIUBKR/CNrkY5ey96t48V2vpDdYvg5RTiT17W+cX4hucYRSRF1PECU77Qrtl+ Sw1VkKsM0/UqBJGELPqGwyxg8chYdRRPDwgdJFlMLNvV0UR7K9eI4O+LDdoL0TtU unOt0+seRhMemHg5KQ1iJvT+8cvm1znxgNwuhUg9y8Bz4Dnrz35tu0qLrmi2on/h lWIhhG/mGPPiqA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrkeelgdduudegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefvhhhomhgr shcuofhonhhjrghlohhnuceothhhohhmrghssehmohhnjhgrlhhonhdrnhgvtheqnecugg ftrfgrthhtvghrnhepudduheevgfffvedtteefteekhefhheffkeffgfdvtdefjefgteei fffhffdtuddtnecuffhomhgrihhnpehgnhhurdhorhhgnecukfhppeejjedrudefgedrvd dtfedrudekgeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhr ohhmpehthhhomhgrshesmhhonhhjrghlohhnrdhnvght 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 1FDD5240054; Thu, 25 Feb 2021 13:23:21 -0500 (EST) From: Thomas Monjalon To: dev@dpdk.org Cc: ncopa@alpinelinux.org, stable@dpdk.org, Bruce Richardson , Konstantin Ananyev , Ray Kinsella , Neil Horman , Haiyue Wang , David Marchand , Adrien Mazarguil Date: Thu, 25 Feb 2021 19:22:35 +0100 Message-Id: <20210225182250.1149592-3-thomas@monjalon.net> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210225182250.1149592-1-thomas@monjalon.net> References: <20190313170657.16688-1-ncopa@alpinelinux.org> <20210225182250.1149592-1-thomas@monjalon.net> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v5 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 Thu Feb 25 18:22: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: 88242 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 7D76CA034F; Thu, 25 Feb 2021 19:23:38 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4CE23160828; Thu, 25 Feb 2021 19:23:27 +0100 (CET) Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) by mails.dpdk.org (Postfix) with ESMTP id 57522160806; Thu, 25 Feb 2021 19:23:25 +0100 (CET) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id EE6B55C00AE; Thu, 25 Feb 2021 13:23:24 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Thu, 25 Feb 2021 13:23:24 -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=BgeJ+Y5pK8WsD A+DYJfdzKbbUcW7A3oG9YMbHxH+ykU=; b=tvm1/ar2VD5ktJXt8lDa3dtO8Zt0O qr6qu2Q/y1Fhx230nJYNEts2dnmAcD0tpK/CY2iGseazYWmr17W97QhYd28vv5Jl EdOypAb/Ys1V0UwdnYnt7GNFmE//s8U9UQcCpU8U2ZXzvtyQQOctn4wPSqiysCVH Pf5ophh/5CEu+OPdquYNTQU1ataLMLswsjxqNXuWJJH/w00JS7vxyhy51Owjn+rb 50Gw4HGZoaJZwVI6qh6mmx8imaZ4rzZ9hnNpWAOP9lrGmWp2r7hcJzYfRQA6Vu45 hg85tlr7+p/gzvtlfeKaRsJBhWU/nrO/PDb3TNOMXbEbUZqKklun6Np+A== 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=BgeJ+Y5pK8WsDA+DYJfdzKbbUcW7A3oG9YMbHxH+ykU=; b=SqoaKUrb PC16NTyPSqpNuBiVzqQIii93YYs5WpWJE4g2qVuEP7JuPo/M+ngb7fRhVUUBzuG5 KrCQwtDdwZQcFLBvxvneEstcQ4pE1873UifzOxT9QUoXJ667eUS8kGqsZvnxse/z kENMAMNrgZjL8d7Cmg3mJl6eh++DREw5jPyNdQtVRTdTppP0wR8C+sA5vsJTTurI PWsqWn4yBDrHthwNW7sK4hEvZFUM9MDCWYJ2JpE0EfWY5O7/Z/GhVrdkqNReqevx Y95MvTvzTQDR1HMx8+mLiQ6bHIrAp+jr3jBLcZqCQ/JaRic9Jmoz6JsgjooPfQM5 Csqfbd5T27efcw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrkeelgdduudegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefvhhhomhgr shcuofhonhhjrghlohhnuceothhhohhmrghssehmohhnjhgrlhhonhdrnhgvtheqnecugg ftrfgrthhtvghrnhepvdehgfeivdejgedtveehfefhteelfefgieevgfffveefjeegtdfg uedthedtgeevnecukfhppeejjedrudefgedrvddtfedrudekgeenucevlhhushhtvghruf 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 45277240065; Thu, 25 Feb 2021 13:23:24 -0500 (EST) From: Thomas Monjalon To: dev@dpdk.org Cc: ncopa@alpinelinux.org, stable@dpdk.org, Bruce Richardson Date: Thu, 25 Feb 2021 19:22:36 +0100 Message-Id: <20210225182250.1149592-4-thomas@monjalon.net> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210225182250.1149592-1-thomas@monjalon.net> References: <20190313170657.16688-1-ncopa@alpinelinux.org> <20210225182250.1149592-1-thomas@monjalon.net> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v5 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 Thu Feb 25 18:22: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: 88243 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 803A9A034F; Thu, 25 Feb 2021 19:23:46 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A0429160821; Thu, 25 Feb 2021 19:23:30 +0100 (CET) Received: from new4-smtp.messagingengine.com (new4-smtp.messagingengine.com [66.111.4.230]) by mails.dpdk.org (Postfix) with ESMTP id 5F8A040692; Thu, 25 Feb 2021 19:23:29 +0100 (CET) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailnew.nyi.internal (Postfix) with ESMTP id B6FB65803FB; Thu, 25 Feb 2021 13:23:28 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Thu, 25 Feb 2021 13:23: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-transfer-encoding; s=fm3; bh=W3ALfs3j1TRCU 9ilCAGpjy7o5d4eKyZHmI5XGblAqKI=; b=jxTs9uyQ9kOedF6KIqityt8hXucqO EeeeTig40jK1rb9HiLBH2AMKPknBNRvHa4tGJmWFGGEO+VG5ra+Qsx2QLlKiRmV/ adbJ+T4Vft1lMwy6W+3ld/aJn6EXVR67/4ftpz+eve5xTgJ7pujHX3lTgDhyN3Ra QLQ6+Yp3fQ8JkUqDGqfclDwcYnaZI9Y4zxBSknxAW6qZD48JaAbCivbZld9WEJut SQRkLuwvsFKzLkHrETmpKipaKfLbrDKZrXDQHXYkhH2NrhS0WDIjxaqLjRj1uk1k gkJX8l/J66f85r7/QAt8VsGxvsUVUXTo07kSG46Co8ZpLDyswyXOT5xjg== 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=W3ALfs3j1TRCU9ilCAGpjy7o5d4eKyZHmI5XGblAqKI=; b=l+uFrPMK nZ4NpTkx7+PvaGJfFpcPg1W5SCHeC9pTPZH2Je7drB//hCfAJ4kdtvJzVHxIbfs7 MCOtyWwgRrZVTjq19luDTSzz6QVR2MzgX+wbRWG4M4uogzkBxirBHy/MPwQLFyYC e/qgo8hMJUpyflhTa3tFDc11fiI/Gy5PyXUIB6/nirmkjsHbu1uTG7RF7TTqABeu Yyq8Pu/P1WdWOkONG9XJaVBdamQimEJ9iWmhwtuZDNgxwPU0eibXf/EE07V7iytH djPnJPPsi4cMwY4FJ0e28XlK7i0AdEdGPOsrMVGKMoUWAI9JctkwoiAzago3FDdS CUN4iUbsGX/zOg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrkeelgdduudegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefvhhhomhgr shcuofhonhhjrghlohhnuceothhhohhmrghssehmohhnjhgrlhhonhdrnhgvtheqnecugg ftrfgrthhtvghrnhepvdehgfeivdejgedtveehfefhteelfefgieevgfffveefjeegtdfg uedthedtgeevnecukfhppeejjedrudefgedrvddtfedrudekgeenucevlhhushhtvghruf hiiigvpedvnecurfgrrhgrmhepmhgrihhlfhhrohhmpehthhhomhgrshesmhhonhhjrghl 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 CCAB424005C; Thu, 25 Feb 2021 13:23:26 -0500 (EST) From: Thomas Monjalon To: dev@dpdk.org Cc: ncopa@alpinelinux.org, stable@dpdk.org, Bruce Richardson , Hemant Agrawal , Sachin Saxena , Jakub Grajciar , Matan Azrad , Shahaf Shuler , Viacheslav Ovsiienko , Cristian Dumitrescu , John McNamara , Maxime Coquelin , Chenbo Xia , Anatoly Burakov , Konstantin Ananyev , Marcin Smoczynski Date: Thu, 25 Feb 2021 19:22:37 +0100 Message-Id: <20210225182250.1149592-5-thomas@monjalon.net> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210225182250.1149592-1-thomas@monjalon.net> References: <20190313170657.16688-1-ncopa@alpinelinux.org> <20210225182250.1149592-1-thomas@monjalon.net> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v5 04/17] build: define _GNU_SOURCE globally 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" There was an intent to define _GNU_SOURCE globally, but it was not set in pkg-config for external applications. The internal definition in config/meson.build is kept, and one is added in buildtools/pkg-config/meson.build for external apps. All other specific definitions of _GNU_SOURCE are removed. Fixes: 5d7b673d5fd6 ("mk: build with _GNU_SOURCE defined by default") Fixes: 28188cee2aa0 ("build: enable BSD features visibility for FreeBSD") Cc: stable@dpdk.org Signed-off-by: Thomas Monjalon --- app/test/meson.build | 2 -- buildtools/pkg-config/meson.build | 1 + 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 ---- examples/ip_pipeline/Makefile | 2 +- examples/performance-thread/l3fwd-thread/main.c | 4 ---- examples/performance-thread/pthread_shim/Makefile | 1 - examples/pipeline/Makefile | 2 +- examples/vhost_blk/vhost_blk.c | 4 ---- 12 files changed, 3 insertions(+), 29 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/buildtools/pkg-config/meson.build b/buildtools/pkg-config/meson.build index 39a8fd1c8e..d3f3edaa2f 100644 --- a/buildtools/pkg-config/meson.build +++ b/buildtools/pkg-config/meson.build @@ -3,6 +3,7 @@ pkg = import('pkgconfig') pkg_extra_cflags = ['-include', 'rte_config.h'] + machine_args +pkg_extra_cflags += '-D_GNU_SOURCE' if is_freebsd pkg_extra_cflags += ['-D__BSD_VISIBLE'] endif 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 diff --git a/examples/ip_pipeline/Makefile b/examples/ip_pipeline/Makefile index 96f492a5ea..7933ad7519 100644 --- a/examples/ip_pipeline/Makefile +++ b/examples/ip_pipeline/Makefile @@ -47,7 +47,7 @@ $(error "Cannot generate statically-linked binaries with this version of pkg-con endif endif -CFLAGS += -I. -DALLOW_EXPERIMENTAL_API -D_GNU_SOURCE +CFLAGS += -I. -DALLOW_EXPERIMENTAL_API OBJS := $(patsubst %.c,build/%.o,$(SRCS-y)) diff --git a/examples/performance-thread/l3fwd-thread/main.c b/examples/performance-thread/l3fwd-thread/main.c index 4d82fb82ef..10bd33d767 100644 --- a/examples/performance-thread/l3fwd-thread/main.c +++ b/examples/performance-thread/l3fwd-thread/main.c @@ -2,10 +2,6 @@ * Copyright(c) 2010-2016 Intel Corporation */ -#ifndef _GNU_SOURCE -#define _GNU_SOURCE -#endif - #include #include #include diff --git a/examples/performance-thread/pthread_shim/Makefile b/examples/performance-thread/pthread_shim/Makefile index 5aa401dc49..a1f4557cd4 100644 --- a/examples/performance-thread/pthread_shim/Makefile +++ b/examples/performance-thread/pthread_shim/Makefile @@ -18,7 +18,6 @@ endif endif CFLAGS += -DALLOW_EXPERIMENTAL_API -CFLAGS += -D_GNU_SOURCE LDFLAGS += "-Wl,--copy-dt-needed-entries" # Build using pkg-config variables if possible diff --git a/examples/pipeline/Makefile b/examples/pipeline/Makefile index fcba51fd4d..92caf4aeb2 100644 --- a/examples/pipeline/Makefile +++ b/examples/pipeline/Makefile @@ -38,7 +38,7 @@ $(error "Cannot generate statically-linked binaries with this version of pkg-con endif endif -CFLAGS += -I. -DALLOW_EXPERIMENTAL_API -D_GNU_SOURCE +CFLAGS += -I. -DALLOW_EXPERIMENTAL_API OBJS := $(patsubst %.c,build/%.o,$(SRCS-y)) diff --git a/examples/vhost_blk/vhost_blk.c b/examples/vhost_blk/vhost_blk.c index 7ea60863da..e9361267a6 100644 --- a/examples/vhost_blk/vhost_blk.c +++ b/examples/vhost_blk/vhost_blk.c @@ -2,12 +2,8 @@ * Copyright(c) 2010-2019 Intel Corporation */ -#ifndef _GNU_SOURCE -#define _GNU_SOURCE -#endif #include #include - #include #include #include From patchwork Thu Feb 25 18:22: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: 88244 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 687E0A034F; Thu, 25 Feb 2021 19:23:54 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0E82A16084A; Thu, 25 Feb 2021 19:23:33 +0100 (CET) Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) by mails.dpdk.org (Postfix) with ESMTP id 54AB8160840; Thu, 25 Feb 2021 19:23:31 +0100 (CET) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id F234C5C00C5; Thu, 25 Feb 2021 13:23:30 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Thu, 25 Feb 2021 13:23:30 -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=oUeHKLd9qA7KE nk84Ylwd5smFBY2GMDVgWeQkQjjniI=; b=YaGH9iovMO2n96hBcitlLZ6qBE9ua YvqqJMInwLMFKm5uT40MFFSM1fHzSuGOaopUsr6Yzy3dJeWH5amPjLrwTqDQ2xzw +nwepKDfiQg0y7bGNqav6sN6pPxCIuyUuk9XVKFzkuhHlGKotIkEQNYx340pWtvO 64lHcx+bx+zd4KOqDkLJ9DwhcLRecqU7DHCZgdZDBzi4e+J6fq3XZT7fPIms9RB4 OZa9uM4vZ+GRJB/bac+LE8uOOd4Zq6A3B9DFaIDWTTta+uMTQPWIqWX2Blh9i1rm dlIS5wsi3z2MzTRjuZrBFdXwgqMdJwDvKKeaCLHCR21p1kZodTzlMVedA== 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=oUeHKLd9qA7KEnk84Ylwd5smFBY2GMDVgWeQkQjjniI=; b=fnhKMvW1 qrROBkTh8G9goA/8X5KNHP6HUtXU6pK4CigmG1/UBZDGvX02MvG3Ess0+5agR5iO 71AO4qwO2DCnF9GnCTeHF5bLmoeKG7YO5gw69uCzh2dHmxwoiWnKO4lgxzXZkoyT 3BXI+lB/rIwV8VjS+T410BI9pJ3FrSj9H1A/VSJ/ES6GieFVszMIb4MQidYavLiW yuhBVguJIPFnTEIH86Ds3WyhKmZA03IuBiQcHBiIyUk6Pf3k97ul2w+MfxgbLWNV UUDGUdz9D1uolM/C3Nq0q0NVizVhQ3awl0quHlVZuytfgSBfQMKG8esBKFl1M5n0 1pzNRa+T+k3UIg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrkeelgdduudegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefvhhhomhgr shcuofhonhhjrghlohhnuceothhhohhmrghssehmohhnjhgrlhhonhdrnhgvtheqnecugg ftrfgrthhtvghrnhepvdehgfeivdejgedtveehfefhteelfefgieevgfffveefjeegtdfg uedthedtgeevnecukfhppeejjedrudefgedrvddtfedrudekgeenucevlhhushhtvghruf hiiigvpedvnecurfgrrhgrmhepmhgrihhlfhhrohhmpehthhhomhgrshesmhhonhhjrghl 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 1ABD224005C; Thu, 25 Feb 2021 13:23:30 -0500 (EST) From: Thomas Monjalon To: dev@dpdk.org Cc: ncopa@alpinelinux.org, stable@dpdk.org, Ferruh Yigit , Jerin Jacob , Dmitry Kozlyuk Date: Thu, 25 Feb 2021 19:22:38 +0100 Message-Id: <20210225182250.1149592-6-thomas@monjalon.net> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210225182250.1149592-1-thomas@monjalon.net> References: <20190313170657.16688-1-ncopa@alpinelinux.org> <20210225182250.1149592-1-thomas@monjalon.net> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v5 05/17] eal/linux: 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 _GNU_SOURCE is not defined, cpu_set_t related definitions are skipped. Note: such definitions are unneeded in eal_common_errno.c. 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 --- lib/librte_eal/linux/include/rte_os.h | 2 ++ lib/librte_eal/unix/eal_file.c | 1 + 2 files changed, 3 insertions(+) diff --git a/lib/librte_eal/linux/include/rte_os.h b/lib/librte_eal/linux/include/rte_os.h index 390b87b3a1..f3f9982f40 100644 --- a/lib/librte_eal/linux/include/rte_os.h +++ b/lib/librte_eal/linux/include/rte_os.h @@ -12,6 +12,7 @@ #include +#ifdef _GNU_SOURCE typedef cpu_set_t rte_cpuset_t; #define RTE_CPU_AND(dst, src1, src2) CPU_AND(dst, src1, src2) #define RTE_CPU_OR(dst, src1, src2) CPU_OR(dst, src1, src2) @@ -28,5 +29,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 From patchwork Thu Feb 25 18:22: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: 88245 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 9BD4CA034F; Thu, 25 Feb 2021 19:24:02 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 63DFB160858; Thu, 25 Feb 2021 19:23:35 +0100 (CET) Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) by mails.dpdk.org (Postfix) with ESMTP id D1EB016084E; Thu, 25 Feb 2021 19:23:33 +0100 (CET) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id 74DEA5C0120; Thu, 25 Feb 2021 13:23:33 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Thu, 25 Feb 2021 13:23:33 -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=DprlbW2pCG6m8eh9l0RDpgyKcTgcm r7JpToKYVvm5t0GCjkurRRDiu0vu6Ce7jsXOIOC9r3RkxThlt+1NwoqHb8nG4fvV nrznoW+S8siKp75EgqxPTqjC8n7j+qwLBVOrZY+LaITXpvWkTnEblmTYkizkU9YX 7/tQYsreEvNmWWXKxBqxrO6W8N3uv1/0I/yzdLjxtUpPMmxatP6Zc29CkBttmCSR t2pOdz6YOMkTV/SHUzHT8uWlJqbtiXOyuFjrV61yIzBxioY1Notn210a7MD6tzPs h140BYu3YZ16d6ao/OcdC3kKUoS0FWsrxlnoRI3FfGsMNDag4SZE4AZ7A== 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=OBBqZ8+m FXDjjax1FSfroUNxV9rZ1yBmnvvQvMu7uq8iK8umU2xQEywdMMEQs4HVcXya/wSL 0ThjwVsU3M6ixTFHSboZhBTVMFo7qaaNpRMm/hqYDF4Sfi176+cV0MqYoyjV5QpC enTMqZ0h25uB+Znwo9v+fWBZL6t+0F+Oxw9YYVGigRiv2BBVgd+CA/yz9qkouIQv NSM385WUEiPR8A5BDR0R9vePPF6gQD1VoD1DwHp+9kWBouiLeXo6a2pyDuB5rPz6 9v62J/vWSpmnK44V88FgUqRWnCMWRKRWzOyQ9DmMqrq7kJ5rr0Bti2l+e+/h+GNg SCiPrTFjKV9sjg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrkeelgdduudegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefvhhhomhgr shcuofhonhhjrghlohhnuceothhhohhmrghssehmohhnjhgrlhhonhdrnhgvtheqnecugg ftrfgrthhtvghrnhepvdehgfeivdejgedtveehfefhteelfefgieevgfffveefjeegtdfg uedthedtgeevnecukfhppeejjedrudefgedrvddtfedrudekgeenucevlhhushhtvghruf hiiigvpeegnecurfgrrhgrmhepmhgrihhlfhhrohhmpehthhhomhgrshesmhhonhhjrghl 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 5A825240067; Thu, 25 Feb 2021 13:23:32 -0500 (EST) From: Thomas Monjalon To: dev@dpdk.org Cc: ncopa@alpinelinux.org, stable@dpdk.org, Hemant Agrawal , Sachin Saxena , Timothy McDaniel , Geoff Thorpe , Shreyansh Jain , Gage Eads Date: Thu, 25 Feb 2021 19:22:39 +0100 Message-Id: <20210225182250.1149592-7-thomas@monjalon.net> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210225182250.1149592-1-thomas@monjalon.net> References: <20190313170657.16688-1-ncopa@alpinelinux.org> <20210225182250.1149592-1-thomas@monjalon.net> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v5 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 Thu Feb 25 18:22: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: 88246 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 24780A034F; Thu, 25 Feb 2021 19:24:13 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2D72416085C; Thu, 25 Feb 2021 19:23:39 +0100 (CET) Received: from new4-smtp.messagingengine.com (new4-smtp.messagingengine.com [66.111.4.230]) by mails.dpdk.org (Postfix) with ESMTP id A555C16084E for ; Thu, 25 Feb 2021 19:23:37 +0100 (CET) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailnew.nyi.internal (Postfix) with ESMTP id 5239A5803FE; Thu, 25 Feb 2021 13:23:37 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Thu, 25 Feb 2021 13:23:37 -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=RK9tlDNtaKjISNuE7jxlHyOgPE4A+ VWsTfQFFq5H5WvVWVI96oBslFYzSx/wnzu+87g/r16KyfcUfDFaKBNMTUa1FBzeo f/8cQXQo4mN/fwZwPeW34pzGv62sRQ2Cv7/8BSPcFkwnwihJ0J6TP5uKH/S4UWsM L21tH+CrHSaDAFN50hYTDZ3Nkrjaon+6Zi+DVlB70Qg4iEHmzxhaj6cjsHN3XE9+ g9lPHuSVbpbzJHWd4zUDjZHM0oXhxyeA2PjnKTfVLu4XyN6SQt+UvwTaYHoXA7ok +eebcld4fTdIJ5pcNZgciH/yIOjSCcWhIow4qqTc3rruKg2qLXQ4reCqA== 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=nIuQAl6f fTsmt8Tpyoai1AiL/bh0r4JVLM4ejevmwPkJDHhzu0tuX1TpUrbB9ZADb7uxPqaU 4zTb9/DEvkk4OkxsGevJwnLK0y/ddo/3FeUDxoUAQgFnxS4grQO+Hyemy+dVwxmw BvsAMUK4X5wy+b8UgUh6TbJqADV3VQQaee5QPgUejsmHx/Lw8YF8neavqYF1PfBA HFt1EHVB5NB1XlwG23xncS6DkARkB4RQXNrNe4dPSE52GYJuMdXxvcdBm9+8zx92 Bgm7XvxNBI/wwtqZwFFqjTaFMEdmqI8/smyIIcrdUeMlMioywqV7s7XIb9U7eKg7 YdG9tXAGFG21Bg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrkeelgdduudegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefvhhhomhgr shcuofhonhhjrghlohhnuceothhhohhmrghssehmohhnjhgrlhhonhdrnhgvtheqnecugg ftrfgrthhtvghrnhepheefieekleefieeljedtvdehgeejvdevfedufeetleejfeethfel gfffudektdeunecuffhomhgrihhnpehpmhgurdhnvghtnecukfhppeejjedrudefgedrvd dtfedrudekgeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhr ohhmpehthhhomhgrshesmhhonhhjrghlohhnrdhnvght 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 E3483240065; Thu, 25 Feb 2021 13:23:34 -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: Thu, 25 Feb 2021 19:22:40 +0100 Message-Id: <20210225182250.1149592-8-thomas@monjalon.net> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210225182250.1149592-1-thomas@monjalon.net> References: <20190313170657.16688-1-ncopa@alpinelinux.org> <20210225182250.1149592-1-thomas@monjalon.net> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v5 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 --- 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 Thu Feb 25 18:22: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: 88247 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 18581A034F; Thu, 25 Feb 2021 19:24:21 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 70A4D160878; Thu, 25 Feb 2021 19:23:40 +0100 (CET) Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) by mails.dpdk.org (Postfix) with ESMTP id 46C0E160862; Thu, 25 Feb 2021 19:23:39 +0100 (CET) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id E14975C00C5; Thu, 25 Feb 2021 13:23:38 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Thu, 25 Feb 2021 13:23:38 -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=f1GIqfvbg4jG37+sBLiAiMdQb6uVw d3qvupIidUIJryruaBA2HwX2rcPgkfpz8fNmi6Z/R3DAhg4m0vF9w97PWrDPvCBO rQbWoPc16R08Y8BYKrpe7UYwoNxINv39VTYaQOkbd+Kd0fhMneJfgmSZVoXiydMA jqa4zvkNsmkQHwkqDvVcF57EJ54f3pUJtvSAJmQYCdJwqvJEuw7OT5p3njz7sNpm eDn4S+H1+drjDItrWYX+sU3lFwI9DTVVAxQFDf5HCxDw/T9Us6CsubtbhVE1oNz8 Of6jy60AOeCoSys63Jjml19qJNa4Omz/T/e6wsDNgR0oo1FNs4syzckdQ== 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=MCDeaMEr H89qWOZPV5Qop2SnG0GBcsGkBe5qXUfTBIPrLhpYL78+8m7DsUzI7t32TuCkVBO4 uzEoVmKVkxkeXcg3VKMhEHb9/B5Yp/4jP42EGEp/Gq47CltvyJ7H8gUCpQMO1eJp 9mWfKLRZI8eYSMTLOjhTEk1Ztpw8xvkeQgt7y3CsGz6aPP0uLkIVrG2FAkLXr69B S+/fDrh7Ckl5hbSEfsVsGZ0pf02vzPS6XrKdvIuG5nEWzbMiDM7hzBgBJiocTdLk pAbvTvTcGFGiBP2qi81o92EjqWM5Mh/08z79r9d2kPwEV4OD4XbqEsnRa5ttZmuz aUWO7Lmf8ksVkg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrkeelgdduudegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefvhhhomhgr shcuofhonhhjrghlohhnuceothhhohhmrghssehmohhnjhgrlhhonhdrnhgvtheqnecugg ftrfgrthhtvghrnhepvdehgfeivdejgedtveehfefhteelfefgieevgfffveefjeegtdfg uedthedtgeevnecukfhppeejjedrudefgedrvddtfedrudekgeenucevlhhushhtvghruf hiiigvpeegnecurfgrrhgrmhepmhgrihhlfhhrohhmpehthhhomhgrshesmhhonhhjrghl 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 B08C824005C; Thu, 25 Feb 2021 13:23:37 -0500 (EST) From: Thomas Monjalon To: dev@dpdk.org Cc: ncopa@alpinelinux.org, stable@dpdk.org, Ferruh Yigit , David Marchand , Yuanhan Liu Date: Thu, 25 Feb 2021 19:22:41 +0100 Message-Id: <20210225182250.1149592-9-thomas@monjalon.net> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210225182250.1149592-1-thomas@monjalon.net> References: <20190313170657.16688-1-ncopa@alpinelinux.org> <20210225182250.1149592-1-thomas@monjalon.net> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v5 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 Thu Feb 25 18:22: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: 88248 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 257FCA034F; Thu, 25 Feb 2021 19:24:32 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 69DF6160894; Thu, 25 Feb 2021 19:23:46 +0100 (CET) Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) by mails.dpdk.org (Postfix) with ESMTP id 255AB160803; Thu, 25 Feb 2021 19:23:44 +0100 (CET) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id C14C25C00C5; Thu, 25 Feb 2021 13:23:43 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Thu, 25 Feb 2021 13:23:43 -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=Qx+6Ddg9DkaTBfy7Ode3cLHPzYLT5 LPAN88ppGv89ur+Qcr70v9jjRyvx30SA+Of5UrvNAV0AcP3fH6WtFzs7unE8wtok 3yUIv5HpI+wQQlVE/LibjdIhiBmJUOhPN/PwmKK43sPJulxs1AjNXSSsee4Zn8Ab DKBeObO3YOwmNh7PI0ZfpS+Lb6Cdgb3T3lTCCwJmK458t4JZBN2Z+3Wk+xDCig3S pNc5hPN6pDGDLyR3n6ZF83MOwJ21DZFCWZKQbZnbhOoDMX8gzPdiyk5UfOnMkjPd dmVF+aSs83wbUHTcAYHxTK4rNFh02JrcFHb1IGqPTIHIOqa/9SXiIG1rg== 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=eInPd0Mq pKhAUVKGeHwmdN4yN4sychKUeFWm3B1zgEwrkwrl6C4qYZPOW+sSxXT0/XEiatJ8 l35GvNme9pE1UfOUlkbGIR7HbDBpQgtEiSn7Wyr07qllbUCt5JSZrX55+By/2KDI x/st2/I0aCDWy+tMI9uhmkVdTVAPBb5zFaTVsfWZTvLKnmI7xF6HM5xTAifraIH0 kFKiNwn71NnFzntErHzWlDfOEvh4LgDYbhXLH4Qz2P4TNKKtt89CsdzSQSv3twZf EiXbg7NheCMmKg2fM3LS44jRU2LP37ztrKE+aNjWnX3LrPFZadzm5aFkhx9nXVYq SsXRwztE2+RARA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrkeelgdduudegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefvhhhomhgr shcuofhonhhjrghlohhnuceothhhohhmrghssehmohhnjhgrlhhonhdrnhgvtheqnecugg ftrfgrthhtvghrnhepvdehgfeivdejgedtveehfefhteelfefgieevgfffveefjeegtdfg uedthedtgeevnecukfhppeejjedrudefgedrvddtfedrudekgeenucevlhhushhtvghruf hiiigvpeeinecurfgrrhgrmhepmhgrihhlfhhrohhmpehthhhomhgrshesmhhonhhjrghl 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 D964E240054; Thu, 25 Feb 2021 13:23:42 -0500 (EST) From: Thomas Monjalon To: dev@dpdk.org Cc: ncopa@alpinelinux.org, stable@dpdk.org, Hemant Agrawal , Sachin Saxena , Shreyansh Jain , Roy Pledge , Geoff Thorpe Date: Thu, 25 Feb 2021 19:22:42 +0100 Message-Id: <20210225182250.1149592-10-thomas@monjalon.net> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210225182250.1149592-1-thomas@monjalon.net> References: <20190313170657.16688-1-ncopa@alpinelinux.org> <20210225182250.1149592-1-thomas@monjalon.net> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v5 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 Thu Feb 25 18:22: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: 88249 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 190AAA034F; Thu, 25 Feb 2021 19:24:40 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C2D6E16089B; Thu, 25 Feb 2021 19:23:55 +0100 (CET) Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) by mails.dpdk.org (Postfix) with ESMTP id DFFE1406B4; Thu, 25 Feb 2021 19:23:54 +0100 (CET) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id 726B85C00AF; Thu, 25 Feb 2021 13:23:54 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Thu, 25 Feb 2021 13:23:54 -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=GGUonh4KawJiquhDoXxUFFWbDYCCI nUrOxUUn/eBAWGUzudJTaj6xYL+0DDA1R08BS/dqv5XbEvazMJGJvotMsj5Op8vS btn0DdJffS9JIlvwQb31BGF3MUGEXBH5pmaK+mrLdvnYHNH6qS2GacDe7ffrisDb dKJ+G8r58GlCqsoqZNrjTCRWB5mqifLSNFZiBpjXZxRK6qS8mMwzLrAnFqdW213D AU06W7Ylb0mabetTIIFfZwD2vm0q6UhFv7D/1pSrEo9XLSJKBgbRMXmb4RN93Kka K0mMHOMdwuXgep3eHTOHyop30Cw+FIzy+y+1+eZsceeaRgrQZKgXxNzAg== 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=CLR7A25L A+EKzQMTMDtSRF/EKMThlswOAm8RJ9I+7ejcE0MqusD7IUyfns8h8MPh07+oz9jE aV3eLSCocsQ6iZEW1GPuaApwjobLNttia+Jr9J+eMgzf7eKspHzpMgKjLQPuFrC+ 2EB8jOKYPs1NKz87aeZTm0jiJ/bejR2fbcWEPBkZ5jkd0f43wkCgx8TyR9rVhUtt zUG1MuFnfPXSqP8Yy+B4N79wUOdscEP5QflVszGZAwPcXf+eUL4dJ+eMpTIUh7br LGoximGxFruZop2wrNyveUCIuev1g2PtG39yt00F8GpQMZ5J+rLIPpyRGPAIHwQK p8Xady2mcOZZKg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrkeelgdduudegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefvhhhomhgr shcuofhonhhjrghlohhnuceothhhohhmrghssehmohhnjhgrlhhonhdrnhgvtheqnecugg ftrfgrthhtvghrnhepvdehgfeivdejgedtveehfefhteelfefgieevgfffveefjeegtdfg uedthedtgeevnecukfhppeejjedrudefgedrvddtfedrudekgeenucevlhhushhtvghruf hiiigvpeejnecurfgrrhgrmhepmhgrihhlfhhrohhmpehthhhomhgrshesmhhonhhjrghl 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 88162240067; Thu, 25 Feb 2021 13:23:53 -0500 (EST) From: Thomas Monjalon To: dev@dpdk.org Cc: ncopa@alpinelinux.org, stable@dpdk.org, Hemant Agrawal , Sachin Saxena , Shreyansh Jain , Roy Pledge , Geoff Thorpe Date: Thu, 25 Feb 2021 19:22:43 +0100 Message-Id: <20210225182250.1149592-11-thomas@monjalon.net> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210225182250.1149592-1-thomas@monjalon.net> References: <20190313170657.16688-1-ncopa@alpinelinux.org> <20210225182250.1149592-1-thomas@monjalon.net> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v5 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 Thu Feb 25 18:22: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: 88250 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 B0275A034F; Thu, 25 Feb 2021 19:24:46 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0EB621608A4; Thu, 25 Feb 2021 19:23:58 +0100 (CET) Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) by mails.dpdk.org (Postfix) with ESMTP id 02AE71608A2; Thu, 25 Feb 2021 19:23:57 +0100 (CET) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id 9F7835C00AE; Thu, 25 Feb 2021 13:23:56 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Thu, 25 Feb 2021 13:23:56 -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=b3mjTowMv+eMSIiumVL1x5JBO6Tdh bHb5rjeCkuD/kvtteR5U+w2T6akx9yVOaeHEljpcrqK8NLwbGMiwLxqN3rr9NWtr /1vx2LqvC+vE9bURypKtrnwulRgptWfn0WnajLAz2fSsiPh1oK7ZQMVoF0Ss+20i PbestushUBlYJ0BgoM4Wzat4gYUioEvwBYAM+FpR8roqF5F5sfVA4LEYnutLnOU9 LcPg+ofTlKF7NmDMQutP8ik3DHNJkNTnD3pXaXqWAv0C4fabVUbYKowUka1sjSGb DiaZ2p0H9umdOarQaX3QKd3VMvyEmNdhI0JBG2zPYENzn2oVt3GzVWpQw== 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=I+R4UHIS +jPi4uUH9IwRCW33Sd15TlUnTGl/UacQF9boWma4bxRp7o8ronuFYn4Ij9wgKa0B AcEkpLJUgNYMmP8/Sas/aokyqFVGV9ytqEKdGKRN52mL9IKrp/xlucosGxdp+ECq sVuaX/BnSutZAWAfm+F6FHkWh4ipTKkjGUfoLYt9P+FKtaTlCV32Xr7CRYdNAfwX XXurr1I01ugDyq5LcTDIoD9rhPSK+8r+uciZma/4BltE1yhAYkfrrQrrSpiCqJMH +jrd7RR6CFYs+rqLIN7BJ82F7uHFXmj/fJ87cC1/vte1NDOmz1f2dejz3HW1XnLZ Ng/FMUczm9FiFg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrkeelgdduudegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefvhhhomhgr shcuofhonhhjrghlohhnuceothhhohhmrghssehmohhnjhgrlhhonhdrnhgvtheqnecugg ftrfgrthhtvghrnhepvdehgfeivdejgedtveehfefhteelfefgieevgfffveefjeegtdfg uedthedtgeevnecukfhppeejjedrudefgedrvddtfedrudekgeenucevlhhushhtvghruf hiiigvpeejnecurfgrrhgrmhepmhgrihhlfhhrohhmpehthhhomhgrshesmhhonhhjrghl 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 B1D60240054; Thu, 25 Feb 2021 13:23:55 -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: Thu, 25 Feb 2021 19:22:44 +0100 Message-Id: <20210225182250.1149592-12-thomas@monjalon.net> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210225182250.1149592-1-thomas@monjalon.net> References: <20190313170657.16688-1-ncopa@alpinelinux.org> <20210225182250.1149592-1-thomas@monjalon.net> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v5 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 Thu Feb 25 18:22: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: 88251 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 E9DE8A034F; Thu, 25 Feb 2021 19:24:53 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 715FC1608B2; Thu, 25 Feb 2021 19:24:00 +0100 (CET) Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) by mails.dpdk.org (Postfix) with ESMTP id 8A70E1608AC for ; Thu, 25 Feb 2021 19:23:58 +0100 (CET) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id 33C8B5C00AF; Thu, 25 Feb 2021 13:23:58 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Thu, 25 Feb 2021 13:23:58 -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=nEX+kIBAXUiTISFSdlbH5/YLTt7dx QHNUq2IrJhDOSInbVJk25ZeHtXy1G/ojEgaiv9gY05Mmtd/moGApuNOjp5dpXKE6 3Fz4BmEmkkiesetHOfhHTzH1rqe7AEDd9vtRbQWZqnD5iyhuLkq13r3thXdR+2WC i04bCsGd6/ODiLpp+KUhgNWxIfkrQtzv9v7uaa39YkspwsWC7XTP+NaJMEHVxiHt e6eiEcJobwui+OLSPSay94Q9uqKJeJTpf8cRliLrSiUjmaKCAJZ0U5iadm2YkaSm pVjyW9pq7s1twlqTxs9OCSDtfVsbC/4sog4PiVP70RjoJkzJ7TDtCfj1A== 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=kQmHsYQt 3ybSG6PGW9UD52X31NwZzNtrK8s3+J4WSawKmq60SKP8knqPTRTbc/B5yw+3KP1+ cOBjfL/U7fwMLkGeiUO6aCFMObv1u+Wlegn88i6fMvDz0Jw0Yh1hlpCLqA3xIkoX vDHIpCDbixLXUwBW65LnkOx00aqf3qu/nHN1u5bnd5dIeozeUFcj61riHybEl/Rq s37BnkRLlG0XkmKhiLdQIWtcm9932wFN6xmJjiUnTIWRoWjkemQ3jENKxR+pGDX1 zxJ0iNsClPzZ6J4JQEiYFs3ZBPq7klDwTgILDKrL01dsUcRKnIh3fUMT/DK1pCv7 A6US/xRqZu65cQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrkeelgdduudegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefvhhhomhgr shcuofhonhhjrghlohhnuceothhhohhmrghssehmohhnjhgrlhhonhdrnhgvtheqnecugg ftrfgrthhtvghrnhepvdehgfeivdejgedtveehfefhteelfefgieevgfffveefjeegtdfg uedthedtgeevnecukfhppeejjedrudefgedrvddtfedrudekgeenucevlhhushhtvghruf hiiigvpeelnecurfgrrhgrmhepmhgrihhlfhhrohhmpehthhhomhgrshesmhhonhhjrghl 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 9890A240067; Thu, 25 Feb 2021 13:23:57 -0500 (EST) From: Thomas Monjalon To: dev@dpdk.org Cc: ncopa@alpinelinux.org, Hemant Agrawal , Sachin Saxena Date: Thu, 25 Feb 2021 19:22:45 +0100 Message-Id: <20210225182250.1149592-13-thomas@monjalon.net> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210225182250.1149592-1-thomas@monjalon.net> References: <20190313170657.16688-1-ncopa@alpinelinux.org> <20210225182250.1149592-1-thomas@monjalon.net> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v5 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 Thu Feb 25 18:22:46 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Monjalon X-Patchwork-Id: 88252 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 4C7C3A034F; Thu, 25 Feb 2021 19:25:00 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BA8F91608BB; Thu, 25 Feb 2021 19:24:02 +0100 (CET) Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) by mails.dpdk.org (Postfix) with ESMTP id AED451608B5; Thu, 25 Feb 2021 19:24:00 +0100 (CET) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id 57B235C0118; Thu, 25 Feb 2021 13:24:00 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Thu, 25 Feb 2021 13:24:00 -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=zUHnRvUZMo0g0ZKh F3oEAXqFKUBGXB13QA6xVSqfZXVOhbNV3/BU0KvXloBzzeSt3GJ7T6YVN4zi32CD HmQkrGp1QakZl9LL/SQE2ZpiKmV0CSDN8Qr7DbHp+EqUz3lSq0y4z/OvNNx0PUYG WNmUPGWriar5sQMG4fZYK1ghxGOiuPse3W0iLdgWJqiOc24e63kRlrkIo+5AsALs ta56D9UNokBKBunau24ygYoD6T18HbrTjCVak9PM1SSMmtsFnYl7xD1BbW+8Ejtv NlltmyoxPewc7sRp3XLZ4VXDqnXnVT2OHMcG1WaWRwI1d5UXQZ4jORmx0qHE2Yyk rBSdWQ== 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=hpArDNXsUCY5NT5g4Hnc8CYytMNsARI8XA6V5UhqLZRpCII9QhiLSfu5P Q83IzqRwZPiNyHv5x5cjAOpnrEPH9ZGW0I8Iio/jxtjpvlZp5XDSoTUV2xRy6hRE HfTwSdhgO4bHm+3XzFwP9cvYJ5ZEkFsOFJfjZlu0pnRyvjeTvnivF1C0wxRvrz8m TmHNXLfvXqN8j5K02GLvKkK/CO2X4QFLA3DnHPXRXgiPuYNL1NgokORgL2UDuSL2 T01nolB2fJ4ivS1OvpK0v/ANy8e4tR0JH+6/coQcfwy/bAeFcOp40QEWpgqi7YtG SztNhVJz4Qe50XHfADoM9p3i1vz/g== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrkeelgdduudegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffojghfgggtgfesthekredtredtjeenucfhrhhomhepvfhhohhm rghsucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenuc ggtffrrghtthgvrhhnpeevuddtveeuveejkeevheehveffueegjedukeffledtleekieef geduhedvgeejhfenucfkphepjeejrddufeegrddvtdefrddukeegnecuvehluhhsthgvrh fuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepthhhohhmrghssehmohhnjhgr lhhonhdrnhgvth 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 45690240069; Thu, 25 Feb 2021 13:23:59 -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: Thu, 25 Feb 2021 19:22:46 +0100 Message-Id: <20210225182250.1149592-14-thomas@monjalon.net> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210225182250.1149592-1-thomas@monjalon.net> References: <20190313170657.16688-1-ncopa@alpinelinux.org> <20210225182250.1149592-1-thomas@monjalon.net> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v5 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 Thu Feb 25 18:22: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: 88253 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 50324A034F; Thu, 25 Feb 2021 19:25:08 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6D3A81608CB; Thu, 25 Feb 2021 19:24:04 +0100 (CET) Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) by mails.dpdk.org (Postfix) with ESMTP id 58C5A1608B8; Thu, 25 Feb 2021 19:24:03 +0100 (CET) Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 01FB25C00AE; Thu, 25 Feb 2021 13:24:03 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Thu, 25 Feb 2021 13:24: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=uu8aiLROoSxfs 9RGUBtOq4CatSVqm0Yc+cuPt5IiRz0=; b=iCRTdFyrXMh2VjkPTRfmtCbw2qCg0 780go7bFJB1g5kc1Kkhq4AO9d7lGpaZMU5cSBDwQ9EpGbNTyVbUE/nBe+fEDDChE Eb8Mg579PAjxFHbhxFgT5z6lGDp3QZ+kxoSokomX2zmNebRYGXmeyObW9mSgU0ZG P0x1TwtJ2OLquaADbCnrpKT+AI68sEI1o/RiZUpzmQtXB9/gfmgcBzRUkwN/vstt YqxBUIPakZrAX/PVElxSuH69ydtR/ej809mpRuGVj7qbXCdNQcXQTC9FDk+H5S+b At+11iXkeZmflmrpBrwOsltDYxhVdB1UQD6RNSU/Zsrq/g6Oxu/KBRhmA== 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=uu8aiLROoSxfs9RGUBtOq4CatSVqm0Yc+cuPt5IiRz0=; b=QxL86WAL 6KeYCSOwA4I7YCg43navvITvqBxROAmnY43gSURpXF695rn1BnmLxk+BtyvkVj7g HnerLCeJ6Fp+Eto6exbJNSUmQL0Nz1YHt5hNBo6B+eDTj36CQgE4YEIVfeZYUYF+ WcjaZfCeknlTT1qUWIp/5G+c8CgepH6qG8QUpiBmYQckAVKpR3WWeogfHBZ8ug8H qPKRN3jVvq0WfBJfdgqrknyuNyzKp7JphWmUNRIVxCtGvpoGD93NNHxZD7UIyKGJ g2aMmAgy6bb+bNBCv1SgwV2m9DbCXAz/o5PMIRwhImMWryUvdMIEPmUvomclIBch yqqX15wJyJaRbA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrkeelgdduudegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefvhhhomhgr shcuofhonhhjrghlohhnuceothhhohhmrghssehmohhnjhgrlhhonhdrnhgvtheqnecugg ftrfgrthhtvghrnhepvdehgfeivdejgedtveehfefhteelfefgieevgfffveefjeegtdfg uedthedtgeevnecukfhppeejjedrudefgedrvddtfedrudekgeenucevlhhushhtvghruf 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 955A8240066; Thu, 25 Feb 2021 13:24:01 -0500 (EST) From: Thomas Monjalon To: dev@dpdk.org Cc: ncopa@alpinelinux.org, stable@dpdk.org, David Marchand , Jeff Guo , Haiyue Wang , Ferruh Yigit , Alvin Zhang Date: Thu, 25 Feb 2021 19:22:47 +0100 Message-Id: <20210225182250.1149592-15-thomas@monjalon.net> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210225182250.1149592-1-thomas@monjalon.net> References: <20190313170657.16688-1-ncopa@alpinelinux.org> <20210225182250.1149592-1-thomas@monjalon.net> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v5 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 Thu Feb 25 18:22:48 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Monjalon X-Patchwork-Id: 88254 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 7686CA0547; Thu, 25 Feb 2021 19:25:19 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9EECF1608DD; Thu, 25 Feb 2021 19:24:06 +0100 (CET) Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) by mails.dpdk.org (Postfix) with ESMTP id 4FEAA1608D0; Thu, 25 Feb 2021 19:24:05 +0100 (CET) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id ECD9F5C0120; Thu, 25 Feb 2021 13:24:04 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Thu, 25 Feb 2021 13:24:04 -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=chPQBIQkBE0qZMq2lVZj62j5QKZBV 3cHmOrSV/E4WJI/vDLg9Mclf3w2jEEgACgkIwPOpDeg0S01qTjuRDGQKepjm+NqP pulbusGdCot2aTwMuCE4mUMPsbCabQNgbwJMhDw4aZbCW0tR9wf0X4bNEi0yBOLD xY/5bF8jy6kqBKGbIEHDNOo4eniMBsUMee6owB4KPHWBNsaT00mpZuo8NpZTHI4/ /BJvSjWhRQFpJXFevSyk0eU29d95jNeEBYW5y182UX1HN2UTLjvbvkP7Na0XgrOl dV2UlFeWFs7q2SdRL71DfsSnSoC0F/8gaTH4LnQpFQKLRgMSR0A3y0uLA== 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=keXBTcIZ EwGQ1IikumEu06Htx8WvpOWRrRen8knAXijRGnlxjpYj8yoX2ndZJ1ljXvM7r86Y 5p7JTH8IQ3t1FWYx2KIucwrSp2PYScJA0bucZYcqq1bSTVDQDicsulYgUyw9eGRU 5ShXVhhYBQYbrpmO6aGaI41stdIdQvkZxGVNz/Kf1avB7GA/j7q6lsI/CVke7slp ttr+Uu3qlL9vMhLD/DFyTsi/098Z7ip4Dh51EPP8dwxer5KdcZoORdgkLbwdUz8q Ee0smENPd+r7drneiH3r12INMyXbDibqSpVMgtqT+GF66FyeQ00USe/duNRO6/DA B2J+dMfq8/9uYw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrkeelgdduudegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefvhhhomhgr shcuofhonhhjrghlohhnuceothhhohhmrghssehmohhnjhgrlhhonhdrnhgvtheqnecugg ftrfgrthhtvghrnhepvdehgfeivdejgedtveehfefhteelfefgieevgfffveefjeegtdfg uedthedtgeevnecukfhppeejjedrudefgedrvddtfedrudekgeenucevlhhushhtvghruf hiiigvpedutdenucfrrghrrghmpehmrghilhhfrhhomhepthhhohhmrghssehmohhnjhgr lhhonhdrnhgvth 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 E575524005C; Thu, 25 Feb 2021 13:24:03 -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: Thu, 25 Feb 2021 19:22:48 +0100 Message-Id: <20210225182250.1149592-16-thomas@monjalon.net> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210225182250.1149592-1-thomas@monjalon.net> References: <20190313170657.16688-1-ncopa@alpinelinux.org> <20210225182250.1149592-1-thomas@monjalon.net> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v5 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 Acked-by: Matan Azrad --- 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 Thu Feb 25 18:22:49 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Monjalon X-Patchwork-Id: 88255 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 52645A034F; Thu, 25 Feb 2021 19:25:27 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3611D1608EE; Thu, 25 Feb 2021 19:24:08 +0100 (CET) Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) by mails.dpdk.org (Postfix) with ESMTP id 98E3916080A; Thu, 25 Feb 2021 19:24:07 +0100 (CET) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id 40CE75C00C5; Thu, 25 Feb 2021 13:24:07 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Thu, 25 Feb 2021 13:24: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-type:content-transfer-encoding; s=fm3; bh= uuctzikRObxp0/hu4uvMy6utWUI8ejyogHL8LYIO85g=; b=tdbO4XBR3hkSx5uR KXcHTynsLmMjV8LAwwziqEyAi8yQ/OdOgsqutBz8BTroiBmWGYbIhFrBbIzOA9H/ 0JUHF/tZgXzRRXbwMgVpMgwT9tWhww0b8Qt9HOSsJf8Mzqx5mC8GlvLoDYSt0zjw yRo26ypkLVFNwzd6igfmnH8VfCE3ShrXeJtojZqLf8zCnqSgYqVfXMjklSUbffc/ vggny9lTGBCehC2TVxtjeRmmufGeggTZ27Jlyqmfurj8L9BS6vgKFBIDKBOljz0T 3nzWGX0GvIiQeV+akGsVOfM+x8QKwglCd6LVAZCMxiH56UnjFTDN5AZZwsaihzmv eXa9eA== 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=GAFqVXxyEfALvJdqQfGdzczKIlr3kbiQ2pvD61FXhMKW2eqaQKj/GxWtj +P8uRU8kSJIsdA6jbooSbqJWJJogZPKscfOGtIHgDZSBUXW1ESlmc8Ch3qshyxuD MliFwjBF1tpNjWxD173bcF0KlIPpEOMp3siqRZYqU7Oyxf3gk/KT3DnnZuGvzG7c GqbMTGQwd3s1hxy/g+1o9rLcaZMazo0sAFTzwG936lGf684yR7wLfAVc9PluuOFg /gPFQngcs6d99DQiEYR+KPjld0lAkdIUH/CNMBN2drYNlkpzfy9yZgcQ9e0sppvZ ZWLOcJpEByeTJrb+fEoaomr7TJFRg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrkeelgdduudegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffojghfgggtgfesthekredtredtjeenucfhrhhomhepvfhhohhm rghsucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenuc ggtffrrghtthgvrhhnpeevuddtveeuveejkeevheehveffueegjedukeffledtleekieef geduhedvgeejhfenucfkphepjeejrddufeegrddvtdefrddukeegnecuvehluhhsthgvrh fuihiivgepudenucfrrghrrghmpehmrghilhhfrhhomhepthhhohhmrghssehmohhnjhgr lhhonhdrnhgvth 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 0E419240054; Thu, 25 Feb 2021 13:24:05 -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: Thu, 25 Feb 2021 19:22:49 +0100 Message-Id: <20210225182250.1149592-17-thomas@monjalon.net> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210225182250.1149592-1-thomas@monjalon.net> References: <20190313170657.16688-1-ncopa@alpinelinux.org> <20210225182250.1149592-1-thomas@monjalon.net> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v5 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 Thu Feb 25 18:22: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: 88256 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 804BDA034F; Thu, 25 Feb 2021 19:25:33 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 60BF11608EB; Thu, 25 Feb 2021 19:24:10 +0100 (CET) Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) by mails.dpdk.org (Postfix) with ESMTP id 4E4321608E6; Thu, 25 Feb 2021 19:24:09 +0100 (CET) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id EB6D75C0120; Thu, 25 Feb 2021 13:24:08 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Thu, 25 Feb 2021 13:24:08 -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=pfFMFcJ2BGzJKCZEILWDIsEQK30tK /ycIHIF7oXt8Yj2GmSEZNtkHAQmTKYTwuj/R9XKmZaQfnYgzhVYCetgol+16hwy3 j4SvdUC3mRAf+E9bLV5YHsYdKoDi2n6tJqOINsKWEv2ezSjTMmSAIYAK05bv2dJ8 8IixWwyDtxXWqXtDuHQpZttvo7Tmw7IDmXu9ANZ9ygmdWOR4HGl9GNuO4OqFJ7mC s0iOXW99Af/y7WUSLmyxqQK82RfJbo//bhrqd8vIjlZZnpnGUNzxiXnr3hTqAUcn 56ug25cQPE5U6kPgLP2dqVGyehQg11f7sFKVdPNlDcdD51XrQQ8M+Nwjw== 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=jSgU47r7 7CvUnoHBZZ466MPYELxJUzbcEa1yxB/OX7GhAhn4jecLWENGoOiHQBhYQ3vO+Lik JvrFooktyawkpQi+/HfDPnOn78zEF8xbjw7ib7HwvFF4JzHpS+94sFC1utLItPWf Vqj+IULjT2f9PtWXMkmdmfzPktc0eT9QErRGLtQQUr24MXDfUe8Ql/NEG3v/Ni/K tkAEv1FVMSKHf2Ea7RcoH+2pPQtOuSR5BpJeJEwyNeKbGnOcOcMSRt29CTx7XVOy fqbnssZW7q4cdu/22S6KW3SW2pJ1Tg/GTsxQFE66+fEXq9YbBFYYX+WH6ikbEwOe ibEzU/Mt35FwkA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrkeelgdduudegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefvhhhomhgr shcuofhonhhjrghlohhnuceothhhohhmrghssehmohhnjhgrlhhonhdrnhgvtheqnecugg ftrfgrthhtvghrnhepvdehgfeivdejgedtveehfefhteelfefgieevgfffveefjeegtdfg uedthedtgeevnecukfhppeejjedrudefgedrvddtfedrudekgeenucevlhhushhtvghruf hiiigvpedutdenucfrrghrrghmpehmrghilhhfrhhomhepthhhohhmrghssehmohhnjhgr lhhonhdrnhgvth 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 4033924005B; Thu, 25 Feb 2021 13:24:08 -0500 (EST) From: Thomas Monjalon To: dev@dpdk.org Cc: ncopa@alpinelinux.org, stable@dpdk.org, Nicolas Chautru , Amr Mokhtar Date: Thu, 25 Feb 2021 19:22:50 +0100 Message-Id: <20210225182250.1149592-18-thomas@monjalon.net> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210225182250.1149592-1-thomas@monjalon.net> References: <20190313170657.16688-1-ncopa@alpinelinux.org> <20210225182250.1149592-1-thomas@monjalon.net> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v5 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