From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 7E100A0C45; Mon, 22 Nov 2021 08:55:29 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id F2BEF41199; Mon, 22 Nov 2021 08:55:01 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id EF282411B5 for ; Mon, 22 Nov 2021 08:54:57 +0100 (CET) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.1.2/8.16.1.2) with ESMTP id 1AM63qOf030218; Sun, 21 Nov 2021 23:54:57 -0800 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=t8N5Ms3Bxl9PHmVTbvcxaPsPpnSqKk2D1zja9/2Gng8=; b=cSrUqB5UjGINM++1sU118XYDckfZuzCZY1+gZxivqVB9CI7P5z6WR5QV5puexVE9yYQp AhincOQa5DjN1zVpAPkJWR/6nfTCvipUZP1gfAE+L15HIr1SO3AhWBSAr8xQm220M0iH SGdMIw6yYtOsZ4yzJNLhcuzsBEhSsOsBhMLbG0qsRh2xnwB0VwmQ7mLaDzuXTLKKtxBL RTbB6I1CH8PkOT8FDVeX3nv/ZukAoqyw5ZzBEyFNGVahG6MCc1KOzGCkfoLo4M/8PWiT /4JG+UWwN9G/GGIjkOYqamD7S0SZsyzR+axpnOWclCk5jLO85jGNZqBOJMiJ2fje/ZI6 fw== Received: from dc6wp-exch01.marvell.com ([4.21.29.232]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3cg5m18a8r-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Sun, 21 Nov 2021 23:54:57 -0800 Received: from DC5-EXCH01.marvell.com (10.69.176.38) by DC6WP-EXCH01.marvell.com (10.76.176.21) with Microsoft SMTP Server (TLS) id 15.0.1497.23; Mon, 22 Nov 2021 02:54:55 -0500 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.2; Sun, 21 Nov 2021 23:54:54 -0800 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.2 via Frontend Transport; Sun, 21 Nov 2021 23:54:54 -0800 Received: from localhost.localdomain (unknown [10.28.34.25]) by maili.marvell.com (Postfix) with ESMTP id 38E033F7040; Sun, 21 Nov 2021 23:54:50 -0800 (PST) From: To: , , , , , , , , Thomas Monjalon CC: , Sunil Kumar Kori Subject: [PATCH v7 11/11] devtools: check event device doc tables Date: Mon, 22 Nov 2021 13:24:14 +0530 Message-ID: <20211122075414.1834651-11-skori@marvell.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211122075414.1834651-1-skori@marvell.com> References: <20211115131518.1650809-1-skori@marvell.com> <20211122075414.1834651-1-skori@marvell.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-GUID: N6L3H8qjuEdwemq16gy_tXNzUWas7PLV X-Proofpoint-ORIG-GUID: N6L3H8qjuEdwemq16gy_tXNzUWas7PLV X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.790,Hydra:6.0.425,FMLib:17.0.607.475 definitions=2021-11-22_03,2021-11-22_01,2020-04-07_01 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: Sunil Kumar Kori In this commit, check is added for event device, Rx, Tx, Crypto and Timer adapters tables for all supported drivers. Signed-off-by: Sunil Kumar Kori --- v7: - Rebased to 21.11 rc3 - Fix Tx adapter capabilities for SW driver v6: - Rebased to 21.11 rc2 - Added feature matrices for all supported drivers - Added doc vs code check script v5: - Rebased to 21.11 - Added feature matrix for cnxk. v4: - Rebased to 20.02 v3: - Removed .txt files to generate tables. - Use conf.py script to generate tables. - Add .ini file for all supported PMDs. v2: - Review comments incorporated devtools/check-doc-vs-code.sh | 35 ++++++++ devtools/parse-event-support.sh | 149 ++++++++++++++++++++++++++++++++ 2 files changed, 184 insertions(+) create mode 100755 devtools/parse-event-support.sh diff --git a/devtools/check-doc-vs-code.sh b/devtools/check-doc-vs-code.sh index c58c239c87..608d6e0e2e 100755 --- a/devtools/check-doc-vs-code.sh +++ b/devtools/check-doc-vs-code.sh @@ -66,11 +66,35 @@ check_rte_flow() # fi } +all_event_drivers() +{ + find $rootdir/drivers/event -mindepth 1 -maxdepth 1 -type d | + sed 's,.*/,,' | + sort +} + +check_event_dev() # +{ + code=$rootdir/drivers/event/$1 + doc=$rootdir/doc/guides/eventdevs/features/$1.ini + [ -d $code ] || return 0 + [ -f $doc ] || return 0 + report=$($selfdir/parse-event-support.sh $code $doc) + if [ -n "$report" ]; then + error "doc out of sync for $1" + echo "$report" | sed 's,^,\t,' + fi +} + if [ -z "$trusted_commit" ]; then # check all for driver in $(all_net_drivers); do check_rte_flow $driver done + + for driver in $(all_event_drivers); do + check_event_dev $driver + done exit $result fi @@ -81,4 +105,15 @@ if has_code_change 'RTE_FLOW_.*_TYPE_' || check_rte_flow $driver done fi + +if has_code_change 'RTE_EVENT_DEV_CAP_*' || + has_code_change 'RTE_EVENT_ETH_RX_ADAPTER_CAP_*' || + has_code_change 'RTE_EVENT_ETH_TX_ADAPTER_CAP_*' || + has_code_change 'RTE_EVENT_CRYPTO_ADAPTER_CAP_*' || + has_code_change 'RTE_EVENT_TIMER_ADAPTER_CAP_*' || + has_file_change 'doc/guides/eventdevs/features'; then + for driver in $(all_event_drivers); do + check_event_dev $driver + done +fi exit $result diff --git a/devtools/parse-event-support.sh b/devtools/parse-event-support.sh new file mode 100755 index 0000000000..d756977eec --- /dev/null +++ b/devtools/parse-event-support.sh @@ -0,0 +1,149 @@ +#! /bin/sh -e +# SPDX-License-Identifier: BSD-3-Clause +# Copyright(C) 2021 Marvell. + +# Parse event dev support of a driver directory, +# and optionally show difference with a doc file in .ini format. + +dir=$1 # drivers/event/foo +ref=$2 # doc/guides/eventdevs/features/foo.ini + +if [ -z "$dir" ]; then + echo "directory argument is required" >&2 + exit 1 +fi + +# sorting order +export LC_COLLATE=C + +# generate INI section +list() # <pattern> +{ + echo "[$1]" + git grep -who "$2[[:alnum:]_]*" $dir | sort -u | + awk 'sub(/'$2'/, "") {printf "%-20s = Y\n", tolower($0)}' +} + +event_dev_sched_support() +{ + title="Scheduling Features" + pattern=$(echo "RTE_EVENT_DEV_CAP_" | awk '{print toupper($0)}') + list "$title" "$pattern" | grep -vwE 'void|indirect|end' +} + +event_dev_rx_adptr_support() +{ + title="Eth Rx adapter Features" + pattern=$(echo "RTE_EVENT_ETH_RX_ADAPTER_CAP_" | + awk '{print toupper($0)}') + list "$title" "$pattern" | grep -vwE 'void|indirect|end' +} + +event_dev_tx_adptr_support() +{ + title="Eth Tx adapter Features" + pattern=$(echo "RTE_EVENT_ETH_TX_ADAPTER_CAP_" | + awk '{print toupper($0)}') + list "$title" "$pattern" | grep -vwE 'void|indirect|end' +} + +event_dev_crypto_adptr_support() +{ + title="Crypto adapter Features" + pattern=$(echo "RTE_EVENT_CRYPTO_ADAPTER_CAP_" | + awk '{print toupper($0)}') + list "$title" "$pattern" | grep -vwE 'void|indirect|end' +} + +event_dev_timer_adptr_support() +{ + title="Timer adapter Features" + pattern=$(echo "RTE_EVENT_TIMER_ADAPTER_CAP_" | + awk '{print toupper($0)}') + list "$title" "$pattern" | grep -vwE 'void|indirect|end' +} + +if [ -z "$ref" ]; then # generate full tables + event_dev_sched_support + echo + event_dev_rx_adptr_support + echo + event_dev_tx_adptr_support + echo + event_dev_crypto_adptr_support + echo + event_dev_timer_adptr_support + exit 0 +fi + +# compare with reference input +event_dev_sched_compare() +{ + section="Scheduling Features]" + { + event_dev_sched_support + sed -n "/$section/,/]/p" "$ref" | sed '/^$/d' + } | + sed '/]/d' | # ignore section title + sed 's, *=.*,,' | # ignore value (better in doc than generated one) + sort | uniq -u | # show differences + sed "s,^,Scheduling Features ," # prefix with category name +} + +event_dev_rx_adptr_compare() +{ + section="Eth Rx adapter Features]" + { + event_dev_rx_adptr_support + sed -n "/$section/,/]/p" "$ref" | sed '/^$/d' + } | + sed '/]/d' | # ignore section title + sed 's, *=.*,,' | # ignore value (better in doc than generated one) + sort | uniq -u | # show differences + sed "s,^,Eth Rx adapter Features ," # prefix with category name +} + +event_dev_tx_adptr_compare() +{ + section="Eth Tx adapter Features]" + { + event_dev_tx_adptr_support + sed -n "/$section/,/]/p" "$ref" | sed '/^$/d' + } | + sed '/]/d' | # ignore section title + sed 's, *=.*,,' | # ignore value (better in doc than generated one) + sort | uniq -u | # show differences + sed "s,^,Eth Tx adapter Features ," # prefix with category name +} + +event_dev_crypto_adptr_compare() +{ + section="Crypto adapter Features]" + { + event_dev_crypto_adptr_support + sed -n "/$section/,/]/p" "$ref" | sed '/^$/d' + } | + sed '/]/d' | # ignore section title + sed 's, *=.*,,' | # ignore value (better in doc than generated one) + sort | uniq -u | # show differences + sed "s,^,Crypto adapter Features ," # prefix with category name +} + +event_dev_crypto_adptr_compare() +{ + section="Timer adapter Features]" + { + event_dev_timer_adptr_support + sed -n "/$section/,/]/p" "$ref" | sed '/^$/d' + } | + sed '/]/d' | # ignore section title + sed 's, *=.*,,' | # ignore value (better in doc than generated one) + sort | uniq -u | # show differences + sed "s,^,Timer adapter Features ," # prefix with category name +} + +event_dev_sched_compare +event_dev_rx_adptr_compare +event_dev_tx_adptr_compare +event_dev_crypto_adptr_compare +event_dev_crypto_adptr_compare -- 2.25.1