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, Stephen Hemminger <stephen@networkplumber.org>
Subject: [PATCH v3 04/13] devtools: handle multiple drivers in doc check
Date: Thu, 22 Oct 2026 19:44:31 +0200	[thread overview]
Message-ID: <20261022174447.412638-5-david.marchand@redhat.com> (raw)
In-Reply-To: <20261022174447.412638-1-david.marchand@redhat.com>

Some drivers have multiple doc files sharing one code directory
(e.g., igb, igc, e1000 variants). Others have doc files for VF/DCF
variants (e.g., ice_dcf, ixgbe_vf).

Extend driver_code_dir() to strip variant suffixes and map driver
names to their shared code directories.

Build a cache mapping each code directory to its associated doc
files. Add docs_for_code() to retrieve all doc names for a given
code directory.

Add items_not_in() to compute set difference between two lists.
Use it in check_rte_flow() to compare doc vs code items:
- items documented but not in code are always reported,
- items in code but not documented in any doc for the code
  directory are reported, avoiding false positives when multiple
  docs share the same code.

Also rename doc files to match their code directory names.

Signed-off-by: David Marchand <david.marchand@redhat.com>
---
Changes since v2:
- introduced logic earlier in the series,
- added comments and implemented for rte_flow checks,

---
 MAINTAINERS                                   |   2 +-
 devtools/check-doc-vs-code.sh                 | 109 +++++++++++++++---
 .../features/{afpacket.ini => af_packet.ini}  |   2 +-
 .../features/{cxgbevf.ini => cxgbe_vf.ini}    |   2 +-
 4 files changed, 98 insertions(+), 17 deletions(-)
 rename doc/guides/nics/features/{afpacket.ini => af_packet.ini} (70%)
 rename doc/guides/nics/features/{cxgbevf.ini => cxgbe_vf.ini} (90%)

diff --git a/MAINTAINERS b/MAINTAINERS
index 1720cff62e..e05bea2f0c 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -679,7 +679,7 @@ F: examples/bond/
 Linux AF_PACKET
 M: Stephen Hemminger <stephen@networkplumber.org>
 F: drivers/net/af_packet/
-F: doc/guides/nics/features/afpacket.ini
+F: doc/guides/nics/features/af_packet.ini
 F: app/test/test_pmd_af_packet.c
 
 Linux AF_XDP
diff --git a/devtools/check-doc-vs-code.sh b/devtools/check-doc-vs-code.sh
index e141fe9938..7afc18d153 100755
--- a/devtools/check-doc-vs-code.sh
+++ b/devtools/check-doc-vs-code.sh
@@ -36,35 +36,86 @@ has_file_change() # <pattern>
 	changed_files | grep -q "$1"
 }
 
+net_driver_from_path() # <path>
+{
+	sed -rn '
+		s,.*drivers/net/intel/([^/]*)/.*,\1,p; t
+		s,.*drivers/net/([^./]*)/.*,\1,p; t
+		s,.*doc/guides/nics/features/([^./]*).*,\1,p' |
+	grep -v '^default$'
+}
+
 changed_net_drivers()
 {
 	[ -n "$drivers" ] ||
 		drivers=$(changed_files |
-			sed -rn '
-				s,^drivers/net/intel/([^/]*).*,\1,p; t
-				s,^drivers/net/([^/]*).*,\1,p; t
-				s,^doc/guides/nics/features/([^.]*).*,\1,p' |
+			net_driver_from_path |
 			sort -u)
 	echo "$drivers"
 }
 
 all_net_drivers()
 {
-	find $rootdir/drivers/net -name meson.build |
-	sed -rn '
-		s,.*drivers/net/intel/([^/]*).*,\1,p; t
-		s,.*drivers/net/([^/]*).*,\1,p' |
+	{
+		find $rootdir/drivers/net -name meson.build
+		ls $rootdir/doc/guides/nics/features/*.ini
+	} |
+	net_driver_from_path |
 	sort -u
 }
 
 # give back a driver directory for a doc/driver name
 driver_code_dir() # <driver_name>
 {
-	if [ -d $rootdir/drivers/net/intel/$1 ]; then
-		echo "$rootdir/drivers/net/intel/$1"
-	else
-		echo "$rootdir/drivers/net/$1"
-	fi
+	drv=$(echo "$1" | sed -r 's/_(dcf|vec|vf)$//')
+	case $drv in
+	enetc|enetc4)
+		echo "$rootdir/drivers/net/enetc" ;;
+	igb|igc|e1000)
+		echo "$rootdir/drivers/net/intel/e1000" ;;
+	*)
+		if [ -d $rootdir/drivers/net/intel/$drv ]; then
+			echo "$rootdir/drivers/net/intel/$drv"
+		else
+			echo "$rootdir/drivers/net/$drv"
+		fi ;;
+	esac
+}
+
+# create a cache of the mapping between a driver code directory and associated driver docs
+# format of this cache is:
+# ^,$drv1_directory: $drv1_doc_name1 $drv1_doc_name2,$drv2_directory: $drv2_doc_name1,...,$
+doc_code_map=","
+for d in $rootdir/doc/guides/nics/features/*.ini; do
+	drv=$(basename "$d" .ini)
+	[ "$drv" != 'default' ] || continue
+	code=$(driver_code_dir $drv)
+	case $doc_code_map in
+	*,$code:*)
+		before=${doc_code_map%,$code:*}
+		after=${doc_code_map#*,$code:}
+		drvs=${after%%,*}
+		rest=${after#*,}
+		doc_code_map="$before,$code:$drvs $drv,$rest" ;;
+	*)
+		doc_code_map="$doc_code_map$code: $drv," ;;
+	esac
+done
+
+# extract all doc names from the cache created above
+docs_for_code() # <code_dir>
+{
+	tmp=${doc_code_map#*,$1:}
+	echo ${tmp%%,*}
+}
+
+# output items from first list that are not in second list
+items_not_in() # <list1> <list2>
+{
+	{
+		[ -n "$1" ] && echo "$1"
+		[ -n "$2" ] && { echo "$2"; echo "$2"; }
+	} | sort | uniq -u
 }
 
 check_rte_flow() # <driver>
@@ -73,7 +124,37 @@ check_rte_flow() # <driver>
 	doc=$rootdir/doc/guides/nics/features/$1.ini
 	[ -d $code ] || return 0
 	[ -f $doc ] || return 0
-	report=$($selfdir/parse-flow-support.sh $code $doc)
+	code_support=$($selfdir/parse-flow-support.sh $code)
+	report=$(
+		for category in item action; do
+			section="rte_flow ${category}s]"
+			code_items=$(echo "$code_support" | sed -n "/$section/,/]/p" |
+				sed '/]/d' |        # ignore section title
+				sed 's, *=.*,,' |   # keep only item name
+				sed '/^$/d' |       # remove empty lines
+				sort -u)
+			doc_items=$(sed -n "/$section/,/]/p" "$doc" |
+				sed '/]/d' |        # ignore section title
+				sed 's, *=.*,,' |   # keep only item name
+				sed '/^$/d' |       # remove empty lines
+				sort -u)
+			{
+				# items documented but not in code
+				items_not_in "$doc_items" "$code_items"
+				# items in code but not documented in any doc for the code directory
+				all_doc_items=$(
+					for drv in $(docs_for_code $code); do
+						d=$rootdir/doc/guides/nics/features/$drv.ini
+						sed -n "/$section/,/]/p" "$d" |
+							sed '/]/d' |        # ignore section title
+							sed 's, *=.*,,' |   # keep only item name
+							sed '/^$/d'         # remove empty lines
+					done | sort -u
+				)
+				items_not_in "$code_items" "$all_doc_items"
+			} | sed "s,^,$category ,"   # prefix with category name
+		done
+	)
 	if [ -n "$report" ]; then
 		error "rte_flow doc out of sync for $1"
 		echo "$report" | sed 's,^,\t,'
diff --git a/doc/guides/nics/features/afpacket.ini b/doc/guides/nics/features/af_packet.ini
similarity index 70%
rename from doc/guides/nics/features/afpacket.ini
rename to doc/guides/nics/features/af_packet.ini
index bc669dfb8a..b1cbc54aca 100644
--- a/doc/guides/nics/features/afpacket.ini
+++ b/doc/guides/nics/features/af_packet.ini
@@ -1,5 +1,5 @@
 ;
-; Supported features of the 'afpacket' network poll mode driver.
+; Supported features of the 'af_packet' network poll mode driver.
 ;
 ; Refer to default.ini for the full list of available PMD features.
 ;
diff --git a/doc/guides/nics/features/cxgbevf.ini b/doc/guides/nics/features/cxgbe_vf.ini
similarity index 90%
rename from doc/guides/nics/features/cxgbevf.ini
rename to doc/guides/nics/features/cxgbe_vf.ini
index a921cda6b1..b77b202272 100644
--- a/doc/guides/nics/features/cxgbevf.ini
+++ b/doc/guides/nics/features/cxgbe_vf.ini
@@ -1,5 +1,5 @@
 ;
-; Supported features of the 'cxgbevf' network poll mode driver.
+; Supported features of the 'cxgbe_vf' network poll mode driver.
 ;
 ; Refer to default.ini for the full list of available PMD features.
 ;
-- 
2.54.0


  parent reply	other threads:[~2026-10-22 17:45 UTC|newest]

Thread overview: 54+ 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 ` [PATCH 4/8] devtools: check VMDq capability David Marchand
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
2026-10-19  6:41   ` Renyong Wan
2026-10-21 10:30 ` [PATCH v2 00/12] " David Marchand
2026-10-21 10:30   ` [PATCH v2 01/12] devtools: fix matching in doc check David Marchand
2026-10-21 10:42     ` Thomas Monjalon
2026-10-21 10:30   ` [PATCH v2 02/12] doc: fix L2TPv2 and PPP matching support for ICE David Marchand
2026-10-21 10:30   ` [PATCH v2 03/12] devtools: handle multiple drivers in doc check David Marchand
2026-10-22  9:39     ` Thomas Monjalon
2026-10-21 10:30   ` [PATCH v2 04/12] net/bnxt: remove leftover VMDq code in MAC helpers David Marchand
2026-10-21 10:30   ` [PATCH v2 05/12] drivers/net: fix reported VMDq capability David Marchand
2026-10-21 10:53     ` Bruce Richardson
2026-10-21 10:30   ` [PATCH v2 06/12] drivers/net: remove check on VMDq modes David Marchand
2026-10-21 10:55     ` Bruce Richardson
2026-10-21 10:30   ` [PATCH v2 07/12] devtools: check VMDq capability David Marchand
2026-10-22  9:44     ` Thomas Monjalon
2026-10-21 10:30   ` [PATCH v2 08/12] doc: fix DCB capability for some Intel drivers David Marchand
2026-10-21 11:04     ` Bruce Richardson
2026-10-21 10:30   ` [PATCH v2 09/12] ethdev: check DCB availability David Marchand
2026-10-21 11:07     ` Bruce Richardson
2026-10-21 10:30   ` [PATCH v2 10/12] drivers/net: fix reported RSS capability David Marchand
2026-10-22  6:17     ` Renyong Wan
2026-10-21 10:30   ` [PATCH v2 11/12] ethdev: check RSS availability David Marchand
2026-10-21 10:30   ` [PATCH v2 12/12] ethdev: check unknown Rx/Tx multi-queue modes David Marchand
2026-10-21 17:42   ` [PATCH v2 00/12] Validate multiqueue configuration in ethdev Stephen Hemminger
2026-10-22 17:44 ` [PATCH v3 00/13] " David Marchand
2026-10-22 17:44   ` [PATCH v3 01/13] devtools: fix matching in doc check David Marchand
2026-10-22 17:44   ` [PATCH v3 02/13] doc: fix L2TPv2 and PPP matching support for ICE David Marchand
2026-10-22 17:44   ` [PATCH v3 03/13] devtools: support Intel drivers in doc check David Marchand
2026-10-23 10:11     ` Thomas Monjalon
2026-10-22 17:44   ` David Marchand [this message]
2026-10-23 10:13     ` [PATCH v3 04/13] devtools: handle multiple " Thomas Monjalon
2026-10-23 15:08       ` David Marchand
2026-10-22 17:44   ` [PATCH v3 05/13] net/bnxt: remove leftover VMDq code in MAC helpers David Marchand
2026-10-22 17:44   ` [PATCH v3 06/13] drivers/net: fix reported VMDq capability David Marchand
2026-10-22 17:44   ` [PATCH v3 07/13] drivers/net: remove check on VMDq modes David Marchand
2026-10-27  2:38     ` fengchengwen
2026-10-22 17:44   ` [PATCH v3 08/13] devtools: check VMDq capability David Marchand
2026-10-22 17:44   ` [PATCH v3 09/13] doc: fix DCB capability for some Intel drivers David Marchand
2026-10-22 17:44   ` [PATCH v3 10/13] ethdev: check DCB availability David Marchand
2026-10-27  2:39     ` fengchengwen
2026-10-22 17:44   ` [PATCH v3 11/13] drivers/net: fix reported RSS capability David Marchand
2026-10-22 17:44   ` [PATCH v3 12/13] ethdev: check RSS availability David Marchand
2026-10-27  2:41     ` fengchengwen
2026-10-22 17:44   ` [PATCH v3 13/13] ethdev: check unknown Rx/Tx multi-queue modes David Marchand
2026-10-26 18:11   ` [PATCH v3 00/13] 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=20261022174447.412638-5-david.marchand@redhat.com \
    --to=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=stephen@networkplumber.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