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 400A4A0C4C; Tue, 23 Nov 2021 12:08:47 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0740841171; Tue, 23 Nov 2021 12:08:24 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id 5D00241171 for ; Tue, 23 Nov 2021 12:08:22 +0100 (CET) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.1.2/8.16.1.2) with ESMTP id 1AN76tgg009970; Tue, 23 Nov 2021 03:08:21 -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=pf/cpO5GqyggpGltJjVhCJB7Pzl/+rAFxvfsR+JJV/E=; b=S+sievtSe8JxAlsgInC6qfWmtsl0QVkRl4K6dH5XrSsHS+xmAR+A6+cvudtdMgK0KNjh 1m+2PQuRYvsZQCJyMOFM/hWkYo5tGQg7GPQIZd/Vp2T8paiuNGVFnxdJz997B1Hb747c DGHfs/ttQpHTVxlRed/sxwHZ5kK3bb9zsnT4C8279fSKDj11rCkpDWsJ0n0Kq07zl72r 2/gwhdr+J01iKx84SFjVftBITSBRI4u71wvMdCKkFZWwsRYj/R85ZY0/9RFW9HI6nV74 dw5OpS9YU/Hrzb3mDsenYePiFmA8nX3uq4wJoUU7wh+bgo+xB4iYToV8RB1nXnX5s7vp uQ== Received: from dc5-exch01.marvell.com ([199.233.59.181]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3cgumj916t-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Tue, 23 Nov 2021 03:08:21 -0800 Received: from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 23 Nov 2021 03:08:19 -0800 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server id 15.0.1497.18 via Frontend Transport; Tue, 23 Nov 2021 03:08:19 -0800 Received: from localhost.localdomain (unknown [10.28.34.25]) by maili.marvell.com (Postfix) with ESMTP id AE7563F7097; Tue, 23 Nov 2021 03:08:16 -0800 (PST) From: To: , , , , , , , , Thomas Monjalon CC: , Sunil Kumar Kori Subject: [PATCH v8 10/10] devtools: check event device doc tables Date: Tue, 23 Nov 2021 16:37:43 +0530 Message-ID: <20211123110743.2002557-10-skori@marvell.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211123110743.2002557-1-skori@marvell.com> References: <20211122075414.1834651-1-skori@marvell.com> <20211123110743.2002557-1-skori@marvell.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-GUID: qTJzgnTlCbfQCuir80PuY7Y4vHiuMoh_ X-Proofpoint-ORIG-GUID: qTJzgnTlCbfQCuir80PuY7Y4vHiuMoh_ 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-23_04,2021-11-23_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 --- v8: - Fix script dump for dsw and SW driver - Review comments incorporated 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 | 165 ++++++++++++++++++++++++++++++++ 2 files changed, 200 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..f0f6b2392a --- /dev/null +++ b/devtools/parse-event-support.sh @@ -0,0 +1,165 @@ +#! /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 + +check_rx_adptr_sw_capa() +{ + driver=$(echo "$dir" | cut -d / -f 3) + if [ "$driver" = "dsw" ] || [ "$driver" = "sw" ] ; then + return 1 + else + return 0 + fi +} + +# generate INI section +list() # <pattern> <extra_patterns> +{ + echo "[$1]" + word0=$(git grep -who "$2[[:alnum:]_]*" $dir) + word1=$(echo "$3") + words="$word0""$word1" + echo "$words" | 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" "" +} + +event_dev_rx_adptr_support() +{ + title="Eth Rx adapter Features" + pattern=$(echo "RTE_EVENT_ETH_RX_ADAPTER_CAP_" | + awk '{print toupper($0)}') + check_rx_adptr_sw_capa || extra='RTE_EVENT_ETH_RX_ADAPTER_CAP_OVERRIDE_FLOW_ID + RTE_EVENT_ETH_RX_ADAPTER_CAP_MULTI_EVENTQ + RTE_EVENT_ETH_RX_ADAPTER_CAP_EVENT_VECTOR' + list "$title" "$pattern" "$extra" +} + +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" "" +} + +event_dev_crypto_adptr_support() +{ + title="Crypto adapter Features" + pattern=$(echo "RTE_EVENT_CRYPTO_ADAPTER_CAP_" | + awk '{print toupper($0)}') + list "$title" "$pattern" "" +} + +event_dev_timer_adptr_support() +{ + title="Timer adapter Features" + pattern=$(echo "RTE_EVENT_TIMER_ADAPTER_CAP_" | + awk '{print toupper($0)}') + list "$title" "$pattern" "" +} + +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_timer_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_timer_adptr_compare -- 2.25.1