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 57B47A0C52; Wed, 24 Nov 2021 11:52:38 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D1EE1411AE; Wed, 24 Nov 2021 11:52:37 +0100 (CET) Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) by mails.dpdk.org (Postfix) with ESMTP id 3CE6141183 for ; Wed, 24 Nov 2021 11:52:37 +0100 (CET) Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id E15275C00BA; Wed, 24 Nov 2021 05:52:36 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Wed, 24 Nov 2021 05:52:36 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s=fm2; bh= caeS2XyUAQLzsfstGxR/lM+QX5Ae8GGJGhffdBZQrTA=; b=XiLzaIC/ziJDrs3u Yc/kbIJmFdIjTMzm3m7S/57g/DhvvlhHhem55ILx8Dgg6lIe//oycsdYR1HYdvNV EVXeUa/05ilK3HYSSDy4JjgDtmQi6xJvVN8Wwj0iO+MsprTZBPwYinNH6C21ocgu SuT/uq6OUA/WempoPEZ8WuT9PDYPjr3oB/m2/2pmSgFu+XRpJAdb/8B+/qJ9VJ6s sSOcYl+hCbggzI+Xq+bJ6Qvg7dZswoh2iuYk3nKdedh1wnbKjxt+K0/tVb2/ttr/ QN6eFPz09oHruWALnxITD7niE54LJHYkRnVT93+YWdDGGzPdy0I1n5qnPx1h7tcA UHIQ5w== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=caeS2XyUAQLzsfstGxR/lM+QX5Ae8GGJGhffdBZQr TA=; b=NMMgBFp3PQ7F2GUtH4VD/tuiibDfu3BXEWPYqA6yHmGvcE49B7eo3RM1F xrZSLr97EZozwxlBMnC+iQPHvO4Ub/VHLNqeY265+VlbUTM92GUM95spZF7T1M87 mLTG5R0kFXZ7DVr9C+X+w7DrwgIucO2ZT9XxTkysefKw+sRnfWQZD9A2xA9MWMdu SJuvqcyXPBuQICbEaM9kMUPqclkAs6rfLDzS3wKYI+ZRumqsgYfaDiE86TJfDYtw CHoxBA3WRpleSAUKOcj9VDkLE9eTHstahuG21/xGg58GezXiT7z1juIPdMDeeSsK CSoCw2jda+zrnyirqKGuzHAA0wrjg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvuddrgeekgddvudcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkjghfggfgtgesthfuredttddtvdenucfhrhhomhepvfhhohhmrghs ucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenucggtf frrghtthgvrhhnpedugefgvdefudfftdefgeelgffhueekgfffhfeujedtteeutdejueei iedvffegheenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhroh hmpehthhhomhgrshesmhhonhhjrghlohhnrdhnvght X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 24 Nov 2021 05:52:35 -0500 (EST) From: Thomas Monjalon To: Sunil Kumar Kori Cc: jerinj@marvell.com, nikhil.rao@intel.com, pbhagavatula@marvell.com, hemant.agrawal@nxp.com, nipun.gupta@nxp.com, harry.van.haaren@intel.com, mattias.ronnblom@ericsson.com, liang.j.ma@intel.com, dev@dpdk.org Subject: Re: [PATCH v8 10/10] devtools: check event device doc tables Date: Wed, 24 Nov 2021 11:52:34 +0100 Message-ID: <3741160.x2eqROFiRU@thomas> In-Reply-To: <20211123110743.2002557-10-skori@marvell.com> References: <20211122075414.1834651-1-skori@marvell.com> <20211123110743.2002557-1-skori@marvell.com> <20211123110743.2002557-10-skori@marvell.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" 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 23/11/2021 12:07, skori@marvell.com: > --- a/devtools/check-doc-vs-code.sh > +++ b/devtools/check-doc-vs-code.sh > +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 > +} These 2 functions are mostly copy/paste of rte_flow functions. Given there will be more in future, I would prefer code being factorized. > if [ -z "$trusted_commit" ]; then > # check all > for driver in $(all_net_drivers); do > check_rte_flow $driver > done > + I would remove this blank line. > + for driver in $(all_event_drivers); do > + check_event_dev $driver > + done > exit $result > 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_*' || Can it be a single query? > + has_file_change 'doc/guides/eventdevs/features'; then > + for driver in $(all_event_drivers); do No need to check all drivers. For rte_flow, only changed drivers are checked. > + check_event_dev $driver > + done > +fi [...] > +# generate INI section > +list() # <pattern> <extra_patterns> > +{ > + echo "[$1]" > + word0=$(git grep -who "$2[[:alnum:]_]*" $dir) > + word1=$(echo "$3") Why echo? > + words="$word0""$word1" Why so many quotes? > + echo "$words" | sort -u | > + awk 'sub(/'$2'/, "") {printf "%-20s = Y\n", tolower($0)}' > +} [...] > +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' Why having extra parameter, instead of updating the pattern? By the way, the pattern RTE_EVENT_ETH_RX_ADAPTER_CAP_ already include all of this. > + list "$title" "$pattern" "$extra" > +} [...] > +# 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 > +} I think these functions can be factorized.