DPDK-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: David Marchand <david.marchand@redhat.com>
To: dev@dpdk.org
Cc: thomas@monjalon.net
Subject: [PATCH 4/8] devtools: check VMDq capability
Date: Fri, 16 Oct 2026 15:05:50 +0200	[thread overview]
Message-ID: <20261016130555.1685102-5-david.marchand@redhat.com> (raw)
In-Reply-To: <20261016130555.1685102-1-david.marchand@redhat.com>

Let's check that the code and the documentation are aligned for VMDq
capability.

Note: some driver directory hosts multiple drivers that have multiple
corresponding entry in doc/guides/features/. For this case, only try to
detect a discrepancy if all docs agree.

Signed-off-by: David Marchand <david.marchand@redhat.com>
---
 devtools/check-doc-vs-code.sh | 46 ++++++++++++++++++++++++++++++++++-
 1 file changed, 45 insertions(+), 1 deletion(-)

diff --git a/devtools/check-doc-vs-code.sh b/devtools/check-doc-vs-code.sh
index c58c239c87..7936f8b69f 100755
--- a/devtools/check-doc-vs-code.sh
+++ b/devtools/check-doc-vs-code.sh
@@ -28,7 +28,7 @@ changed_files()
 
 has_code_change() # <pattern>
 {
-	test -n "$(git log --format='%h' -S"$1" $trusted_commit..)"
+	test -n "$(git log --format='%h' -G"$1" $trusted_commit..)"
 }
 
 has_file_change() # <pattern>
@@ -53,6 +53,43 @@ all_net_drivers()
 	sort
 }
 
+has_doc_feature() # <ini_file> <feature>
+{
+	grep -q "^$2[[:space:]]*=[[:space:]]*[YP]" "$1"
+}
+
+all_docs_agree() # <driver> <feature>
+{
+	first=""
+	for d in "$rootdir/doc/guides/nics/features/${1}"*.ini; do
+		[ -f "$d" ] || return 1
+		has_doc_feature "$d" "$2" && val=true || val=false
+		[ -n "$first" ] || first=$val
+		[ "$first" = "$val" ] || return 1
+	done
+	return 0
+}
+
+check_mq_caps() # <driver>
+{
+	code=$rootdir/drivers/net/$1
+	doc=$rootdir/doc/guides/nics/features/$1.ini
+	[ -d $code ] || return 0
+	[ -f $doc ] || return 0
+
+	if all_docs_agree $1 "VMDq"; then
+		if has_doc_feature "$doc" "VMDq"; then
+			git grep -qE 'max_vmdq_pools[[:space:]]*=' -- "$code" ||
+				error "VMDq documented but max_vmdq_pools not set for $1"
+		else
+			! git grep -qE 'max_vmdq_pools[[:space:]]*=' -- "$code" ||
+				error "max_vmdq_pools set but VMDq not documented for $1"
+			! git grep -qE 'RTE_ETH_MQ_(RX|TX).*VMDQ' -- "$code" ||
+				error "VMDq mq_mode referenced but VMDq not documented for $1"
+		fi
+	fi
+}
+
 check_rte_flow() # <driver>
 {
 	code=$rootdir/drivers/net/$1
@@ -70,6 +107,7 @@ if [ -z "$trusted_commit" ]; then
 	# check all
 	for driver in $(all_net_drivers); do
 		check_rte_flow $driver
+		check_mq_caps $driver
 	done
 	exit $result
 fi
@@ -81,4 +119,10 @@ if has_code_change 'RTE_FLOW_.*_TYPE_' ||
 		check_rte_flow $driver
 	done
 fi
+if has_code_change 'max_vmdq_pools\|RTE_ETH_MQ_.*VMDQ' ||
+		has_file_change 'doc/guides/nics/features'; then
+	for driver in $(changed_net_drivers); do
+		check_mq_caps $driver
+	done
+fi
 exit $result
-- 
2.54.0


  parent reply	other threads:[~2026-10-16 13:06 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-16 13:05 [PATCH 0/8] Validate multiqueue configuration in ethdev David Marchand
2026-10-16 13:05 ` [PATCH 1/8] net/bnxt: remove leftover VMDq code in MAC helpers David Marchand
2026-10-16 13:05 ` [PATCH 2/8] drivers/net: fix reported VMDq capability David Marchand
2026-10-16 13:05 ` [PATCH 3/8] drivers/net: remove check on VMDq modes David Marchand
2026-10-16 13:05 ` David Marchand [this message]
2026-10-16 13:05 ` [PATCH 5/8] ethdev: check DCB availability David Marchand
2026-10-16 13:05 ` [PATCH 6/8] drivers/net: fix reported RSS capability David Marchand
2026-10-16 13:05 ` [PATCH 7/8] ethdev: check RSS availability David Marchand
2026-10-16 13:05 ` [PATCH 8/8] ethdev: check unknown Rx/Tx multi-queue modes David Marchand
2026-10-16 16:44 ` [PATCH 0/8] Validate multiqueue configuration in ethdev Stephen Hemminger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261016130555.1685102-5-david.marchand@redhat.com \
    --to=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=thomas@monjalon.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox