From patchwork Wed Sep 6 16:12:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Monjalon X-Patchwork-Id: 131198 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 566B942529; Wed, 6 Sep 2023 18:22:54 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 66D9F402D1; Wed, 6 Sep 2023 18:22:46 +0200 (CEST) Received: from wout3-smtp.messagingengine.com (wout3-smtp.messagingengine.com [64.147.123.19]) by mails.dpdk.org (Postfix) with ESMTP id C5A2E402D0 for ; Wed, 6 Sep 2023 18:22:45 +0200 (CEST) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id 9D7DE320031A; Wed, 6 Sep 2023 12:22:44 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Wed, 06 Sep 2023 12:22:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= cc:cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm1; t=1694017364; x= 1694103764; bh=o7X+JH83KDILLQ+AXBN0uumHj/dS70o4vgFk7IRx5uo=; b=Q VKm1LP8IRCYryaeJxF8BPJGlL7FLW6b2EPDMHxVTzOkMcSVydVQRKRVRS1+Nau7Z IGOYeaI2Vz02UGuBNhiyuMMBrzW2r77zhjMkiYG3Qaq4m5Wj+IpIzI+yPl4kDq8e N75AFYoiok1uYXwUDl/PVh3+kEvDTT7ror8Yo2OghtoeWc9pgTSD9Sw3J1VNo5IF ctq7X2sU46jZQi544YuOoOlSer8sdqFMXFmSG1fg2JXb/JRBJYDdI6nKgVG4aZjy YDa2t4H7lAmJ7Jtr1Vl8ua13rsOoCgzKTzUjNYwRF1UNuhTFyxBQaOO/X+94bTPE YdVcuBFZ5pRF8wS14wy3g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1694017364; x= 1694103764; bh=o7X+JH83KDILLQ+AXBN0uumHj/dS70o4vgFk7IRx5uo=; b=J ZMSDVSZJ9ya9GXuNrJcSoXdK+Xvm3ZbLvGVQY8k6rNjG6Eg/3CI/tafW0+FHX9/z maVYarVZdNtaQP0/7/tp7KnvwS+7bZaeKSWIaYWnRwSfXXop0NCswViWakteRxOv VHd/03FV9w4KW39j1k9FR2YqWQj0YOimrHFROQWOAeFhfXRXWlSyM5+BA9o6c8Yz Kbot8chginvl5lAzkUYvMKzT/AjMWpbxirLS9oNH6oqg7M/93Ng2v/gODrFMwTmm 0sm1X3WlXC/FmMySJfQbOMK8HUtUXxHATxJwfS6HS18PedJ/tTMSTwhYmrzkT1kG 1rC747F0BGXeJhiGrRuIw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrudehfedgleelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvvefufffkofgjfhgggfestdekredtredttdenucfhrhhomhepvfhhohhm rghsucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenuc ggtffrrghtthgvrhhnpedvjefhudeghedvtdeijeeigeetuedugfejueekieeltdfhteev keehhfeilefhtdenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfh hrohhmpehthhhomhgrshesmhhonhhjrghlohhnrdhnvght X-ME-Proxy: Feedback-ID: i47234305:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 6 Sep 2023 12:22:43 -0400 (EDT) From: Thomas Monjalon To: dev@dpdk.org Cc: Tyler Retzlaff , David Marchand , Ferruh Yigit Subject: [PATCH 01/11] devtools: warn when adding some pthread calls Date: Wed, 6 Sep 2023 18:12:18 +0200 Message-ID: <20230906162226.1618088-2-thomas@monjalon.net> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20230906162226.1618088-1-thomas@monjalon.net> References: <20230906162226.1618088-1-thomas@monjalon.net> MIME-Version: 1.0 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org All pthread functions below have an equivalent in rte_thread API: - pthread_create - pthread_join - pthread_detach - pthread_setname_np - pthread_set_name_np - pthread_setaffinity_np - pthread_attr_setinheritsched - pthread_attr_setschedpolicy Usage of these functions will be raised to encourage rte_thread adoption. The pthread functions for locks and cancel are still allowed. Signed-off-by: Thomas Monjalon --- devtools/checkpatches.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/devtools/checkpatches.sh b/devtools/checkpatches.sh index 55fabc5458..131ffbcebe 100755 --- a/devtools/checkpatches.sh +++ b/devtools/checkpatches.sh @@ -119,6 +119,14 @@ check_forbidden_additions() { # -f $(dirname $(readlink -f $0))/check-forbidden-tokens.awk \ "$1" || res=1 + # refrain from using some pthread functions + awk -v FOLDERS="lib drivers app examples" \ + -v EXPRESSIONS="pthread_(create|join|detach|set((|_)name_np|affinity_np)|attr_set(inheritsched|schedpolicy))\\\(" \ + -v RET_ON_FAIL=1 \ + -v MESSAGE='Using pthread functions, prefer rte_thread' \ + -f $(dirname $(readlink -f $0))/check-forbidden-tokens.awk \ + "$1" || res=1 + # forbid use of __reserved which is a reserved keyword in Windows system headers awk -v FOLDERS="lib drivers app examples" \ -v EXPRESSIONS='\\<__reserved\\>' \