numam-dpdk/devtools/parse-flow-support.sh
Kishore Padmanabha bdf4a3c631 net/bnxt: support tunnel offload
Add support for tunnel offload APIs. Specifically the following
are supported.
tunnel_decap_set, tunnel_match, tunnel_action_decap_release,
tunnel_item_release.

This provides support for VXLAN decap action where two flows
can indicate tunnel offload rule. The first flow indicates the
tunnel properties and second flow indicates the inner packet
structure. The templates are updated to support this
feature.

Signed-off-by: Kishore Padmanabha <kishore.padmanabha@broadcom.com>
Signed-off-by: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>
Reviewed-by: Shahaji Bhosle <sbhosle@broadcom.com>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2021-09-21 06:26:00 +02:00

80 lines
1.7 KiB
Bash
Executable File

#! /bin/sh -e
# SPDX-License-Identifier: BSD-3-Clause
# Copyright 2021 Mellanox Technologies, Ltd
# Parse rte_flow support of a driver directory,
# and optionally show difference with a doc file in .ini format.
dir=$1 # drivers/net/foo
ref=$2 # doc/guides/nics/features/foo.ini
if [ -z "$dir" ]; then
echo "directory argument is required" >&2
exit 1
fi
# sorting order
export LC_COLLATE=C
# exclude exceptions
exclude() # <pattern>
{
case $(basename $dir) in
bnxt)
filter=$(sed -n "/$1/{N;/TYPE_NOT_SUPPORTED/P;}" \
$dir/tf_ulp/ulp_rte_handler_tbl.c |
grep -wo "$1[[:alnum:]_]*" | sort -u |
tr '\n' '|' | sed 's,.$,\n,')
exceptions='RTE_FLOW_ACTION_TYPE_SHARED'
grep -vE "$filter" | grep -vE $exceptions;;
*) cat
esac
}
# include exceptions
include() # <pattern>
{
case $(basename $dir) in
esac
}
# generate INI section
list() # <title> <pattern>
{
echo "[$1]"
git grep -who "$2[[:alnum:]_]*" $dir |
(exclude $2; include $2) | sort -u |
awk 'sub(/'$2'/, "") {printf "%-20s = Y\n", tolower($0)}'
}
rte_flow_support() # <category>
{
title="rte_flow $1s"
pattern=$(echo "RTE_FLOW_$1_TYPE_" | awk '{print toupper($0)}')
list "$title" "$pattern" | grep -vwE 'void|indirect|end'
}
if [ -z "$ref" ]; then # generate full tables
rte_flow_support item
echo
rte_flow_support action
exit 0
fi
# compare with reference input
rte_flow_compare() # <category>
{
section="rte_flow $1s]"
{
rte_flow_support $1
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,^,$1 ," # prefix with category name
}
rte_flow_compare item
rte_flow_compare action