From patchwork Wed Oct 4 12:27:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerin Jacob X-Patchwork-Id: 132302 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 0E6C8426B6; Wed, 4 Oct 2023 14:28:10 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DAC89402CF; Wed, 4 Oct 2023 14:28:09 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id 76A7A402CE for ; Wed, 4 Oct 2023 14:28:07 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3945tk50016524; Wed, 4 Oct 2023 05:28:06 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding : content-type; s=pfpt0220; bh=A7Vsw3eSG4tu4fRKkiZjD+3uiL6f8F16+T72okMgZNs=; b=bwYO5Y3DYjDeaZ+YxrDF8Y5sUGSV6WfhBlYoRKFKSOcCULObpUxMpBN64fH+aIeUIZY2 ByvaFU5OAdOTVSbCBZnRlXYiUiSTjSjOo0KBWZhY20xG45zSRYjdYFJHWeR02V+1OOGg TiS/oNFeivJQG+DtHd3E36pghW7ck3+a0jX+/ajBmU6bjN0HXloEplq18BoEI50AGQhF epaYs6nHTDVqObH79qePjGoRTRtW1vcI7hC891pNtM/oUPDeh9iUqlxk+u19PjudPmCS iqLgOhJLzXBvorFVCIlMqXjwqcegjAdmkfVWpw+qZe83ELqspTVr0n9e9oojRtgC1Bkr hA== Received: from dc5-exch01.marvell.com ([199.233.59.181]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3th2b6h3xr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Wed, 04 Oct 2023 05:28:06 -0700 Received: from DC5-EXCH01.marvell.com (10.69.176.38) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.48; Wed, 4 Oct 2023 05:28:04 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server id 15.0.1497.48 via Frontend Transport; Wed, 4 Oct 2023 05:28:04 -0700 Received: from jerin-lab.marvell.com (jerin-lab.marvell.com [10.28.34.14]) by maili.marvell.com (Postfix) with ESMTP id 550B83F7074; Wed, 4 Oct 2023 05:27:59 -0700 (PDT) From: To: Thomas Monjalon CC: , , Jerin Jacob Subject: [dpdk-dev] [PATCH 1/2] devtools: support skipping forbid rule check Date: Wed, 4 Oct 2023 17:57:52 +0530 Message-ID: <20231004122753.3261337-1-jerinj@marvell.com> X-Mailer: git-send-email 2.42.0 MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: 71cGbpbBMd-JZJSuaYZv1iIJhwhMXMS2 X-Proofpoint-GUID: 71cGbpbBMd-JZJSuaYZv1iIJhwhMXMS2 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.267,Aquarius:18.0.980,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-10-04_04,2023-10-02_01,2023-05-22_02 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 From: Jerin Jacob In some case, a set of files in directory may need to skip forbid rules check. Added an infrastructure to enable the same using SKIP_FILES variable. Signed-off-by: Jerin Jacob --- devtools/check-forbidden-tokens.awk | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/devtools/check-forbidden-tokens.awk b/devtools/check-forbidden-tokens.awk index 026844141c..90d3a64f8e 100755 --- a/devtools/check-forbidden-tokens.awk +++ b/devtools/check-forbidden-tokens.awk @@ -58,8 +58,11 @@ BEGIN { for (i in deny_folders) { re = "^\\+\\+\\+ b/" deny_folders[i]; if ($0 ~ re) { - in_file = 1 - last_file = $0 + # Check only if the files are not part of SKIP_FILES + if (!(length(SKIP_FILES) && ($re ~ SKIP_FILES))) { + in_file = 1 + last_file = $0 + } } } } From patchwork Wed Oct 4 12:27:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerin Jacob X-Patchwork-Id: 132303 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 1E90A426B6; Wed, 4 Oct 2023 14:28:15 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0879940695; Wed, 4 Oct 2023 14:28:15 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id D881F402CE for ; Wed, 4 Oct 2023 14:28:12 +0200 (CEST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3945rGHw018975; Wed, 4 Oct 2023 05:28:12 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=pfpt0220; bh=lhLiUHbED4TXG1ufEuUXkepV0HRWvyqRiU5rc2sDl4o=; b=L0jXBo/X8qh9rvOtkBd1xibatHwjRsxbjuN0ZqpugORWebzfazqp2SuJtAA7V5y/b/i6 4P3n1hPbTyJ2kcSeZtSbO9t+ZjkpeZ06W+24EwdbhlQB5mU10/4hFeRSbwC+qPeXeUbj x66Jvmde79q/IHfe2T/26j4IwgrbIv+dokOigeCywJRceb30Lhy3hEFM6h8hqwFZbP8w XYMfK/lsOB6A4CkHhijJXBijAvuk54G1cDrrD0aRrl40yGRvd/FhMbV6vnjTRcRtJqrK ywmwrWs4QcGKLhxCFtL3yUq/fGIL2qaBY9/ywG60HCzIqJupMzwxkg0wcVzlA81M2z6i LA== Received: from dc5-exch01.marvell.com ([199.233.59.181]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3th29uh383-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Wed, 04 Oct 2023 05:28:11 -0700 Received: from DC5-EXCH01.marvell.com (10.69.176.38) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.48; Wed, 4 Oct 2023 05:28:09 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server id 15.0.1497.48 via Frontend Transport; Wed, 4 Oct 2023 05:28:09 -0700 Received: from jerin-lab.marvell.com (jerin-lab.marvell.com [10.28.34.14]) by maili.marvell.com (Postfix) with ESMTP id 2FAFD3F7044; Wed, 4 Oct 2023 05:28:03 -0700 (PDT) From: To: Thomas Monjalon CC: , , Jerin Jacob Subject: [dpdk-dev] [PATCH 2/2] devtools: forbid rte symbols in cnxk base driver Date: Wed, 4 Oct 2023 17:57:53 +0530 Message-ID: <20231004122753.3261337-2-jerinj@marvell.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231004122753.3261337-1-jerinj@marvell.com> References: <20231004122753.3261337-1-jerinj@marvell.com> MIME-Version: 1.0 X-Proofpoint-GUID: InsWxb9bEO4WGb0j9M_WtbTm5JFaZ7M9 X-Proofpoint-ORIG-GUID: InsWxb9bEO4WGb0j9M_WtbTm5JFaZ7M9 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.267,Aquarius:18.0.980,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-10-04_04,2023-10-02_01,2023-05-22_02 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 From: Jerin Jacob cnxk base code is shared between different driver environments. Forbid the direct usage of rte_ symbols instead use plt_ symbol as alternatives. roc_platform.[ch] files abstract the difference of driver environment, hence skip those files for rules check. Suggested-by: David Marchand Signed-off-by: Jerin Jacob --- devtools/checkpatches.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/devtools/checkpatches.sh b/devtools/checkpatches.sh index 2635923e14..8baa4e9a04 100755 --- a/devtools/checkpatches.sh +++ b/devtools/checkpatches.sh @@ -223,6 +223,15 @@ check_forbidden_additions() { # -f $(dirname $(readlink -f $0))/check-forbidden-tokens.awk \ "$1" || res=1 + # forbid using rte_ symbols in cnxk driver base code + awk -v FOLDERS='drivers/common/cnxk/roc_*' \ + -v SKIP_FILES='roc_platform*' \ + -v EXPRESSIONS="rte_ RTE_" \ + -v RET_ON_FAIL=1 \ + -v MESSAGE='Use plt_ symbols instead of rte_ symbols in cnxk driver base code' \ + -f $(dirname $(readlink -f $0))/check-forbidden-tokens.awk \ + "$1" || res=1 + return $res }