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 9EC51A0C4B; Mon, 22 Nov 2021 19:36:24 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5EACE4014E; Mon, 22 Nov 2021 19:36:24 +0100 (CET) Received: from mail-io1-f50.google.com (mail-io1-f50.google.com [209.85.166.50]) by mails.dpdk.org (Postfix) with ESMTP id 96DE64003C for ; Mon, 22 Nov 2021 19:36:23 +0100 (CET) Received: by mail-io1-f50.google.com with SMTP id f9so24479702ioo.11 for ; Mon, 22 Nov 2021 10:36:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=w0b/bDgdD29qbiOxJk/4xz28JvbQGt3njOu+Lx4DOoI=; b=q1W9ZWbCFTYW53Od/BKAefN3THI9e76aX0Zt84e8W+sf+v7HbuOLSbjn0e0PZDcGDl cRYpL5sRYuX/6oywbcw22XED75oLWos6dHhk5pt1Cbsw5AE8ETTtEK3HbrCp8LLw5v/h 7PMAwwe7q1MmjEovjbYGTHxMGO5WCn9rf3PZtyYbCT26P3gx5qB0ctsXwjAc9SRc21ut 7aUfBmR44QPk6blyu4OH6L2jPjIHm+3pQdScrm8pH2Fw//hDmKSypBgUi8Y36rT5jycF +gDZAwUWi+xLgQnvLzLSAH8RsFtojCiaxdcLNjKMUe9++7TCqEW/yyTA+vcxszN5J/dL 3dJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=w0b/bDgdD29qbiOxJk/4xz28JvbQGt3njOu+Lx4DOoI=; b=auUUF6HUSryhAF+ivZNrGas9oxZ0RVlLJ2qDEMTkQwYPjoPqQ76olH3zrh5U3N/CVK UCxv+OpvwtfTLue93lRDhzB4zlZ7+IMx5klohyHhvCig6unephk9hI05x4soaHFNYm4l YKVjP83MH+as9kOgyDO2IXjZzrCXQUTIUZFGCdYIqXfIMwvMrdAXq18B2AkYVhJXjhUY sqhBYKGDymZhqkkF2dLpLtmkkxU1CnfGwNQq52QDs+TBvvY+D9DNabswMFwh6dLoR4R+ mNinKS09aHm7tz4rhOfrtDMm7vYLevS8w5OabcQEP2sJCQdMUr+G5wSNuMuNJqM9k3fG d4YA== X-Gm-Message-State: AOAM532iLP0rczligoQAjSBm9ixndMiGDsTTipi0gYKP0F/UmRBQ3nQS yvqvU/rH+Ec8AVFkFIadG2u6EQpWmEE03m2cpdi17QyIVTU= X-Google-Smtp-Source: ABdhPJxcttj0Z7bQ693z2dFfylGJrnyaArqgRlnCUuh8jbPFJ7mwDMIZmXEqsSfNcNlAwGWlqYklMYLth78Rr176l3Q= X-Received: by 2002:a05:6638:2395:: with SMTP id q21mr50012228jat.48.1637606182924; Mon, 22 Nov 2021 10:36:22 -0800 (PST) MIME-Version: 1.0 References: <20211115131518.1650809-1-skori@marvell.com> <20211122075414.1834651-1-skori@marvell.com> <20211122075414.1834651-11-skori@marvell.com> In-Reply-To: <20211122075414.1834651-11-skori@marvell.com> From: Jerin Jacob Date: Tue, 23 Nov 2021 00:05:56 +0530 Message-ID: Subject: Re: [PATCH v7 11/11] devtools: check event device doc tables To: Sunil Kumar Kori Cc: Jerin Jacob , Nikhil Rao , Pavan Nikhilesh , Hemant Agrawal , Nipun Gupta , "Van Haaren, Harry" , =?UTF-8?Q?Mattias_R=C3=B6nnblom?= , Liang Ma , Thomas Monjalon , dpdk-dev Content-Type: text/plain; charset="UTF-8" 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 On Mon, Nov 22, 2021 at 1:33 PM wrote: > > 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 Following errors[2] need to be taken care in devtools/parse-event-support.sh by detecting it is using a common Rx adapter or not? I have spent some time fixing it, Please find below a test patch for same[1]. Please send the next version with fix. I am planning to merge all doc patches(1-10) to next-event-dev tree and delegate this patch(11/11) to Thomas as he is the maintainer for tooling. [2] doc out of sync for dsw Eth Rx adapter Features event_vector Eth Rx adapter Features multi_eventq Eth Rx adapter Features override_flow_id doc out of sync for sw Eth Rx adapter Features event_vector Eth Rx adapter Features multi_eventq Eth Rx adapter Features override_flow_id > --- > 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' void| in... copy-paste issue from rte_flow. > +} > + > +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() event_dev_crypto_timer_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 event_dev_crypto_timer_compare [1 event_dev_crypto_adptr_support() @@ -52,7 +65,7 @@ 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' + list "$title" "$pattern" "" } event_dev_timer_adptr_support() @@ -60,7 +73,7 @@ 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' + list "$title" "$pattern" "" } if [ -z "$ref" ]; then # generate full tables @@ -129,7 +142,7 @@ event_dev_crypto_adptr_compare() sed "s,^,Crypto adapter Features ," # prefix with category name } -event_dev_crypto_adptr_compare() +event_dev_timer_adptr_compare() { section="Timer adapter Features]" { @@ -146,4 +159,4 @@ event_dev_sched_compare event_dev_rx_adptr_compare event_dev_tx_adptr_compare event_dev_crypto_adptr_compare -event_dev_crypto_adptr_compare +event_dev_timer_adptr_compare] diff --git a/devtools/parse-event-support.sh b/devtools/parse-event-support.sh index d756977eec..f8e6bb0db2 100755 --- a/devtools/parse-event-support.sh +++ b/devtools/parse-event-support.sh @@ -16,19 +16,31 @@ fi # sorting order export LC_COLLATE=C +check_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() # <title> <pattern> +list() # <title> <pattern> <extra_patterns> { echo "[$1]" - git grep -who "$2[[:alnum:]_]*" $dir | sort -u | - awk 'sub(/'$2'/, "") {printf "%-20s = Y\n", tolower($0)}' + words=$(git grep -who "$2[[:alnum:]_]*" $dir) + words+=$(echo -e "$3") + 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" | grep -vwE 'void|indirect|end' + list "$title" "$pattern" "" } event_dev_rx_adptr_support() @@ -36,7 +48,8 @@ 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' + check_sw_capa || extra='RTE_EVENT_ETH_RX_ADAPTER_CAP_OVERRIDE_FLOW_ID\nRTE_EVENT_ETH_RX_ADAPTER_CAP_MULTI_EVENTQ\nRTE_EVENT_ETH_RX_ADAPTER_CAP_EVENT_VECTOR\n' + list "$title" "$pattern" "$extra" } event_dev_tx_adptr_support() @@ -44,7 +57,7 @@ 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' + list "$title" "$pattern" "" } > -- > 2.25.1 >