DPDK patches and discussions
 help / color / mirror / Atom feed
From: Thomas Monjalon <thomas@monjalon.net>
To: Sunil Kumar Kori <skori@marvell.com>
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	[thread overview]
Message-ID: <3741160.x2eqROFiRU@thomas> (raw)
In-Reply-To: <20211123110743.2002557-10-skori@marvell.com>

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() # <driver>
> +{
> +	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() # <title> <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.



  reply	other threads:[~2021-11-24 10:52 UTC|newest]

Thread overview: 86+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-07 11:12 [dpdk-dev] [PATCH 1/3] doc: add skeleton for eventdevs feature metrices Sunil Kumar Kori
2019-11-07 11:12 ` [dpdk-dev] [PATCH 2/3] doc: update eventdev feature matrix for octeontx2 Sunil Kumar Kori
2019-11-07 11:12 ` [dpdk-dev] [PATCH 3/3] doc: update eventdev feature matrix for octeontx Sunil Kumar Kori
2019-11-15  7:38 ` [dpdk-dev] [PATCH 1/3] doc: add skeleton for eventdevs feature metrices Jerin Jacob
2019-11-21  7:44 ` [dpdk-dev] [PATCH v2 1/3] doc: add skeleton for eventdevs feature matrices Sunil Kumar Kori
2019-11-21  7:44   ` [dpdk-dev] [PATCH v2 2/3] doc: update eventdev feature matrix for octeontx2 Sunil Kumar Kori
2019-11-21  7:44   ` [dpdk-dev] [PATCH v2 3/3] doc: update eventdev feature matrix for octeontx Sunil Kumar Kori
2019-11-28 15:49   ` [dpdk-dev] [PATCH v2 1/3] doc: add skeleton for eventdevs feature matrices Thomas Monjalon
2019-12-03  6:27   ` [dpdk-dev] [PATCH v3 " Sunil Kumar Kori
2019-12-03  6:27     ` [dpdk-dev] [PATCH v3 2/3] doc: update eventdev feature matrix for octeontx2 Sunil Kumar Kori
2019-12-03  6:27     ` [dpdk-dev] [PATCH v3 3/3] doc: update eventdev feature matrix for octeontx Sunil Kumar Kori
2020-02-27  7:02     ` [dpdk-dev] [PATCH v4 1/3] doc: add skeleton for eventdevs feature matrices Sunil Kumar Kori
2020-02-27  7:03       ` [dpdk-dev] [PATCH v4 2/3] doc: update eventdev feature matrix for octeontx2 Sunil Kumar Kori
2020-02-27  7:03       ` [dpdk-dev] [PATCH v4 3/3] doc: update eventdev feature matrix for octeontx Sunil Kumar Kori
2021-10-22  7:48       ` [dpdk-dev] [PATCH v5 1/4] doc: add skeleton for eventdevs feature matrices skori
2021-10-22  7:48         ` [dpdk-dev] [PATCH v5 2/4] doc: update eventdev feature matrix for octeontx2 skori
2021-10-22  7:48         ` [dpdk-dev] [PATCH v5 3/4] doc: update eventdev feature matrix for octeontx skori
2021-10-22  7:48         ` [dpdk-dev] [PATCH v5 4/4] doc: update eventdev feature matrix for cnxk skori
2021-11-09 10:11         ` [dpdk-dev] [PATCH v5 1/4] doc: add skeleton for eventdevs feature matrices Jerin Jacob
2021-11-09 11:34           ` Thomas Monjalon
2021-11-11  6:40             ` [EXT] " Sunil Kumar Kori
2021-11-10  8:42           ` Mattias Rönnblom
2021-11-10  8:50             ` [dpdk-dev] [EXT] " Jerin Jacob Kollanukkaran
2021-11-10  9:29               ` [dpdk-dev] [PATCH] eventdev: negate maintenance capability flag Mattias Rönnblom
2021-11-10  9:55                 ` Van Haaren, Harry
2021-11-10 10:06                   ` [dpdk-dev] [PATCH v2] " Mattias Rönnblom
2021-11-10 10:07                   ` [dpdk-dev] [PATCH] " Mattias Rönnblom
2021-11-10 10:43                     ` Jerin Jacob
2021-11-10 11:32                       ` [dpdk-dev] [PATCH v3] " Mattias Rönnblom
2021-11-10 18:55                         ` Jerin Jacob
2021-11-10 11:14                   ` [dpdk-dev] [PATCH v2] eventdev: fix Rx adapter stalls on event device backpressure Mattias Rönnblom
2021-11-10 11:23                     ` Jayatheerthan, Jay
2021-11-10 18:56                       ` Jerin Jacob
2021-11-15 13:15         ` [PATCH v6 01/11] doc: add skeleton for eventdevs feature matrices skori
2021-11-15 13:15           ` [PATCH v6 02/11] doc: update eventdev feature matrix for octeontx skori
2021-11-15 13:15           ` [PATCH v6 03/11] doc: update eventdev feature matrix for octeontx2 skori
2021-11-15 13:15           ` [PATCH v6 04/11] doc: update eventdev feature matrix for cn9k skori
2021-11-15 13:15           ` [PATCH v6 05/11] doc: update eventdev feature matrix for cn10k skori
2021-11-15 13:15           ` [PATCH v6 06/11] doc: update eventdev feature matrix for dpaa skori
2021-11-15 13:15           ` [PATCH v6 07/11] doc: update eventdev feature matrix for dpaa2 skori
2021-11-15 13:15           ` [PATCH v6 08/11] doc: update eventdev feature matrix for SW skori
2021-11-15 13:15           ` [PATCH v6 09/11] doc: update eventdev feature matrix for opdl skori
2021-11-15 13:15           ` [PATCH v6 10/11] doc: update eventdev feature matrix for dsw skori
2021-11-15 13:15           ` [PATCH v6 11/11] devtools: check event device doc tables skori
2021-11-22  7:54           ` [PATCH v7 01/11] doc: add skeleton for eventdevs feature matrices skori
2021-11-22  7:54             ` [PATCH v7 02/11] doc: update eventdev feature matrix for octeontx skori
2021-11-22  7:54             ` [PATCH v7 03/11] doc: update eventdev feature matrix for octeontx2 skori
2021-11-22  7:54             ` [PATCH v7 04/11] doc: update eventdev feature matrix for cn9k skori
2021-11-22  7:54             ` [PATCH v7 05/11] doc: update eventdev feature matrix for cn10k skori
2021-11-22 18:25               ` Jerin Jacob
2021-11-22  7:54             ` [PATCH v7 06/11] doc: update eventdev feature matrix for dpaa skori
2021-11-22  7:54             ` [PATCH v7 07/11] doc: update eventdev feature matrix for dpaa2 skori
2021-11-22  7:54             ` [PATCH v7 08/11] doc: update eventdev feature matrix for SW skori
2021-11-22  7:54             ` [PATCH v7 09/11] doc: update eventdev feature matrix for opdl skori
2021-11-22  7:54             ` [PATCH v7 10/11] doc: update eventdev feature matrix for dsw skori
2021-11-22  7:54             ` [PATCH v7 11/11] devtools: check event device doc tables skori
2021-11-22 18:35               ` Jerin Jacob
2021-11-23 11:07             ` [PATCH v8 01/10] doc: add skeleton for eventdevs feature matrices skori
2021-11-23 11:07               ` [PATCH v8 02/10] doc: update eventdev feature matrix for octeontx skori
2021-11-23 11:07               ` [PATCH v8 03/10] doc: update eventdev feature matrix for octeontx2 skori
2021-11-23 11:07               ` [PATCH v8 04/10] doc: update eventdev feature matrix for cnxk skori
2021-11-23 11:07               ` [PATCH v8 05/10] doc: update eventdev feature matrix for dpaa skori
2021-11-23 11:07               ` [PATCH v8 06/10] doc: update eventdev feature matrix for dpaa2 skori
2021-11-23 11:07               ` [PATCH v8 07/10] doc: update eventdev feature matrix for SW skori
2021-11-23 11:07               ` [PATCH v8 08/10] doc: update eventdev feature matrix for opdl skori
2021-11-23 11:07               ` [PATCH v8 09/10] doc: update eventdev feature matrix for dsw skori
2021-11-23 11:07               ` [PATCH v8 10/10] devtools: check event device doc tables skori
2021-11-24 10:52                 ` Thomas Monjalon [this message]
2021-11-24 11:16                   ` [EXT] " Sunil Kumar Kori
2021-11-24 11:21                     ` Thomas Monjalon
2021-11-24 10:03               ` [PATCH v8 01/10] doc: add skeleton for eventdevs feature matrices Thomas Monjalon
2021-11-24 10:30                 ` [EXT] " Sunil Kumar Kori
2021-11-24 10:43                   ` Thomas Monjalon
2021-11-24 12:35                     ` Sunil Kumar Kori
2021-11-24 12:41                       ` Thomas Monjalon
2021-11-24 12:46                         ` Sunil Kumar Kori
2021-11-24 13:05                           ` Sunil Kumar Kori
2021-11-24 10:48               ` Thomas Monjalon
2021-11-24 11:12                 ` [EXT] " Sunil Kumar Kori
2021-11-24 12:14               ` [PATCH v1 1/1] doc: update eventdev feature matrix for dlb2 skori
2021-11-24 13:03               ` [PATCH v9 1/1] doc: add eventdevs feature matrices skori
2021-11-26 14:55                 ` Thomas Monjalon
2021-11-15 18:08         ` [dpdk-dev] [PATCH v5 1/4] doc: add skeleton for " Jerin Jacob
2021-11-23 16:44         ` Jerin Jacob
2021-11-24  8:06           ` Thomas Monjalon
2021-11-24  8:14             ` Jerin Jacob

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3741160.x2eqROFiRU@thomas \
    --to=thomas@monjalon.net \
    --cc=dev@dpdk.org \
    --cc=harry.van.haaren@intel.com \
    --cc=hemant.agrawal@nxp.com \
    --cc=jerinj@marvell.com \
    --cc=liang.j.ma@intel.com \
    --cc=mattias.ronnblom@ericsson.com \
    --cc=nikhil.rao@intel.com \
    --cc=nipun.gupta@nxp.com \
    --cc=pbhagavatula@marvell.com \
    --cc=skori@marvell.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).