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 62BD1A0032; Mon, 15 Nov 2021 14:16:31 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id AF795411A4; Mon, 15 Nov 2021 14:16:02 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id 25C52411A4 for ; Mon, 15 Nov 2021 14:16:01 +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 1AFB9fDn014880; Mon, 15 Nov 2021 05:16:00 -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=wGrNSf5lVThnmanvBgBi5/rn3mSy8Nt+DkCtAoD0RHE=; b=Yl6PSXO56GixPZ80XFQBS7v3RTNR/DdwU0IeD1B11l7Doy/SdOqkXgKZSAYbp4XMCehM 1X3WRZm4+IWc1b6fzo/IkWTVb1jgHoNw0DFTkKv6D+a3umRjvMY5z3A1xxOgFS7G4iOD S/mlfY8RTNoBB24rn9j26Zc8Ijdh2rDhzpXhmPel4JHZiv3Pp8LG9rr5UqcgYzRzL5/m AG5rpm0zkOnhsNp9et1oStvP8+8wpEZVTJtbpWthf1BEXPwh8oET2hVpJfhSSbfp5TTE wbyxfqWjYZsCgRDXbATCW+3x6k8S7LyH/4CWT40v1YPvzndx4bBcA3gZpl2sSV/WbmTW 8A== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3cbea8j8x3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Mon, 15 Nov 2021 05:16:00 -0800 Received: from DC5-EXCH01.marvell.com (10.69.176.38) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Mon, 15 Nov 2021 05:15:58 -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.18 via Frontend Transport; Mon, 15 Nov 2021 05:15:58 -0800 Received: from localhost.localdomain (unknown [10.28.34.25]) by maili.marvell.com (Postfix) with ESMTP id 705D93F7074; Mon, 15 Nov 2021 05:15:55 -0800 (PST) From: To: , , , , , , , , Thomas Monjalon CC: , Sunil Kumar Kori Subject: [PATCH v6 11/11] devtools: check event device doc tables Date: Mon, 15 Nov 2021 18:45:18 +0530 Message-ID: <20211115131518.1650809-11-skori@marvell.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211115131518.1650809-1-skori@marvell.com> References: <20211022074843.907766-1-skori@marvell.com> <20211115131518.1650809-1-skori@marvell.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-GUID: SX2OLDgySUHIcM7-yIrtgAcMMBsR2N7l X-Proofpoint-ORIG-GUID: SX2OLDgySUHIcM7-yIrtgAcMMBsR2N7l 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-15_10,2021-11-15_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 --- 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