* [dpdk-dev] [PATCH 1/2] devtools: support skipping forbid rule check
@ 2023-10-04 12:27 jerinj
2023-10-04 12:27 ` [dpdk-dev] [PATCH 2/2] devtools: forbid rte symbols in cnxk base driver jerinj
2023-11-17 4:34 ` [dpdk-dev] [PATCH 1/2] devtools: support skipping forbid rule check Jerin Jacob
0 siblings, 2 replies; 4+ messages in thread
From: jerinj @ 2023-10-04 12:27 UTC (permalink / raw)
To: Thomas Monjalon; +Cc: dev, david.marchand, Jerin Jacob
From: Jerin Jacob <jerinj@marvell.com>
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 <jerinj@marvell.com>
---
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
+ }
}
}
}
--
2.42.0
^ permalink raw reply [flat|nested] 4+ messages in thread
* [dpdk-dev] [PATCH 2/2] devtools: forbid rte symbols in cnxk base driver
2023-10-04 12:27 [dpdk-dev] [PATCH 1/2] devtools: support skipping forbid rule check jerinj
@ 2023-10-04 12:27 ` jerinj
2023-11-28 11:54 ` Thomas Monjalon
2023-11-17 4:34 ` [dpdk-dev] [PATCH 1/2] devtools: support skipping forbid rule check Jerin Jacob
1 sibling, 1 reply; 4+ messages in thread
From: jerinj @ 2023-10-04 12:27 UTC (permalink / raw)
To: Thomas Monjalon; +Cc: dev, david.marchand, Jerin Jacob
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(+)
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
}
--
2.42.0
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [dpdk-dev] [PATCH 2/2] devtools: forbid rte symbols in cnxk base driver
2023-10-04 12:27 ` [dpdk-dev] [PATCH 2/2] devtools: forbid rte symbols in cnxk base driver jerinj
@ 2023-11-28 11:54 ` Thomas Monjalon
0 siblings, 0 replies; 4+ messages in thread
From: Thomas Monjalon @ 2023-11-28 11:54 UTC (permalink / raw)
To: Jerin Jacob; +Cc: dev, david.marchand
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'
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [dpdk-dev] [PATCH 1/2] devtools: support skipping forbid rule check
2023-10-04 12:27 [dpdk-dev] [PATCH 1/2] devtools: support skipping forbid rule check jerinj
2023-10-04 12:27 ` [dpdk-dev] [PATCH 2/2] devtools: forbid rte symbols in cnxk base driver jerinj
@ 2023-11-17 4:34 ` Jerin Jacob
1 sibling, 0 replies; 4+ messages in thread
From: Jerin Jacob @ 2023-11-17 4:34 UTC (permalink / raw)
To: jerinj; +Cc: Thomas Monjalon, dev, david.marchand
On Wed, Oct 4, 2023 at 11:56 PM <jerinj@marvell.com> wrote:
>
> From: Jerin Jacob <jerinj@marvell.com>
>
> 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 <jerinj@marvell.com>
Ping for review
> ---
> 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
> + }
> }
> }
> }
> --
> 2.42.0
>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2023-11-28 11:54 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-04 12:27 [dpdk-dev] [PATCH 1/2] devtools: support skipping forbid rule check jerinj
2023-10-04 12:27 ` [dpdk-dev] [PATCH 2/2] devtools: forbid rte symbols in cnxk base driver jerinj
2023-11-28 11:54 ` Thomas Monjalon
2023-11-17 4:34 ` [dpdk-dev] [PATCH 1/2] devtools: support skipping forbid rule check Jerin Jacob
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).