[2/2] devtools: forbid rte symbols in cnxk base driver

Message ID 20231004122753.3261337-2-jerinj@marvell.com (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers
Series [1/2] devtools: support skipping forbid rule check |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/github-robot: build success github build: passed
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-compile-amd64-testing success Testing PASS
ci/iol-unit-amd64-testing success Testing PASS
ci/iol-unit-arm64-testing success Testing PASS
ci/iol-compile-arm64-testing success Testing PASS
ci/iol-sample-apps-testing success Testing PASS
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/intel-Functional success Functional PASS

Commit Message

Jerin Jacob Kollanukkaran Oct. 4, 2023, 12:27 p.m. UTC
  From: Jerin Jacob <jerinj@marvell.com>

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 <david.marchand@redhat.com>
Signed-off-by: Jerin Jacob <jerinj@marvell.com>
---
 devtools/checkpatches.sh | 9 +++++++++
 1 file changed, 9 insertions(+)
  

Comments

Thomas Monjalon Nov. 28, 2023, 11:54 a.m. UTC | #1
04/10/2023 14:27, jerinj@marvell.com:
> From: Jerin Jacob <jerinj@marvell.com>
> 
> 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 <david.marchand@redhat.com>
> Signed-off-by: Jerin Jacob <jerinj@marvell.com>

Series applied, thanks.

I've moved the check in a more appropriate place
to keep a kind of ordering in all checks.
Also, I've changed a word to mention "API":
MESSAGE='Use plt_ symbols instead of rte_ API in cnxk base driver'
  

Patch

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() { # <patch>
 		-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
 }