From patchwork Fri Mar 19 14:57:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Monjalon X-Patchwork-Id: 89556 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 1EF9EA0579; Fri, 19 Mar 2021 15:57:47 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2C8CA140EB4; Fri, 19 Mar 2021 15:57:42 +0100 (CET) Received: from new2-smtp.messagingengine.com (new2-smtp.messagingengine.com [66.111.4.224]) by mails.dpdk.org (Postfix) with ESMTP id 33463140EB3; Fri, 19 Mar 2021 15:57:41 +0100 (CET) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailnew.nyi.internal (Postfix) with ESMTP id 97F32580AE9; Fri, 19 Mar 2021 10:57:40 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Fri, 19 Mar 2021 10:57:40 -0400 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=oBJfk5dPM6vLo EJLwM903/qACALaFGxqUTALNyl/rjY=; b=kIxuGmwp+1gYcit39wtJVQifIyRB0 WFRhvLpi3GrbLOp7OHaa5gCh6Wk8EdMcnlNDsCx7hRgRA6xwLnk7DoFpVTwwxEsg Qe3bZgrc571LlvVIE4S4KHCuA3iO3ApIcR5LRvJRJrDrrzIpJInAUqR8tz27/SFo +pWnQjdwISl7KKBQM0vljM3QvRyO9IGcfyC/wb/8LztTYvzC5TyU0nSS8YsChFxJ j+Y56Oy/EeTj/x0wIOtgcTq+djwEnJUZ0h8aOlNl5goPBszEkl3gGOKiNsi8oZic St9JUZm2McCLFVRxucqI9stOTQwVOPaGK5ZGBuV2jSHQNmqKxrRW6/MVg== 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=oBJfk5dPM6vLoEJLwM903/qACALaFGxqUTALNyl/rjY=; b=pbGLlEy2 15Cnn0vVQtRK1/3TrNgZhH0pJcruHJSDYdHEtCjN6og0S5iEkiPaNOZ9gwURjJI4 PxHFde7uachpEK9jUfPbudQ+JvzbL06VGdxH/gmWpIN3VhsBwrE6LhNo9Sx6JinU 22YoPLTMvRmaw2P7BJ9sLsbPBAuzfg/i+A/LNFpWX5yRWBaiUM96grwJ2Ua72mId UgJx9Cj+J2vfBSAPknF0v4QkD4tEBsLBhiKy3KmXasYQTvGEnWJKn5IkgymE0rFC ygaq3wr5OGV/1usfLCZNnvHIsmqs9AtvAoO/+wZ71at2qrL7XlIVR2C1nQLLTw0x pjFFTSiRlCLcsg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrudefkedgjeduucetufdoteggodetrfdotf 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 94CB0240066; Fri, 19 Mar 2021 10:57:38 -0400 (EDT) From: Thomas Monjalon To: dev@dpdk.org Cc: ncopa@alpinelinux.org, stable@dpdk.org, Andrew Rybchenko , David Marchand , Bruce Richardson , Dmitry Kozlyuk , Narcisa Ana Maria Vasile , Dmitry Malloy , Pallavi Kadam , Anand Rawat , Harini Ramakrishnan Date: Fri, 19 Mar 2021 15:57:14 +0100 Message-Id: <20210319145730.3555384-2-thomas@monjalon.net> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210319145730.3555384-1-thomas@monjalon.net> References: <20190313170657.16688-1-ncopa@alpinelinux.org> <20210319145730.3555384-1-thomas@monjalon.net> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v7 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 Acked-by: Andrew Rybchenko Acked-by: David Marchand --- 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 Fri Mar 19 14:57:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Monjalon X-Patchwork-Id: 89557 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id C1DC1A0562; Fri, 19 Mar 2021 15:57:58 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 19D91140EEB; Fri, 19 Mar 2021 15:57:47 +0100 (CET) Received: from wnew3-smtp.messagingengine.com (wnew3-smtp.messagingengine.com [64.147.123.17]) by mails.dpdk.org (Postfix) with ESMTP id B37D8140ED3; Fri, 19 Mar 2021 15:57:44 +0100 (CET) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailnew.west.internal (Postfix) with ESMTP id CFBA01328; Fri, 19 Mar 2021 10:57:42 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Fri, 19 Mar 2021 10:57:43 -0400 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=TrTC4O5POxyjr dYegNHDsMuQIymsCGMDrQ0VfV75s8Y=; b=zcnn/yDt+RcWk8JkPK6ZcLdQuzTM8 ablpmCHC2ApgJ+PfTAygFsm8FkVMZQ7r1Rq3QnCTqo/zO9rZISlCQ63pH6Nj9gRl tk88QojGJILM+T0nymAWa601qmvT4APOat7+jTj+r0u0lh3uyOYh8quhhOHZEfSt GBi/kaeqvO3xSW2sAY3SOMv4v3mSmaJFpmoBdVw+YDZ9CUDl4vNCiauRgBvODmTQ g4qReXpRAmq4xVGJXv6BVLBjURIPKXQfTX1jl3mTLhWw87rOksM5E5WW9pZ9hsOf IPyp65Eukaq7RheakenLLIvm37hKKQ1X7PzoFPIUWKY0Ek3Lk1QckhyXw== 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=TrTC4O5POxyjrdYegNHDsMuQIymsCGMDrQ0VfV75s8Y=; b=DpurK6q/ 48oXi+bxueGcQH9c2bsQDZzbJIS42cjYsxScw4ZbhL4iyIsuP9M4i6X3yKLGMwmx +Z3FDX2xnh9Ky6ZtMAXFIRKB2E/rzXTHHnNIZTeTmFfVwuslQgGsakNu/D7NBLbs 80P+M0aaPudB3xyRjyAzDAg8Fyp0rVGHI1cv3hQELElHjeX1y/h7Y5SIEMxUgvwJ hAaFNznU0SRD5iKQW8qH+zX+lsMIfdirwxmHjw7dmQLOEhrfWacWEjGn6JPxqkq5 x2a43O686NfxFprhH/HBH4phyFC4BWWyM8pfAdyV7n8YtrFG1qE6YbMMCEpdBLMg JLBC/zi9Sybtlw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrudefkedgjeduucetufdoteggodetrfdotf 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 BD6CB24005A; Fri, 19 Mar 2021 10:57:40 -0400 (EDT) From: Thomas Monjalon To: dev@dpdk.org Cc: ncopa@alpinelinux.org, stable@dpdk.org, Bruce Richardson , Andrew Rybchenko , David Marchand , Konstantin Ananyev , Ray Kinsella , Neil Horman , Haiyue Wang , Adrien Mazarguil Date: Fri, 19 Mar 2021 15:57:15 +0100 Message-Id: <20210319145730.3555384-3-thomas@monjalon.net> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210319145730.3555384-1-thomas@monjalon.net> References: <20190313170657.16688-1-ncopa@alpinelinux.org> <20210319145730.3555384-1-thomas@monjalon.net> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v7 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 Acked-by: Andrew Rybchenko Acked-by: David Marchand --- 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 Fri Mar 19 14:57:16 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Monjalon X-Patchwork-Id: 89558 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 43CD6A0562; Fri, 19 Mar 2021 15:58:07 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2E567140EF3; Fri, 19 Mar 2021 15:57:48 +0100 (CET) Received: from wout5-smtp.messagingengine.com (wout5-smtp.messagingengine.com [64.147.123.21]) by mails.dpdk.org (Postfix) with ESMTP id 4BEF0140ED3; Fri, 19 Mar 2021 15:57:45 +0100 (CET) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.west.internal (Postfix) with ESMTP id 00D4B1439; Fri, 19 Mar 2021 10:57:43 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Fri, 19 Mar 2021 10:57:44 -0400 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=ueT/cLtqKkpjG A8skqqz3Gg3qYMk7KPtdoHxLpSLv/8=; b=fVWfuZzWO8EJjrNjYJtW2PEiTUo1S 4TKGRTE5mWKxzylkI+a08BqOmIlRAs4dAw2o1BlH/enSD/v2U2WqH/6c3abRDx42 /sZ82zT6xuik1oxE1EMKsR4CvJ4lTKf5fTkPg8u+UIwulp2yYZxlncIHFSiFcvvc bTluj7qXsmn+/OckSe5tHtYHpygC0PnhFX2Px5tgEGZlElpxToZVjwMKpOlE9Rd8 sCMPao0GAaJBkbSD9Ezp6Ui/GIiCoL2OFYS4H+rlKomQiAVMKnQlol3l0eZXPK/o jeddTN4iuLfgDLF61NopVQ6njIQHaeaONPfoOaMIZaxuuPNeDUHlOM8iA== 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=ueT/cLtqKkpjGA8skqqz3Gg3qYMk7KPtdoHxLpSLv/8=; b=YOsqzH5C QQeBBjKEwnrPDzmREeCoZqQRNANyP6wti/6a3bbfQyrBy80gBU11mH7Hg1y52Ce9 hvHXqw+CdVUT9hpENkfhmAJSEXHRZhtX357euiKoNYbckhGx5HIDr4L56sCCb9ay KuH0EarWSv2hNCV78Z92c5RXfi6hEJEpOwSGsJWqrzx6Vtd3bL6shirsfsHUusdP YE1zEql6qB8ktG8cWdMT7LORWZOD6PdQfwJnMBuSLZyCxCk1kK2ZwiixWshib6zB iJ7E/cC5tsEQ4edyEta9qYFcGzBLGCdgq//moSQ1lFiGFcKIiYpSLpTlrKp57/nl nrXwavQevtWnSQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrudefkedgjeduucetufdoteggodetrfdotf 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 C489B240067; Fri, 19 Mar 2021 10:57:42 -0400 (EDT) From: Thomas Monjalon To: dev@dpdk.org Cc: ncopa@alpinelinux.org, stable@dpdk.org, Bruce Richardson , Andrew Rybchenko , David Marchand Date: Fri, 19 Mar 2021 15:57:16 +0100 Message-Id: <20210319145730.3555384-4-thomas@monjalon.net> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210319145730.3555384-1-thomas@monjalon.net> References: <20190313170657.16688-1-ncopa@alpinelinux.org> <20210319145730.3555384-1-thomas@monjalon.net> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v7 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 Acked-by: Andrew Rybchenko Acked-by: David Marchand --- 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 3fe08d4ca5..d065a6a08b 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', @@ -82,7 +80,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 Fri Mar 19 14:57:17 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Monjalon X-Patchwork-Id: 89559 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id A6C0CA0579; Fri, 19 Mar 2021 15:58:17 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8EAE2140F11; Fri, 19 Mar 2021 15:57:50 +0100 (CET) Received: from new2-smtp.messagingengine.com (new2-smtp.messagingengine.com [66.111.4.224]) by mails.dpdk.org (Postfix) with ESMTP id 38BC3140EEE; Fri, 19 Mar 2021 15:57:47 +0100 (CET) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailnew.nyi.internal (Postfix) with ESMTP id 93D77580AE9; Fri, 19 Mar 2021 10:57:46 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Fri, 19 Mar 2021 10:57:46 -0400 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=aXpO3KZ8l6wjQ Kb5qRd292XIdaYkzE94txF2iB+0xu0=; b=bY3sbgXqxn0BaXi3JK5Rt+0HrEyyJ A1wg4mUi4NivbPZHDJkNdEMMPNytnfErbD5TbOiR6Ff+0ijcE3H+FYB3+c1hZ+St VMHlY/OK7WsM+Hzz8YPEPHd0FmeviFPEjPljFtvNwcomwW3mFbnupcq/1xyS+O2Z FVUc7tj8iqsafoQDOUQ9q2Zro7FeCGoRwJ565wqjqBcvHYxPmlcMZBV33F7KW2P9 r7FwQuA/QFHlgzh915EFLzKsE7nDC5Z/ZisKT9vPY1bWDv/hugvJfJsJ0HSM0c30 JGzcDycftNNPitBrt2XnKefkWz4ZAbBkTh7y+pf+r44Zv6pcExgJV9Jvw== 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=aXpO3KZ8l6wjQKb5qRd292XIdaYkzE94txF2iB+0xu0=; b=PBzK5oHw +XwreEnTyfYi/Lgo2DVH+jSWWKmfXIxCsdKxxBU9RD8RU8yfM3h8bpNOK1aVBzfv FQlL4zIKREYe2YzSVUo02OzF6cNVCuZecodZKnYB9wiC2R8N7Zi+l+LCBxkTUp9J hBXRViZ5pCNr75XAxYtyKBQHnmaJObe6DmTfGyCILYsOdUZJLFZTOJHusnAh64LN 9BRce2PjL1uLzctU+8cCLC6teIq5aAREJRiHk3kwh/BiOCohPP8woqDl8FOwgjkh BH/mX2n2XPmbKwJ8nSlL3flvTd8Dmr0ck/Y2XeS/PnxHek5yu1mmQ55fGcZAEk9m jyIjuDVS2Tuzbg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrudefkedgjeduucetufdoteggodetrfdotf 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 65CDE24005A; Fri, 19 Mar 2021 10:57:44 -0400 (EDT) From: Thomas Monjalon To: dev@dpdk.org Cc: ncopa@alpinelinux.org, stable@dpdk.org, Andrew Rybchenko , David Marchand , Hemant Agrawal , Sachin Saxena , Jakub Grajciar , Matan Azrad , Shahaf Shuler , Viacheslav Ovsiienko , Anatoly Burakov , Konstantin Ananyev , Marcin Smoczynski , Xiaoyu Min , Xueming Li Date: Fri, 19 Mar 2021 15:57:17 +0100 Message-Id: <20210319145730.3555384-5-thomas@monjalon.net> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210319145730.3555384-1-thomas@monjalon.net> References: <20190313170657.16688-1-ncopa@alpinelinux.org> <20210319145730.3555384-1-thomas@monjalon.net> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v7 04/17] build: remove redundant _GNU_SOURCE definitions X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" The feature macro _GNU_SOURCE is defined globally, but there was some remaining useless settings. The internal definition in config/meson.build is kept, all other internal definitions of _GNU_SOURCE are removed, except in examples, which can be built as external applications. Note: external applications do not inherit of _GNU_SOURCE. Fixes: 5d7b673d5fd6 ("mk: build with _GNU_SOURCE defined by default") Fixes: 28188cee2aa0 ("build: enable BSD features visibility for FreeBSD") Fixes: e6cdc54cc0ef ("net/mlx5: add socket server for external tools") Cc: stable@dpdk.org Signed-off-by: Thomas Monjalon Acked-by: Andrew Rybchenko Acked-by: David Marchand --- app/test/meson.build | 2 -- drivers/bus/fslmc/qbman/include/compat.h | 3 --- drivers/common/dpaax/compat.h | 4 ---- drivers/common/dpaax/meson.build | 1 - drivers/net/memif/rte_eth_memif.h | 4 ---- drivers/net/mlx5/linux/mlx5_socket.c | 4 ---- 6 files changed, 18 deletions(-) diff --git a/app/test/meson.build b/app/test/meson.build index 099895fc87..76eaaea457 100644 --- a/app/test/meson.build +++ b/app/test/meson.build @@ -398,8 +398,6 @@ if cc.has_argument('-Wno-format-truncation') cflags += '-Wno-format-truncation' endif -# specify -D_GNU_SOURCE unconditionally -cflags += '-D_GNU_SOURCE' # Strict-aliasing rules are violated by uint8_t[] to context size casts. cflags += '-fno-strict-aliasing' diff --git a/drivers/bus/fslmc/qbman/include/compat.h b/drivers/bus/fslmc/qbman/include/compat.h index 1ddd69e127..a4471a80af 100644 --- a/drivers/bus/fslmc/qbman/include/compat.h +++ b/drivers/bus/fslmc/qbman/include/compat.h @@ -8,9 +8,6 @@ #ifndef HEADER_COMPAT_H #define HEADER_COMPAT_H -#ifndef _GNU_SOURCE -#define _GNU_SOURCE -#endif #include #include #include diff --git a/drivers/common/dpaax/compat.h b/drivers/common/dpaax/compat.h index 1a5f36e99e..c69e76ab96 100644 --- a/drivers/common/dpaax/compat.h +++ b/drivers/common/dpaax/compat.h @@ -10,10 +10,6 @@ #define __COMPAT_H #include - -#ifndef _GNU_SOURCE -#define _GNU_SOURCE -#endif #include #include #include diff --git a/drivers/common/dpaax/meson.build b/drivers/common/dpaax/meson.build index 4535482701..b7f177a62e 100644 --- a/drivers/common/dpaax/meson.build +++ b/drivers/common/dpaax/meson.build @@ -10,7 +10,6 @@ sources = files('dpaax_iova_table.c', 'dpaa_of.c', 'caamflib.c') includes += include_directories('caamflib') -cflags += ['-D_GNU_SOURCE'] if cc.has_argument('-Wno-cast-qual') cflags += '-Wno-cast-qual' endif diff --git a/drivers/net/memif/rte_eth_memif.h b/drivers/net/memif/rte_eth_memif.h index 24321d3a39..2038bda742 100644 --- a/drivers/net/memif/rte_eth_memif.h +++ b/drivers/net/memif/rte_eth_memif.h @@ -5,10 +5,6 @@ #ifndef _RTE_ETH_MEMIF_H_ #define _RTE_ETH_MEMIF_H_ -#ifndef _GNU_SOURCE -#define _GNU_SOURCE -#endif /* GNU_SOURCE */ - #include #include diff --git a/drivers/net/mlx5/linux/mlx5_socket.c b/drivers/net/mlx5/linux/mlx5_socket.c index 1938453980..b1f41bc102 100644 --- a/drivers/net/mlx5/linux/mlx5_socket.c +++ b/drivers/net/mlx5/linux/mlx5_socket.c @@ -2,10 +2,6 @@ * Copyright 2019 Mellanox Technologies, Ltd */ -#ifndef _GNU_SOURCE -#define _GNU_SOURCE -#endif - #include #include #include From patchwork Fri Mar 19 14:57:18 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Monjalon X-Patchwork-Id: 89560 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id D195CA0562; Fri, 19 Mar 2021 15:58:25 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C6B88140F24; Fri, 19 Mar 2021 15:57:51 +0100 (CET) Received: from new2-smtp.messagingengine.com (new2-smtp.messagingengine.com [66.111.4.224]) by mails.dpdk.org (Postfix) with ESMTP id DD42C140ED9; Fri, 19 Mar 2021 15:57:48 +0100 (CET) Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailnew.nyi.internal (Postfix) with ESMTP id 90B71580AFA; Fri, 19 Mar 2021 10:57:48 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Fri, 19 Mar 2021 10:57:48 -0400 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=3W3RXk0RiUPcF IQnQnvKpgFuJV/frxbCOSiCNf1hGyE=; b=3b1Oyw/ivv4zUndbxBQA9b2g+UxxL d9llGuqVNmJL2Vg2pCBMx9uk95RFLbulD/2MRtd6p4/VXdfaAdRI3w32vgJRceyZ GN3P1bOzwxrSdBha6jmq6FYnby1E1hB/nWU8FmKEpvAdMMQBhhSqIU3jhipcHlzX WOtysZ8+qfKHEI86yUEp7HJdbTvFCIUUMlTfepUPgg5I0qZN1VMWFolnuHxNmzTV jho/MAf2wcgGoZmeS1cQ0WEvqlJWsgzX5shXaIqthhDnd8EX7IWC8IEOIE5hrYiN U0g0ai/tTC8LdDzR4rovH7uWDPN9bg0Z1dcuEHSZSRxZtH1BQUtN2k8eg== 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=3W3RXk0RiUPcFIQnQnvKpgFuJV/frxbCOSiCNf1hGyE=; b=sFUtThTb /7W8CVBavBVLDWByTmopVuvuDLabvbtMwuNiEnZNY4rNB4rBFogrYOSZq7S24vKx P8wFAfs0uFXCDOfMf97nyH+9t2MSIF3BxTGhg3DiNxITxbxAXeB9HVSQWqd5DjiO F7S0zHiJJlunGPLSJRUw93uV31i2AdnseZsJeXigBzHSElDV0ymnv+yhi7RO85fh vqZwVcINXS1CITJL3Y0jTblA9cwv6xxsoPw/wt1x+DJpVCQzr3rPSdBv3fZnidEs CTCGwsPdfT7qekynOgKOWYJe4XovIj0rnlaCeMB6yEyg1Lqhf/DgSIJbloLR6rlK dNuEQtLELoESnA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrudefkedgjeduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefvhhhomhgr shcuofhonhhjrghlohhnuceothhhohhmrghssehmohhnjhgrlhhonhdrnhgvtheqnecugg ftrfgrthhtvghrnhepheejhfdvffeuheeiveduvdefieeghfdtvddvtdehhefgkeefhfdt hfetffegteeunecuffhomhgrihhnpegtohhnfhdrihhnnecukfhppeejjedrudefgedrvd 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 D067124005A; Fri, 19 Mar 2021 10:57:46 -0400 (EDT) From: Thomas Monjalon To: dev@dpdk.org Cc: ncopa@alpinelinux.org, stable@dpdk.org, Andrew Rybchenko , David Marchand , Bruce Richardson , Dmitry Kozlyuk , Narcisa Ana Maria Vasile , Dmitry Malloy , Pallavi Kadam , Kevin Laatz , Jerin Jacob , Ferruh Yigit Date: Fri, 19 Mar 2021 15:57:18 +0100 Message-Id: <20210319145730.3555384-6-thomas@monjalon.net> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210319145730.3555384-1-thomas@monjalon.net> References: <20190313170657.16688-1-ncopa@alpinelinux.org> <20210319145730.3555384-1-thomas@monjalon.net> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v7 05/17] eal: fix build with musl X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" In musl libc, cpu_set_t is defined only if _GNU_SOURCE is defined. In case _GNU_SOURCE is undefined, as in eal_common_errno.c, it was not possible to include rte_os.h which uses cpu_set_t. This limitation is removed: if CPU_SETSIZE is not defined, cpu_set_t related definitions and functions are skipped. Note: such definitions are unneeded in eal_common_errno.c. Applications which do not define _GNU_SOURCE may miss cpu_set_t related features on musl. Such case is detected by RTE_HAS_CPUSET being undefined, so functions which depend on rte_cpuset_t will be unavailable. A missing include of fcntl.h is also added. Bugzilla ID: 35 Fixes: 11b57c698005 ("eal: fix error string function") Fixes: 176bb37ca6f3 ("eal: introduce internal wrappers for file operations") Cc: stable@dpdk.org Signed-off-by: Thomas Monjalon Signed-off-by: Natanael Copa Acked-by: Andrew Rybchenko Acked-by: David Marchand --- doc/api/doxy-api.conf.in | 3 ++- lib/librte_eal/freebsd/include/rte_os.h | 1 + lib/librte_eal/include/rte_lcore.h | 4 ++++ lib/librte_eal/include/rte_thread.h | 4 ++++ lib/librte_eal/linux/include/rte_os.h | 3 +++ lib/librte_eal/unix/eal_file.c | 1 + lib/librte_eal/windows/include/sched.h | 1 + lib/librte_telemetry/rte_telemetry.h | 4 ++++ 8 files changed, 20 insertions(+), 1 deletion(-) diff --git a/doc/api/doxy-api.conf.in b/doc/api/doxy-api.conf.in index 5eb31508fd..b3c5cdfeca 100644 --- a/doc/api/doxy-api.conf.in +++ b/doc/api/doxy-api.conf.in @@ -81,7 +81,8 @@ INPUT += @API_EXAMPLES@ FILE_PATTERNS = rte_*.h \ cmdline.h PREDEFINED = __DOXYGEN__ \ - VFIO_PRESENT \ + RTE_HAS_CPUSET \ + VFIO_PRESENT \ __attribute__(x)= OPTIMIZE_OUTPUT_FOR_C = YES diff --git a/lib/librte_eal/freebsd/include/rte_os.h b/lib/librte_eal/freebsd/include/rte_os.h index c16f2a30e9..627f0483ab 100644 --- a/lib/librte_eal/freebsd/include/rte_os.h +++ b/lib/librte_eal/freebsd/include/rte_os.h @@ -13,6 +13,7 @@ #include typedef cpuset_t rte_cpuset_t; +#define RTE_HAS_CPUSET #define RTE_CPU_AND(dst, src1, src2) do \ { \ cpuset_t tmp; \ diff --git a/lib/librte_eal/include/rte_lcore.h b/lib/librte_eal/include/rte_lcore.h index 0fe0bd839c..1550b75da0 100644 --- a/lib/librte_eal/include/rte_lcore.h +++ b/lib/librte_eal/include/rte_lcore.h @@ -186,6 +186,8 @@ __rte_experimental int rte_lcore_to_cpu_id(int lcore_id); +#ifdef RTE_HAS_CPUSET + /** * @warning * @b EXPERIMENTAL: this API may change without prior notice. @@ -200,6 +202,8 @@ __rte_experimental rte_cpuset_t rte_lcore_cpuset(unsigned int lcore_id); +#endif /* RTE_HAS_CPUSET */ + /** * Test if an lcore is enabled. * diff --git a/lib/librte_eal/include/rte_thread.h b/lib/librte_eal/include/rte_thread.h index e640ea1857..ac5a89b1ad 100644 --- a/lib/librte_eal/include/rte_thread.h +++ b/lib/librte_eal/include/rte_thread.h @@ -25,6 +25,8 @@ extern "C" { */ typedef struct eal_tls_key *rte_tls_key; +#ifdef RTE_HAS_CPUSET + /** * Set core affinity of the current thread. * Support both EAL and non-EAL thread and update TLS. @@ -46,6 +48,8 @@ int rte_thread_set_affinity(rte_cpuset_t *cpusetp); */ void rte_thread_get_affinity(rte_cpuset_t *cpusetp); +#endif /* RTE_HAS_CPUSET */ + /** * Create a TLS data key visible to all threads in the process. * the created key is later used to get/set a value. diff --git a/lib/librte_eal/linux/include/rte_os.h b/lib/librte_eal/linux/include/rte_os.h index 390b87b3a1..1618b4df22 100644 --- a/lib/librte_eal/linux/include/rte_os.h +++ b/lib/librte_eal/linux/include/rte_os.h @@ -12,7 +12,9 @@ #include +#ifdef CPU_SETSIZE /* may require _GNU_SOURCE */ typedef cpu_set_t rte_cpuset_t; +#define RTE_HAS_CPUSET #define RTE_CPU_AND(dst, src1, src2) CPU_AND(dst, src1, src2) #define RTE_CPU_OR(dst, src1, src2) CPU_OR(dst, src1, src2) #define RTE_CPU_FILL(set) do \ @@ -28,5 +30,6 @@ typedef cpu_set_t rte_cpuset_t; RTE_CPU_FILL(&tmp); \ CPU_XOR(dst, &tmp, src); \ } while (0) +#endif #endif /* _RTE_OS_H_ */ diff --git a/lib/librte_eal/unix/eal_file.c b/lib/librte_eal/unix/eal_file.c index 1b26475ba4..ec554e0096 100644 --- a/lib/librte_eal/unix/eal_file.c +++ b/lib/librte_eal/unix/eal_file.c @@ -4,6 +4,7 @@ #include #include +#include #include #include diff --git a/lib/librte_eal/windows/include/sched.h b/lib/librte_eal/windows/include/sched.h index fbe07f742c..ff572b5dcb 100644 --- a/lib/librte_eal/windows/include/sched.h +++ b/lib/librte_eal/windows/include/sched.h @@ -28,6 +28,7 @@ extern "C" { typedef struct _rte_cpuset_s { long long _bits[_NUM_SETS(CPU_SETSIZE)]; } rte_cpuset_t; +#define RTE_HAS_CPUSET #define CPU_SET(b, s) ((s)->_bits[_WHICH_SET(b)] |= (1LL << _WHICH_BIT(b))) diff --git a/lib/librte_telemetry/rte_telemetry.h b/lib/librte_telemetry/rte_telemetry.h index f7c8534b82..027b048d78 100644 --- a/lib/librte_telemetry/rte_telemetry.h +++ b/lib/librte_telemetry/rte_telemetry.h @@ -292,6 +292,8 @@ __rte_experimental int rte_telemetry_register_cmd(const char *cmd, telemetry_cb fn, const char *help); +#ifdef RTE_HAS_CPUSET + /** * @internal * Initialize Telemetry. @@ -314,6 +316,8 @@ int rte_telemetry_init(const char *runtime_dir, const char *rte_version, rte_cpuset_t *cpuset, const char **err_str); +#endif /* RTE_HAS_CPUSET */ + /** * Get a pointer to a container with memory allocated. The container is to be * used embedded within an existing telemetry dict/array. From patchwork Fri Mar 19 14:57:19 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Monjalon X-Patchwork-Id: 89561 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 22316A0562; Fri, 19 Mar 2021 15:58:37 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7B4C0140F39; Fri, 19 Mar 2021 15:57:53 +0100 (CET) Received: from new2-smtp.messagingengine.com (new2-smtp.messagingengine.com [66.111.4.224]) by mails.dpdk.org (Postfix) with ESMTP id 870D5140F1D for ; Fri, 19 Mar 2021 15:57:51 +0100 (CET) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailnew.nyi.internal (Postfix) with ESMTP id 2D2E7580AFA; Fri, 19 Mar 2021 10:57:51 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Fri, 19 Mar 2021 10:57:51 -0400 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=w1l2nM5mnlAB6 cEt+hYuLMA/9UIaHQ4xmXH7onY4fPM=; b=3hJz9slXFu/LOgzjdfVmi11mqL84R T4v9l004+f8D/TqNDNU6UCZhs4SbmUiyaUpEFD4LicIVkz9DV19VJSGKtvBudWTY +NFKvj0N7iN2di5AcEJx8/+oqllvedEc5b0JtXB2WzuSrqa01Nfd0fhmeGsoEUAH 2S4vNruhtIHvmlEFWIyPaj2SxXGj78RXvrbNoDCEbUdDbnt7j7H7kFztQG1Ta38o +edx74TZNAw4YU+aCxTlCN+Ip59QPxrs3GnVy2CHw+roBrHn42jK/pF7+SBOgygX wa1MXEaFrr/2MH0KaUTKXl0k5Qr7gj6uOQChsG9BOMeLp3is/1koTqGGg== 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=w1l2nM5mnlAB6cEt+hYuLMA/9UIaHQ4xmXH7onY4fPM=; b=JOV/gduJ i0GIsl8Ba0HfwgQcMsFkI5OwDvpVMPC1ZmwBrP10R+1qVhbIPMZuc0+FxYDb5DY0 l46RPD9NjmLRER6X7Djxab82XLkEVTofP4iRjroArLeGJmVSWI2K9G8uBA4Y+kI7 gKWVU9NpLMXw4CQMZnQjv3WswvjpR2MxwPoF5lGV4DH+kFGXacbGI2zkSkIHZ7Fb AdVNAy8FZVqUrxWQDiNCcnzg+QzWYibJJCHoG3S/EQzEdT/zZQRMce//HVF2iGVE UfDkwDrxfpKwyvV28++c2GzvmmwlL3M0slx7jxIRVtiQYjQXuZEykdUwOAILe6mn 79jwVMEcrfR9hg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrudefkedgjeduucetufdoteggodetrfdotf 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 13F5D24006B; Fri, 19 Mar 2021 10:57:48 -0400 (EDT) From: Thomas Monjalon To: dev@dpdk.org Cc: ncopa@alpinelinux.org, Andrew Boyer , Andrew Rybchenko , David Marchand , Anatoly Burakov , Stephen Hemminger , Long Li , Jay Zhou , Timothy McDaniel , Rasesh Mody , Shahed Shaikh , Maxime Coquelin , Chenbo Xia , Xiao Wang Date: Fri, 19 Mar 2021 15:57:19 +0100 Message-Id: <20210319145730.3555384-7-thomas@monjalon.net> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210319145730.3555384-1-thomas@monjalon.net> References: <20190313170657.16688-1-ncopa@alpinelinux.org> <20210319145730.3555384-1-thomas@monjalon.net> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v7 06/17] drivers: replace page size definitions with function X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" The page size is often retrieved from the macro PAGE_SIZE. If PAGE_SIZE is not defined, it is either using hard coded default, or getting the system value from the UNIX-only function sysconf(). Such definitions are replaced with the generic function rte_mem_page_size() defined for each supported OS. Removing PAGE_SIZE definitions will fix dlb drivers for musl libc, because #ifdef checks were missing, causing redefinition errors. Signed-off-by: Thomas Monjalon Acked-by: Andrew Boyer Acked-by: Andrew Rybchenko Acked-by: David Marchand --- 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 | 27 ++++++++++++++----------- 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, 85 insertions(+), 95 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 8b26d1d2d2..1174ab3d2b 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 3aeef6f91d..2f7e30abbd 100644 --- a/drivers/event/dlb/pf/dlb_pf.c +++ b/drivers/event/dlb/pf/dlb_pf.c @@ -303,7 +303,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; @@ -328,7 +328,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)); @@ -381,7 +382,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; @@ -406,7 +407,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 1a7d8fc294..1142da5b25 100644 --- a/drivers/event/dlb2/pf/dlb2_pf.c +++ b/drivers/event/dlb2/pf/dlb2_pf.c @@ -284,7 +284,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; @@ -307,7 +307,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)); @@ -359,7 +359,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; @@ -382,7 +382,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 cd220abee2..431eda777b 100644 --- a/drivers/net/ionic/ionic_lif.c +++ b/drivers/net/ionic/ionic_lif.c @@ -612,18 +612,18 @@ ionic_qcq_alloc(struct ionic_lif *lif, 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", struct_size, 0); @@ -636,7 +636,7 @@ ionic_qcq_alloc(struct ionic_lif *lif, new->q.info = rte_calloc_socket("ionic", num_descs, sizeof(void *), - PAGE_SIZE, socket_id); + rte_mem_page_size(), socket_id); if (!new->q.info) { IONIC_PRINT(ERR, "Cannot allocate queue info"); err = -ENOMEM; @@ -673,13 +673,16 @@ ionic_qcq_alloc(struct ionic_lif *lif, 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); } @@ -1002,7 +1005,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 9aa7b2e96c..7301f53342 100644 --- a/drivers/net/ionic/ionic_main.c +++ b/drivers/net/ionic/ionic_main.c @@ -456,7 +456,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 Fri Mar 19 14:57:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Monjalon X-Patchwork-Id: 89562 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 4708CA0562; Fri, 19 Mar 2021 15:58:46 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B636B140F32; Fri, 19 Mar 2021 15:57:54 +0100 (CET) Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) by mails.dpdk.org (Postfix) with ESMTP id 0F25D140F2F; Fri, 19 Mar 2021 15:57:53 +0100 (CET) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 798A55C0115; Fri, 19 Mar 2021 10:57:52 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Fri, 19 Mar 2021 10:57:52 -0400 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=FhzSHxhRXO4zT LQjbwLPnyIKRZ/STCpQMmoUzfae2z4=; b=WY8+0QiCMeI2j/h023MmR0ndUmxG6 UvdLwhBdeQlqAQhncnevQ4xxK22qjqf1X591LUxc46h3Yp4m86rtBkUYZ5yXU4ko +TVqV/kzsuXRqxXKIx1nfYHtv2eQ0Ux2rZMqLh2gG4rHsQiF32DIW2q6Kwsfdv1q XAo79lxu3AvnQEzo5g68BsFGTJ9TRUWU2ZPh55U18RrMNFFa9vmdMiWgBl3AYbC2 w8kh+Z2lys/GTyupdnafNwoTRoBJSN1OwJhvbGkm6XK9yg8Q7kLvdKwCJ+Stzbvy t4gSprGbIHn2xhiS77HC6spqE7qoO1tJmq6GDRpud3AOl8GBZv1iteBvA== 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=FhzSHxhRXO4zTLQjbwLPnyIKRZ/STCpQMmoUzfae2z4=; b=pMWt1rYo ShHJ1i5tszcruFUoTwcd4CM/eh2c0H5DzNBPwSrzRUiVzkZ/vpCs8i63r65C9my0 NnuqZCn4P+D5K6ThV7SnImyF0uun47sUQtTWfQgmvRH8sxgoCwfsqVLN7j+aOB+a GC7XiYN2003hSyVMFomhwZESuHUoyGJZ20pPUNqNoUSPX87HTUJsuQ1O0PEeXMll dnEr6UOzhUsdwehLJhxZ2JWXJfcjj4qajGumaOaLie7lGGHxgK591wguIF5JS+q7 pg+/xfsJ1gnnYSUeO8ZaQ6E+uNXAUCOsOBkGSpykXvbSa3g1CmD3KGB+CGqsfXVM eg9jwne+Vbfizg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrudefkedgjedvucetufdoteggodetrfdotf 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 69C8324006E; Fri, 19 Mar 2021 10:57:51 -0400 (EDT) From: Thomas Monjalon To: dev@dpdk.org Cc: ncopa@alpinelinux.org, stable@dpdk.org, Hemant Agrawal , Andrew Rybchenko , David Marchand , Sachin Saxena , Akhil Goyal , Horia Geanta Neag Date: Fri, 19 Mar 2021 15:57:20 +0100 Message-Id: <20210319145730.3555384-8-thomas@monjalon.net> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210319145730.3555384-1-thomas@monjalon.net> References: <20190313170657.16688-1-ncopa@alpinelinux.org> <20210319145730.3555384-1-thomas@monjalon.net> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v7 07/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 Acked-by: Andrew Rybchenko Acked-by: David Marchand --- 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 Fri Mar 19 14:57:21 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Monjalon X-Patchwork-Id: 89563 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id DCE25A0562; Fri, 19 Mar 2021 15:58:56 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6A93C140F46; Fri, 19 Mar 2021 15:57:57 +0100 (CET) Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) by mails.dpdk.org (Postfix) with ESMTP id 9D2BC140F40 for ; Fri, 19 Mar 2021 15:57:54 +0100 (CET) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id 50C455C0115; Fri, 19 Mar 2021 10:57:54 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Fri, 19 Mar 2021 10:57:54 -0400 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=QWu3XEK2rQH/5 TNTlDfaZ0FKUazKkyEth51uiG+XhtE=; b=B7wK1ooS4nDp+ohTocvLJWeRzEYYO CjUi0Q31ciYAIokXXyFrCdyp09mU9B7ejPouN/WiD45qxmMzmwg2ZjkSjXqqfL/O HTucQT57+1doYMDMcsT4hGICdkTB2d+uxZjws+QcX69qD5imzNyJprNqKFxQlBHS glzeT0y9+ts1R5PHktUbhWuuxvQSbZjmIn2PQF0PCKqFqX7RcoXEdfMZ94kScUwD nHU0hLmqml0yUTK2T5Qt4F4Vi8vAiRXXlqN8l9lv7QGtZt+lpld0NHILvRtPV4Gt iGwC8/mtygj1ytvmIDy8ohsd7IsLF9+lFsHH0ydkNdpPVQIoSyr62Lc8w== 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=QWu3XEK2rQH/5TNTlDfaZ0FKUazKkyEth51uiG+XhtE=; b=bBdVmYPv Pp+WCGgZ3vbNNUBWy04b6y1AD3xjV3SoawR2H8XqmYcQq9ax+XOtbMLNqUhPENtn nTY6+Y6RR52cxd1DN1dNld5F1vW8SxItrgEbQhQMjW0X/rd1k/6hyuFTpjMKc3jn gfMDxIjDLCWUmuGbH5EiWTuODIMKCKInVU993Xpu5n2SX8G8X2g6eeALtrzQVIKv BH2X6000MkLhpzOPKAK6wRMeE68GY+mdI1L1vM6Cjugt/FEMZGmjjhdLbBI2IzEM 8R1/2V9feYSZGztOZiOHMKPVNEKhrco8mYXFVk0bj0WZcGQZKfkfQ056HLSnq9us kmWaAXFYCSCeDg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrudefkedgjeduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefvhhhomhgr shcuofhonhhjrghlohhnuceothhhohhmrghssehmohhnjhgrlhhonhdrnhgvtheqnecugg ftrfgrthhtvghrnhepvdehgfeivdejgedtveehfefhteelfefgieevgfffveefjeegtdfg uedthedtgeevnecukfhppeejjedrudefgedrvddtfedrudekgeenucevlhhushhtvghruf hiiigvpeefnecurfgrrhgrmhepmhgrihhlfhhrohhmpehthhhomhgrshesmhhonhhjrghl 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 8231D24005A; Fri, 19 Mar 2021 10:57:53 -0400 (EDT) From: Thomas Monjalon To: dev@dpdk.org Cc: ncopa@alpinelinux.org, Hemant Agrawal , Andrew Rybchenko , David Marchand , Sachin Saxena Date: Fri, 19 Mar 2021 15:57:21 +0100 Message-Id: <20210319145730.3555384-9-thomas@monjalon.net> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210319145730.3555384-1-thomas@monjalon.net> References: <20190313170657.16688-1-ncopa@alpinelinux.org> <20210319145730.3555384-1-thomas@monjalon.net> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v7 08/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 Acked-by: Andrew Rybchenko Acked-by: David Marchand --- 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 Fri Mar 19 14:57:22 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Monjalon X-Patchwork-Id: 89564 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id D554AA0562; Fri, 19 Mar 2021 15:59:04 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C142D140F5C; Fri, 19 Mar 2021 15:58:00 +0100 (CET) Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) by mails.dpdk.org (Postfix) with ESMTP id 78755140F46; Fri, 19 Mar 2021 15:57:56 +0100 (CET) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id 18F1B5C01A8; Fri, 19 Mar 2021 10:57:56 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Fri, 19 Mar 2021 10:57:56 -0400 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=jRGJ5IO3HXfXW xWebTk+y9HM5RJHqPz0hgkm9cHeM2U=; b=EcjGPgMd+HeaoOy3uiNbISvvjBWbJ +ktRnonBQA0lseHqUSDvJEDcNafC4e0oUtSZCgg1zKplpakLm18F+ljPPs/K/Ww1 95+j7rAosetlskvvWLREHkiI2V5XMcOG9GzcVGoRDeqvAxCIHLJm8+GLApuVoXGJ dXyBPBd7IKaiQsHphrc4x7oeB+9XDKJQV2NAM6IzM3n/QSpFZ2hByiBw1l0jLiu5 l71L0hnnYvVK3RhAdkEyTCCBgpnbpxTSSnbtVqyrWD9dJvqxzhjYebeAXgiWOQ4H cqHsrwZUSaXijo5kmKq5XroYVAjD7D2BBQZQs+Sc+icpEvuZXx/X52/jg== 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=jRGJ5IO3HXfXWxWebTk+y9HM5RJHqPz0hgkm9cHeM2U=; b=epBoLT2L VEKqcbTYbf9CDSEwM6DcDpJdPKCuTVd01X+4Fx+77TFkaOdsOS1AAnfzYv+5cn+c IcjNcO8gHtaUCCzKvCY+poQ+pmHYaTnoh3gb+QW4Z5O1T8afAq6kwfLBiNRUV6Jj u+tQzyZ0fO0QVxBCGSlHfrQ5a9Pam0KKLaoJeqGbfmLz3lC7XQ6u2NyUT+jQjOql q/6YVjz9jLpCgNawOLVYpBofDX52qaiFMFJrl1OHcV2XQvT43xBbj6X4a5louhaw Su4m8HlSSVMTz8D8BlthH2qpol0NxiuhvOCeGLDBIsCnvfTgMtGFJRxqnM3ihnZT Bqwz1VyhVAAHlg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrudefkedgjeduucetufdoteggodetrfdotf 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 07A8D24005A; Fri, 19 Mar 2021 10:57:54 -0400 (EDT) From: Thomas Monjalon To: dev@dpdk.org Cc: ncopa@alpinelinux.org, stable@dpdk.org, Hemant Agrawal , Andrew Rybchenko , David Marchand , Sachin Saxena , Roy Pledge , Geoff Thorpe , Shreyansh Jain Date: Fri, 19 Mar 2021 15:57:22 +0100 Message-Id: <20210319145730.3555384-10-thomas@monjalon.net> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210319145730.3555384-1-thomas@monjalon.net> References: <20190313170657.16688-1-ncopa@alpinelinux.org> <20210319145730.3555384-1-thomas@monjalon.net> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v7 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 Acked-by: Hemant Agrawal Acked-by: Andrew Rybchenko Acked-by: David Marchand --- 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 Fri Mar 19 14:57:23 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Monjalon X-Patchwork-Id: 89565 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id DFA56A0562; Fri, 19 Mar 2021 15:59:12 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 14B74140F6B; Fri, 19 Mar 2021 15:58:02 +0100 (CET) Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) by mails.dpdk.org (Postfix) with ESMTP id 59494140F5E; Fri, 19 Mar 2021 15:57:58 +0100 (CET) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id 0D39A5C01A9; Fri, 19 Mar 2021 10:57:58 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Fri, 19 Mar 2021 10:57:58 -0400 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=usgEUiWpufd7g RDBFqgBfPNnBTq6oysvwpzR3K49zq0=; b=GnDmX76b2sfqvAyRuLcPXpfA6UHyk jByTtL4HnEHsts4//FZjSUdq/GvOrgJ3z80+WViYJeB24ZL6utxBuPbMw7xW7qP7 PaVaFzbSlda5gLKbVPXexn2om6LqmCLzSWM2SHIfNPJVpOikgQuQG1Geet49ybO8 e9Q5Vs/f6MJxbZZ7r1qSqONJKUdloh4IwarDVNBwDt8BXrFh5/deXKZZw3bS2ZgO Bka8RlwDhB1SX0J20E/TDRXiR3wLVTTS4joWlBIMf0+1qvVTR+SRtm0Tr6jDRB6z HYji029nCXQkguZ86Sd2NNhlr2v5t+D0edtR4nHkmQpwRFaCOvXn4txwg== 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=usgEUiWpufd7gRDBFqgBfPNnBTq6oysvwpzR3K49zq0=; b=aA/BY8mx IOXLZoBPHmK4nCOGQyOGFBSeCOT8FIL+yWwEHS0dzO7Fs5ztA/ZT1FI+eZ5daVEX +jLPKJrh2PE3277vN/a0E3F8dM2j1+gSGKGFATRDBlOrRbHiLRoCNlGG110KT5F4 J3m/8P1DndyKZSEEW/P8yUf4mSttaB2NViSTBAfFPslmWWEtPyY6/q6A6PKH0taY 52suBhQtpYxi/Fm+OoO511faNG/3pWXBnJo+18iYjgF6WpZflh5KijtWRfgesdv0 7TO6BfcS7Phecrjz5Y0v5F6wIEQfr3rlgNtVQMM+5VaVDZ08SYlxTFjTUIMAVjx0 MqpmUY+PzQUNXA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrudefkedgjeduucetufdoteggodetrfdotf 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 EE0EF240069; Fri, 19 Mar 2021 10:57:56 -0400 (EDT) From: Thomas Monjalon To: dev@dpdk.org Cc: ncopa@alpinelinux.org, stable@dpdk.org, Andrew Rybchenko , David Marchand , Hemant Agrawal , Sachin Saxena , Roy Pledge , Shreyansh Jain , Geoff Thorpe Date: Fri, 19 Mar 2021 15:57:23 +0100 Message-Id: <20210319145730.3555384-11-thomas@monjalon.net> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210319145730.3555384-1-thomas@monjalon.net> References: <20190313170657.16688-1-ncopa@alpinelinux.org> <20210319145730.3555384-1-thomas@monjalon.net> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v7 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 The header files argp.h and error.h do not exist in musl libc. Fix build with musl libc by using err(3) instead of the GNU-specific error(3). We could have used the identical errx("...: %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 "err" 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 "err" 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") Fixes: 39f373cf015a ("bus/dpaa: add compatibility and helper macros") Cc: stable@dpdk.org Signed-off-by: Natanael Copa Signed-off-by: Thomas Monjalon Acked-by: Andrew Rybchenko Acked-by: David Marchand --- 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 ++++++++++++----- drivers/bus/dpaa/include/netcfg.h | 1 - drivers/common/dpaax/compat.h | 1 - 5 files changed, 23 insertions(+), 13 deletions(-) diff --git a/drivers/bus/dpaa/base/fman/netcfg_layer.c b/drivers/bus/dpaa/base/fman/netcfg_layer.c index b7009f2299..120deb0bb6 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__); + err(0, "%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..ee35e03da1 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; + err(0, "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; + err(0, "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; + err(0, "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..dfbafe581a 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; + err(0, "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; + err(0, "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 */ + err(0, "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; + err(0, "process_portal_map()"); kfree(q_pcfg); return NULL; } 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 From patchwork Fri Mar 19 14:57:24 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Monjalon X-Patchwork-Id: 89566 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 35D2EA0562; Fri, 19 Mar 2021 15:59:20 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7A447140F7F; Fri, 19 Mar 2021 15:58:04 +0100 (CET) Received: from wout5-smtp.messagingengine.com (wout5-smtp.messagingengine.com [64.147.123.21]) by mails.dpdk.org (Postfix) with ESMTP id CCAA0140F6F; Fri, 19 Mar 2021 15:58:02 +0100 (CET) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id 2F4F3147F; Fri, 19 Mar 2021 10:58:01 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Fri, 19 Mar 2021 10:58:01 -0400 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=aSoI9SC4iXoWX pRZ8fHXPXRkhD1ozbxwb9PCXe1/7tg=; b=x1npxk+0PF6qMBRcnyjDrh5p5O+Hk 2Q8cs5Ap1Xte/bHeLEs0TwFej61hdrnbUoELHpowf5MCpt0dxPnZdd75QDXk/8ke +mMcVh2UVGaFluUdt1QcqfIdsVry0MuBNecdMEL2qe3MOqM9kg1mJnr+QFYtbz/F xR8hwnSMA+bqK+LbUbY2vmFRc3oLbzlb1FOMdc7Ws2WJHt1rOoxH7PMl/5vidOKp 5e0gk4Wjzsv08jsOeiBwkT00Nf1gZNO5lNTOL+LQZn7FbB4PhyzPAEYwcktz8fB3 AHSQY6C6/0RmrMLP/N6g+o7eDGkpzvqMZfLuEeE7ubUMNRdFHsKCOd3lg== 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=aSoI9SC4iXoWXpRZ8fHXPXRkhD1ozbxwb9PCXe1/7tg=; b=OmRC6xw6 0ccxqMZkm5XbQVOTFhgk5RSukQUFhFep2eMcMqu+eN9K7nxJyN4UBbTEiElq1yLZ XF6cfdhnmlqlVgzc0WYUWfeChjz7EhopxxTLggUwHHsD32gixKpGuoE7Fbvvsx2u e/DfJPk8TJ1gaXMZmfF4cMfI4Ty347QFEYz30vBazhxgpOstrAl2WgA4Uwq2KE4Z TOVO13P7Gw50kMp0gPNBAEtLW8T0e9rrfTaQMl2+98CIaShzuH3T9aMI0TwR1sJG Pi54v5s5WR+oih4mtUq/Sj1CyamUtUGYciBLV/ZF6D/g51zKqqdp8iuvjzQ7TVyn 8r2JE4zVexQ6rg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrudefkedgjedvucetufdoteggodetrfdotf 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 E617424006B; Fri, 19 Mar 2021 10:57:58 -0400 (EDT) From: Thomas Monjalon To: dev@dpdk.org Cc: ncopa@alpinelinux.org, stable@dpdk.org, Andrew Rybchenko , David Marchand , Ferruh Yigit , Yuanhan Liu , David Marchand Date: Fri, 19 Mar 2021 15:57:24 +0100 Message-Id: <20210319145730.3555384-12-thomas@monjalon.net> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210319145730.3555384-1-thomas@monjalon.net> References: <20190313170657.16688-1-ncopa@alpinelinux.org> <20210319145730.3555384-1-thomas@monjalon.net> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v7 11/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" Add a fallback for non-GNU libc systems like musl libc for the non-standard functions outl_p, outw_p and outb_p. It solves the following errors when building with musl libc: pci_uio.c: undefined reference to 'outw_p' pci_uio.c: undefined reference to 'outl_p' pci_uio.c: undefined reference to 'outb_p' Bugzilla ID: 35 Fixes: 756ce64b1ecd ("eal: introduce PCI ioport API") Cc: stable@dpdk.org Reported-by: Natanael Copa Signed-off-by: Thomas Monjalon Acked-by: Andrew Rybchenko Acked-by: David Marchand --- drivers/bus/pci/linux/pci_uio.c | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/drivers/bus/pci/linux/pci_uio.c b/drivers/bus/pci/linux/pci_uio.c index 0907051e04..39ebeac2a0 100644 --- a/drivers/bus/pci/linux/pci_uio.c +++ b/drivers/bus/pci/linux/pci_uio.c @@ -526,13 +526,18 @@ pci_uio_ioport_map(struct rte_pci_device *dev, int bar, #endif #if defined(RTE_ARCH_X86) + static inline uint8_t ioread8(void *addr) { uint8_t val; val = (uint64_t)(uintptr_t)addr >= PIO_MAX ? *(volatile uint8_t *)addr : +#ifdef __GLIBC__ inb_p((unsigned long)addr); +#else + inb((unsigned long)addr); +#endif return val; } @@ -543,7 +548,11 @@ static inline uint16_t ioread16(void *addr) val = (uint64_t)(uintptr_t)addr >= PIO_MAX ? *(volatile uint16_t *)addr : +#ifdef __GLIBC__ inw_p((unsigned long)addr); +#else + inw((unsigned long)addr); +#endif return val; } @@ -554,7 +563,11 @@ static inline uint32_t ioread32(void *addr) val = (uint64_t)(uintptr_t)addr >= PIO_MAX ? *(volatile uint32_t *)addr : +#ifdef __GLIBC__ inl_p((unsigned long)addr); +#else + inl((unsigned long)addr); +#endif return val; } @@ -563,23 +576,37 @@ static inline void iowrite8(uint8_t val, void *addr) { (uint64_t)(uintptr_t)addr >= PIO_MAX ? *(volatile uint8_t *)addr = val : +#ifdef __GLIBC__ outb_p(val, (unsigned long)addr); +#else + outb(val, (unsigned long)addr); +#endif } static inline void iowrite16(uint16_t val, void *addr) { (uint64_t)(uintptr_t)addr >= PIO_MAX ? *(volatile uint16_t *)addr = val : +#ifdef __GLIBC__ outw_p(val, (unsigned long)addr); +#else + outw(val, (unsigned long)addr); +#endif } static inline void iowrite32(uint32_t val, void *addr) { (uint64_t)(uintptr_t)addr >= PIO_MAX ? *(volatile uint32_t *)addr = val : +#ifdef __GLIBC__ outl_p(val, (unsigned long)addr); -} #else + outl(val, (unsigned long)addr); +#endif +} + +#else /* !RTE_ARCH_X86 */ + static inline uint8_t ioread8(void *addr) { return *(volatile uint8_t *)addr; @@ -609,7 +636,8 @@ static inline void iowrite32(uint32_t val, void *addr) { *(volatile uint32_t *)addr = val; } -#endif + +#endif /* !RTE_ARCH_X86 */ void pci_uio_ioport_read(struct rte_pci_ioport *p, From patchwork Fri Mar 19 14:57:25 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Monjalon X-Patchwork-Id: 89567 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 72D38A0562; Fri, 19 Mar 2021 15:59:27 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A66CB140F70; Fri, 19 Mar 2021 15:58:06 +0100 (CET) Received: from wout5-smtp.messagingengine.com (wout5-smtp.messagingengine.com [64.147.123.21]) by mails.dpdk.org (Postfix) with ESMTP id E5723140F75; Fri, 19 Mar 2021 15:58:03 +0100 (CET) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id 92B07B3B; Fri, 19 Mar 2021 10:58:02 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Fri, 19 Mar 2021 10:58:03 -0400 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= d7WYskPaE1w4D1md/Bw7WPruyMrF6ASB1ETPcABQbaI=; b=lWcJAOfRzybLWpK3 kApn7KSnpg5e4XX0nu0240yK++nVUuvDkFNUb8hWr4qYxcrOwa5hf8QdAws4u+Oc ng1GuoUeC9ECfj7rbKzj8g15Fm3+4x4Li7LX2dOu9alILXNg/qJ1Kz6BzmU1CcF9 bArUmbZilMmT87AxYvELYUfX1Oi8gcOPO8FCWlP7C+d91c3YyXBqsCKBnuUIOqSB ImkzrfhE0wy3ij25h3RAP6715xaCcS4ujSXI/417uPda6zu2kT0dneM/mrtEGD9n +l5evWeA9C44Hwal3QEzNzuP3Ov9eFXwawg1CS2dTAFVHfbeZ28W7PhMzoGVzAJ+ h9puYg== 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=d7WYskPaE1w4D1md/Bw7WPruyMrF6ASB1ETPcABQb aI=; b=TTtG9G41uDaajtejDweYbcGrQCPCfhCmoT6M8uruXPxKbtG0hbBZ9SPnM wGk60jygdJsH0wWYiEWY4yjGKahbXi7F0nNSjxl0gA6jyjiSGI3fnoEbNxm4e8Ox 9x6O26jut5L4EzCUAA8p6lABgKUE+uEKZ10o/o1n/ewvCu6gmCV28Tp8RQIdLKdi Zm4RNGl4z9n9wAV+mE083hKkhaQPVJ8eNW/AGzObuThe7gFXOGqfdupNKghHK9l+ H6imgjrn2sh9A0B9TLkyC+vyDTXpgH1xbvByub7Fxr0vVfvSe5+s1xMQy5TlJAd/ ROMPV79iSVuHV5fu7rII3L8zKSh9w== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrudefkedgjedvucetufdoteggodetrfdotf 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 A448A24005A; Fri, 19 Mar 2021 10:58:00 -0400 (EDT) From: Thomas Monjalon To: dev@dpdk.org Cc: ncopa@alpinelinux.org, stable@dpdk.org, =?utf-8?q?Morten_Br=C3=B8rup?= , Andrew Rybchenko , David Marchand , Rahul Lakkireddy , Kumar Sanghvi Date: Fri, 19 Mar 2021 15:57:25 +0100 Message-Id: <20210319145730.3555384-13-thomas@monjalon.net> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210319145730.3555384-1-thomas@monjalon.net> References: <20190313170657.16688-1-ncopa@alpinelinux.org> <20210319145730.3555384-1-thomas@monjalon.net> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v7 12/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 Acked-by: Andrew Rybchenko Acked-by: David Marchand --- 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 Fri Mar 19 14:57:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Monjalon X-Patchwork-Id: 89568 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id DCA80A0562; Fri, 19 Mar 2021 15:59:34 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0AB96140F9D; Fri, 19 Mar 2021 15:58:08 +0100 (CET) Received: from wout5-smtp.messagingengine.com (wout5-smtp.messagingengine.com [64.147.123.21]) by mails.dpdk.org (Postfix) with ESMTP id 213FB140F70; Fri, 19 Mar 2021 15:58:05 +0100 (CET) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id BAE571355; Fri, 19 Mar 2021 10:58:03 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Fri, 19 Mar 2021 10:58:04 -0400 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=OUXqsyyU8awVr NJCoTHruMOaFjJm6TZPW3ZjZ7sEcDY=; b=h5XmZvXC5obpVx3y3FM/faHT2oGkx 3kfFpIAqq1uCtpo8hNIA/MtvHtmDmHlzs8rCtLBRPmYJTeP1pOQw4WPnqr7XTHrd s5J0G2cBQK8jNsXyGtWARzopgx22XpGGN0E+Y2N5MuYFP0V7qnl3VKylOpatNmcW 12TooxgRFMVn8Zn9rnSkGwgofx6Ca4DcE36o+JtTjTkJMw0DcJzBsEDbPPqoB5x/ akgT0ji/DmAweO1qKn6ftXAPUGhz74sSQLMp4xrX4+YS5YZL877mFtkvomL3SbKs kpAtRuuLgtTSvk2/5wGq9aV3Pewn8/0NkOL9pL3s8yW5va5KmSn67ZQdQ== 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=OUXqsyyU8awVrNJCoTHruMOaFjJm6TZPW3ZjZ7sEcDY=; b=dY6E5FA+ 69nUsnmDY3YHMv6iJS67vhWFyzzQgMmhSQofyhW15fgHKoebGXngH9CPYL0auIr6 ft+XK4gsMiQKbK+09DA2g8rWGYwFBiRlUb3CqBQMrz7qRcyjvSjApRFWLJ2HKeIQ uSoflLQRFtz1i1Vi6IgyDqqRM7AA03ClwAVYNU1YbSaXGiDltzN4PF1x1AGzu1eX kbgs6f8lV3zeXNaR1CLbspAvQFsVaTz7q4HNrtQ189z3WVYC9dCrmkLMUeDVNHa0 eyP07LBIrDQz2/tjTW4wjvF4v+jN5X07ZYi16G76ZZwfC6kIkTmOOD8PZPV4E6WS 7pSIf4633oVBmA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrudefkedgjedvucetufdoteggodetrfdotf 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 67110240065; Fri, 19 Mar 2021 10:58:02 -0400 (EDT) From: Thomas Monjalon To: dev@dpdk.org Cc: ncopa@alpinelinux.org, stable@dpdk.org, David Marchand , Haiyue Wang , Andrew Rybchenko , Jeff Guo , Ferruh Yigit , Alvin Zhang Date: Fri, 19 Mar 2021 15:57:26 +0100 Message-Id: <20210319145730.3555384-14-thomas@monjalon.net> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210319145730.3555384-1-thomas@monjalon.net> References: <20190313170657.16688-1-ncopa@alpinelinux.org> <20210319145730.3555384-1-thomas@monjalon.net> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v7 13/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 Acked-by: Andrew Rybchenko Acked-by: David Marchand --- 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 Fri Mar 19 14:57:27 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Monjalon X-Patchwork-Id: 89569 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 6CFEFA0562; Fri, 19 Mar 2021 15:59:42 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 477C3140FB0; Fri, 19 Mar 2021 15:58:09 +0100 (CET) Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) by mails.dpdk.org (Postfix) with ESMTP id D4D84140F70; Fri, 19 Mar 2021 15:58:05 +0100 (CET) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id 617AE5C0198; Fri, 19 Mar 2021 10:58:05 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Fri, 19 Mar 2021 10:58:05 -0400 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=YAtp25nt5or0k Nw8KTqrdY8W6qDzYkwRPti1hj6eko0=; b=buOF09xcbd7c0z7APYFrnlwIYasiE smLjy71cV16C/2jaIARwgid/sJUtfGahTtsNUk6P0WHmfYaiUAoLmHC4Mhj31eKt xtuVjDxD2wF6pl2P1ZcgA0v+ZW48qOh7w0tndRsJoZB3P8bySXiCoVURFbCZoAmK Eu8LDfA6voUHHrfuxE7SdBmdBd+vBpFeBmgJPbjz/Fc8p+PZ+AggNNgGGP9yGAOI CuFxg7sGKqmIg6tCkpAa5AQksxuT7B1uxFfy/g6g4sWad8wWiEZ7BFtfaRZuH9XO 18kIS4VEOlsVIDlB2vFtj4rmkBM5YwWL0/kvKreVdbpEHfoN8zutG/YDA== 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=YAtp25nt5or0kNw8KTqrdY8W6qDzYkwRPti1hj6eko0=; b=NP8HElc1 70ftAC9mdCstbggtZwkRH67bxALz76wEa41GfVYfEKy0arQe54timpBb3Xx2JrKa lTSAorupOZrDbVn6j3mQDc0F6eEHAD43d3OfRbROfENaZ7SUFj2tlRCXs6QkZjCX sDyUer0qPIxuxK83HSfuzbcOO5pI2rcRQRQhPxfL7YgI/J9zTPk9EhMPxt3sxT03 3nBaBH2OrH1jVudGtZz6PRxgKar8P8vN13KHxmmbAR+tJcbEt/pygjQpDlkE2PuL EG0TYF1FKjFi/YTRyq108VKm6jQSit3SyU6b/3DH0uOunwDGQZNShFKlf+yh6ktT ZbmZmmJIqZEICA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrudefkedgjeduucetufdoteggodetrfdotf 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 4C9D9240069; Fri, 19 Mar 2021 10:58:04 -0400 (EDT) From: Thomas Monjalon To: dev@dpdk.org Cc: ncopa@alpinelinux.org, stable@dpdk.org, Matan Azrad , Andrew Rybchenko , David Marchand , Viacheslav Ovsiienko , Xueming Li , Maxime Coquelin Date: Fri, 19 Mar 2021 15:57:27 +0100 Message-Id: <20210319145730.3555384-15-thomas@monjalon.net> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210319145730.3555384-1-thomas@monjalon.net> References: <20190313170657.16688-1-ncopa@alpinelinux.org> <20210319145730.3555384-1-thomas@monjalon.net> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v7 14/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 Acked-by: Andrew Rybchenko Acked-by: David Marchand --- 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 Fri Mar 19 14:57:28 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Monjalon X-Patchwork-Id: 89570 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 3F8C3A0562; Fri, 19 Mar 2021 15:59:50 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CA118140F8C; Fri, 19 Mar 2021 15:58:10 +0100 (CET) Received: from wout5-smtp.messagingengine.com (wout5-smtp.messagingengine.com [64.147.123.21]) by mails.dpdk.org (Postfix) with ESMTP id 8B861140F65; Fri, 19 Mar 2021 15:58:08 +0100 (CET) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id 52E3C1355; Fri, 19 Mar 2021 10:58:07 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Fri, 19 Mar 2021 10:58:07 -0400 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=qL8ni4OJB5OX/ nNa5ZHj59fxigFiAMNuFO7k7jGHOww=; b=G9+YkF3kwn4e46C7cSA5K8cac1OfU g0Ulp78P1IYnvzWkawVbmNeze+s3Abfqf/KhupaSqdF8ePMm1SKfGASvQ0JjvxZr m/xvjhrtwrllVaGoTXG4ABd9bz24y7uDvMk6wWs5WQhzNlbV6I2NL21xmwi/oBxw qXRceG4nt4sI+4rYruqRc7fNLE/9fPj0Te5mkabx0j9fBNJULvkWwkgdGlEotbOS 5/ed1GDk8TnhPGoVBHUaCra7fbGwa5aQA+elzxFlGNqol7YXcwH15c+meOUf5+sV 0DG0o5MTJvei8GnuCzftFUlvTB5VB38X6O5R+F81ClBESptzddhdhXygQ== 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=qL8ni4OJB5OX/nNa5ZHj59fxigFiAMNuFO7k7jGHOww=; b=CVK9OMvp JKpZPxAB9boO4JKhZUtTLUFMgSrIaO1lJJBE275ip1gIyxfbHzvVR4NHf1mh8tt+ YmsgQac5pOS+hLgUOsZ8Daj4BPD8fHTbsHK4h0HnRiOXq1oqY3bKidoEyz4oEUbs 5j6IfIUQBxGyrBcQ0lAH9l8lI3KRA4t68a0Vt4Btce1XNP2Gp6xgGkm7C5/PgHaD JWrhB1PVKYTOaue/CX0NCtRXnZ6bS/DtJiZbONZiJ7UL9a3vwZRCOzhqi85lHDGY Dvj1brJZvZrVXcMpiy5TTn28KEYNBTC7TKdeyRKip+9QYwvFCAcJ/P37unJxJKfc 8wPcRw5Zho2Hsg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrudefkedgjedvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefvhhhomhgr shcuofhonhhjrghlohhnuceothhhohhmrghssehmohhnjhgrlhhonhdrnhgvtheqnecugg ftrfgrthhtvghrnhepvdehgfeivdejgedtveehfefhteelfefgieevgfffveefjeegtdfg uedthedtgeevnecukfhppeejjedrudefgedrvddtfedrudekgeenucevlhhushhtvghruf hiiigvpeefnecurfgrrhgrmhepmhgrihhlfhhrohhmpehthhhomhgrshesmhhonhhjrghl 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 269CD240067; Fri, 19 Mar 2021 10:58:06 -0400 (EDT) From: Thomas Monjalon To: dev@dpdk.org Cc: ncopa@alpinelinux.org, stable@dpdk.org, Andrew Rybchenko , David Marchand , Timothy McDaniel , Gage Eads Date: Fri, 19 Mar 2021 15:57:28 +0100 Message-Id: <20210319145730.3555384-16-thomas@monjalon.net> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210319145730.3555384-1-thomas@monjalon.net> References: <20190313170657.16688-1-ncopa@alpinelinux.org> <20210319145730.3555384-1-thomas@monjalon.net> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v7 15/17] event/dlb: 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 file fcntl.h should not be included from sys/ directory as done in dlb drivers, it is an error with musl libc. Fixes: 19980083fd57 ("event/dlb: add eventdev probe") Fixes: 5433956d5185 ("event/dlb2: add eventdev probe") Cc: stable@dpdk.org Signed-off-by: Thomas Monjalon Acked-by: Andrew Rybchenko Acked-by: David Marchand --- 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 ++- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/event/dlb/dlb.c b/drivers/event/dlb/dlb.c index 1174ab3d2b..60084ced3b 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 2f7e30abbd..5445c2d57d 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 1142da5b25..cfb22efe8a 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 Fri Mar 19 14:57:29 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Monjalon X-Patchwork-Id: 89571 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id C9BF4A0562; Fri, 19 Mar 2021 15:59:57 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 376F5140FC2; Fri, 19 Mar 2021 15:58:12 +0100 (CET) Received: from wout5-smtp.messagingengine.com (wout5-smtp.messagingengine.com [64.147.123.21]) by mails.dpdk.org (Postfix) with ESMTP id EAA9D140FB9; Fri, 19 Mar 2021 15:58:10 +0100 (CET) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id 788F5B47; Fri, 19 Mar 2021 10:58:09 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Fri, 19 Mar 2021 10:58:10 -0400 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= aK90hWW2RsvFouoFeTOfx9bOPd8cNW6mFeOtM4myCuc=; b=WAiDqCfzG+i5FLyS bJhQpUzKXP21JvKjNDfLvvKR3OQ3tYiFvOot3nRYst2eJcHRCzObzrXEn8xvVgPZ 93Q43UaultNW/xMzgkMql6evRLjOtmK/EpVGTKznh/iVuRCOF53hQt8FxV1Ghynn qPL6jv1Dfe2CeEVtLNbIr4abTi+jHRWr+n/StkHTO8rBjpqOxlSMsApoteaeKg68 QyqDU9AZYpEVBKgLJF3xA5vSJx5tcXpA1NgmL4FWINQOM4yAGuaRb/rZKXEjukZa M0O7EdxVjkquaGe6N1r1rfg7ZUrhjFDV6sqcQtACHChie9t9AXmiCOsfzU7GyM8B BGPwkg== 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=aK90hWW2RsvFouoFeTOfx9bOPd8cNW6mFeOtM4myC uc=; b=rch+PtVbAaNrBz9H/sWmnlonfYJvfPhziTHljUhibO7NFuzHNCaXGh+3T L7MK/J986SXZaQHdLrnwfWYbRf5EKcxPDwju1lNhzbGc4AiIZZuBQcXb/hO0dVqg NBNlRGcf4psbakpFU1l+Dw+bFERbCeBFUB8SYHHVyNkedox4kWeRVZghi4MxMt1J HWCWZ0VuhBP+7tGdSuRU7kbar66g5SIdyOeg8ZsFvN1Bk6UjtuYqZwhpl9wnwUhz iGPnIcw20iKvOG5O1WpZUGQRW6io+vP+Eqy/f4WL4dkh9jAmJZBlfi/Bn1GEsQkF DmuuIkXzpYzf05yZU4yo6t/oeTbjg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrudefkedgjedvucetufdoteggodetrfdotf 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 0FD02240066; Fri, 19 Mar 2021 10:58:07 -0400 (EDT) From: Thomas Monjalon To: dev@dpdk.org Cc: ncopa@alpinelinux.org, stable@dpdk.org, =?utf-8?q?Morten_Br=C3=B8rup?= , Andrew Rybchenko , David Marchand , Xiaoyun Li , =?utf-8?q?N=C3=A9lio_Laranjeiro?= , Konstantin Ananyev , Ferruh Yigit Date: Fri, 19 Mar 2021 15:57:29 +0100 Message-Id: <20210319145730.3555384-17-thomas@monjalon.net> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210319145730.3555384-1-thomas@monjalon.net> References: <20190313170657.16688-1-ncopa@alpinelinux.org> <20210319145730.3555384-1-thomas@monjalon.net> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v7 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 Acked-by: Andrew Rybchenko Acked-by: David Marchand --- 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 576d5acab5..e865de10a4 100644 --- a/app/test-pmd/config.c +++ b/app/test-pmd/config.c @@ -2674,7 +2674,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 af40859170..a87ccb0f0f 100644 --- a/app/test-pmd/testpmd.h +++ b/app/test-pmd/testpmd.h @@ -936,7 +936,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 Fri Mar 19 14:57:30 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Monjalon X-Patchwork-Id: 89572 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 83652A0562; Fri, 19 Mar 2021 16:00:09 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 33439140FD2; Fri, 19 Mar 2021 15:58:15 +0100 (CET) Received: from wout5-smtp.messagingengine.com (wout5-smtp.messagingengine.com [64.147.123.21]) by mails.dpdk.org (Postfix) with ESMTP id 87633140FC6; Fri, 19 Mar 2021 15:58:12 +0100 (CET) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id 4C1D61355; Fri, 19 Mar 2021 10:58:11 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Fri, 19 Mar 2021 10:58:11 -0400 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=ztNV39J/h03F1 SYyWOp/zaLnPykyXWGWhCOE7IeVkJ8=; b=1Rw/fSRdLYx9+Gdd7EqYHeyfhMQWj S1aJYNhiX/zXGxtaFjmrguoWaD4sWjDNyl5phn7kXwEuld1b93k2MB7NvF0st0ic ck0jLoWR3VMExxBV/om1FVg8u6wWoswP0kthjMHkQZVyRb1yUSclMZnUq/yAHYoL VFU9br/gAOKIStdaUJMS5rEs7OxW0yAmz2mOJGDGxp41CwfooQ5udelNesLf4VlW X6ouH6l2SnP0yn0NmXomwTnXoYuFXBlt3+sYUTig90G6P2DJU8cydFU8fz8ge5EJ PC8wx9qw8lsQNI2dpXr3Vlp5TnsMV/NdRWDEZtScBSfrHaA6aFxHtRAdw== 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=ztNV39J/h03F1SYyWOp/zaLnPykyXWGWhCOE7IeVkJ8=; b=D8AQH58z ffduWEv/Sg3u3lQpQegMBciz+ikgb/CJ+Y9XevgnE26z7Z6mhHwLC5q8YaOGHtl2 fG5G4wBGSa8FkI3NyUReq/DlrpwaAFre2NRKwSBxWfuXQ9oW1o04iTDJXDe4PKt/ /vs26BBtqFtH7M2MytXnb1EtfuKlPVabs/14W3Rfe1OJf3+koFdnlc9V/1Kzsde6 VbB5ZzalFabyxHC+KxBr8JLkkoNmrkrH/ZN7vQJ4rNIBIbgdcIRhKR8Pi7Z29B4Q UYslN6nTQDAviP2NRrXb4wTjDw/aZJnRxdPMmDoFafepI/qBLBkLEIN8vrKHytGC qqwsSuRQFoyAtw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrudefkedgjedvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefvhhhomhgr shcuofhonhhjrghlohhnuceothhhohhmrghssehmohhnjhgrlhhonhdrnhgvtheqnecugg ftrfgrthhtvghrnhepvdehgfeivdejgedtveehfefhteelfefgieevgfffveefjeegtdfg uedthedtgeevnecukfhppeejjedrudefgedrvddtfedrudekgeenucevlhhushhtvghruf hiiigvpeefnecurfgrrhgrmhepmhgrihhlfhhrohhmpehthhhomhgrshesmhhonhhjrghl 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 20E2D24005B; Fri, 19 Mar 2021 10:58:10 -0400 (EDT) From: Thomas Monjalon To: dev@dpdk.org Cc: ncopa@alpinelinux.org, stable@dpdk.org, Andrew Rybchenko , David Marchand , Nicolas Chautru , Amr Mokhtar Date: Fri, 19 Mar 2021 15:57:30 +0100 Message-Id: <20210319145730.3555384-18-thomas@monjalon.net> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210319145730.3555384-1-thomas@monjalon.net> References: <20190313170657.16688-1-ncopa@alpinelinux.org> <20210319145730.3555384-1-thomas@monjalon.net> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v7 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 Acked-by: Andrew Rybchenko Acked-by: David Marchand --- 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