* [PATCH] app/testpmd: update raw flow to take hex input
@ 2022-01-11 5:05 nipun.gupta
2022-01-25 12:42 ` Ferruh Yigit
0 siblings, 1 reply; 3+ messages in thread
From: nipun.gupta @ 2022-01-11 5:05 UTC (permalink / raw)
To: dev; +Cc: xiaoyun.li, orika, thomas, ferruh.yigit, hemant.agrawal, Nipun Gupta
From: Nipun Gupta <nipun.gupta@nxp.com>
This patch enables method to provide key and mask for raw rules
to be provided as hexadecimal values. There is new parameter
pattern_mask added to support this.
Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
---
app/test-pmd/cmdline_flow.c | 15 +++++++++++++++
doc/guides/testpmd_app_ug/testpmd_funcs.rst | 13 +++++++++++++
2 files changed, 28 insertions(+)
diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c
index bbe3dc0115..cfa68abc40 100644
--- a/app/test-pmd/cmdline_flow.c
+++ b/app/test-pmd/cmdline_flow.c
@@ -166,6 +166,7 @@ enum index {
ITEM_RAW_OFFSET,
ITEM_RAW_LIMIT,
ITEM_RAW_PATTERN,
+ ITEM_RAW_PATTERN_HEX,
ITEM_ETH,
ITEM_ETH_DST,
ITEM_ETH_SRC,
@@ -1107,6 +1108,7 @@ static const enum index item_raw[] = {
ITEM_RAW_OFFSET,
ITEM_RAW_LIMIT,
ITEM_RAW_PATTERN,
+ ITEM_RAW_PATTERN_HEX,
ITEM_NEXT,
ZERO,
};
@@ -2664,6 +2666,19 @@ static const struct token token_list[] = {
ARGS_ENTRY_ARB(sizeof(struct rte_flow_item_raw),
ITEM_RAW_PATTERN_SIZE)),
},
+ [ITEM_RAW_PATTERN_HEX] = {
+ .name = "pattern_hex",
+ .help = "hex string to look for",
+ .next = NEXT(item_raw,
+ NEXT_ENTRY(COMMON_HEX),
+ NEXT_ENTRY(ITEM_PARAM_IS,
+ ITEM_PARAM_SPEC,
+ ITEM_PARAM_MASK)),
+ .args = ARGS(ARGS_ENTRY(struct rte_flow_item_raw, pattern),
+ ARGS_ENTRY(struct rte_flow_item_raw, length),
+ ARGS_ENTRY_ARB(sizeof(struct rte_flow_item_raw),
+ ITEM_RAW_PATTERN_SIZE)),
+ },
[ITEM_ETH] = {
.name = "eth",
.help = "match Ethernet header",
diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
index 44228cd7d2..68c216c805 100644
--- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst
+++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
@@ -3634,6 +3634,7 @@ This section lists supported pattern items and their attributes, if any.
- ``offset {integer}``: absolute or relative offset for pattern.
- ``limit {unsigned}``: search area limit for start of pattern.
- ``pattern {string}``: byte string to look for.
+ - ``pattern_hex {string}``: byte string (provided in hexadecimal) to look for.
- ``eth``: match Ethernet header.
@@ -5080,6 +5081,18 @@ PPPoL2TPv2oUDP RSS rules can be created by the following commands::
testpmd> flow create 0 ingress pattern eth / ipv6 / udp / l2tpv2 / ppp / ipv6
/ end actions rss types ipv6 end queues end / end
+Sample RAW rule
+~~~~~~~~~~~~~~~
+
+A RAW rule can be creted as following using ``pattern_hex`` key and mask.
+
+::
+
+ testpmd> flow create 0 group 0 priority 1 ingress pattern raw relative is 0 search is 0 offset
+ is 0 limit is 0 pattern_hex spec 00000000000000000000000000000000000000000000000000000a0a0a0a
+ pattern_hex mask 0000000000000000000000000000000000000000000000000000ffffffff / end actions
+ queue index 4 / end
+
BPF Functions
--------------
--
2.17.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] app/testpmd: update raw flow to take hex input
2022-01-11 5:05 [PATCH] app/testpmd: update raw flow to take hex input nipun.gupta
@ 2022-01-25 12:42 ` Ferruh Yigit
2022-02-03 14:13 ` Ferruh Yigit
0 siblings, 1 reply; 3+ messages in thread
From: Ferruh Yigit @ 2022-01-25 12:42 UTC (permalink / raw)
To: nipun.gupta, dev; +Cc: xiaoyun.li, orika, thomas, hemant.agrawal
On 1/11/2022 5:05 AM, nipun.gupta@nxp.com wrote:
> From: Nipun Gupta <nipun.gupta@nxp.com>
>
> This patch enables method to provide key and mask for raw rules
> to be provided as hexadecimal values. There is new parameter
> pattern_mask added to support this.
>
> Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Looks good to me.
Ori, any objection/comment?
> ---
> app/test-pmd/cmdline_flow.c | 15 +++++++++++++++
> doc/guides/testpmd_app_ug/testpmd_funcs.rst | 13 +++++++++++++
> 2 files changed, 28 insertions(+)
>
> diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c
> index bbe3dc0115..cfa68abc40 100644
> --- a/app/test-pmd/cmdline_flow.c
> +++ b/app/test-pmd/cmdline_flow.c
> @@ -166,6 +166,7 @@ enum index {
> ITEM_RAW_OFFSET,
> ITEM_RAW_LIMIT,
> ITEM_RAW_PATTERN,
> + ITEM_RAW_PATTERN_HEX,
> ITEM_ETH,
> ITEM_ETH_DST,
> ITEM_ETH_SRC,
> @@ -1107,6 +1108,7 @@ static const enum index item_raw[] = {
> ITEM_RAW_OFFSET,
> ITEM_RAW_LIMIT,
> ITEM_RAW_PATTERN,
> + ITEM_RAW_PATTERN_HEX,
> ITEM_NEXT,
> ZERO,
> };
> @@ -2664,6 +2666,19 @@ static const struct token token_list[] = {
> ARGS_ENTRY_ARB(sizeof(struct rte_flow_item_raw),
> ITEM_RAW_PATTERN_SIZE)),
> },
> + [ITEM_RAW_PATTERN_HEX] = {
> + .name = "pattern_hex",
> + .help = "hex string to look for",
> + .next = NEXT(item_raw,
> + NEXT_ENTRY(COMMON_HEX),
> + NEXT_ENTRY(ITEM_PARAM_IS,
> + ITEM_PARAM_SPEC,
> + ITEM_PARAM_MASK)),
> + .args = ARGS(ARGS_ENTRY(struct rte_flow_item_raw, pattern),
> + ARGS_ENTRY(struct rte_flow_item_raw, length),
> + ARGS_ENTRY_ARB(sizeof(struct rte_flow_item_raw),
> + ITEM_RAW_PATTERN_SIZE)),
> + },
> [ITEM_ETH] = {
> .name = "eth",
> .help = "match Ethernet header",
> diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
> index 44228cd7d2..68c216c805 100644
> --- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst
> +++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
> @@ -3634,6 +3634,7 @@ This section lists supported pattern items and their attributes, if any.
> - ``offset {integer}``: absolute or relative offset for pattern.
> - ``limit {unsigned}``: search area limit for start of pattern.
> - ``pattern {string}``: byte string to look for.
> + - ``pattern_hex {string}``: byte string (provided in hexadecimal) to look for.
>
> - ``eth``: match Ethernet header.
>
> @@ -5080,6 +5081,18 @@ PPPoL2TPv2oUDP RSS rules can be created by the following commands::
> testpmd> flow create 0 ingress pattern eth / ipv6 / udp / l2tpv2 / ppp / ipv6
> / end actions rss types ipv6 end queues end / end
>
> +Sample RAW rule
> +~~~~~~~~~~~~~~~
> +
> +A RAW rule can be creted as following using ``pattern_hex`` key and mask.
> +
s/creted/created/
> +::
> +
> + testpmd> flow create 0 group 0 priority 1 ingress pattern raw relative is 0 search is 0 offset
> + is 0 limit is 0 pattern_hex spec 00000000000000000000000000000000000000000000000000000a0a0a0a
> + pattern_hex mask 0000000000000000000000000000000000000000000000000000ffffffff / end actions
> + queue index 4 / end
> +
> BPF Functions
> --------------
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] app/testpmd: update raw flow to take hex input
2022-01-25 12:42 ` Ferruh Yigit
@ 2022-02-03 14:13 ` Ferruh Yigit
0 siblings, 0 replies; 3+ messages in thread
From: Ferruh Yigit @ 2022-02-03 14:13 UTC (permalink / raw)
To: nipun.gupta, dev; +Cc: xiaoyun.li, orika, thomas, hemant.agrawal
On 1/25/2022 12:42 PM, Ferruh Yigit wrote:
> On 1/11/2022 5:05 AM, nipun.gupta@nxp.com wrote:
>> From: Nipun Gupta <nipun.gupta@nxp.com>
>>
>> This patch enables method to provide key and mask for raw rules
>> to be provided as hexadecimal values. There is new parameter
>> pattern_mask added to support this.
>>
>> Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
>
> Looks good to me.
>
> Ori, any objection/comment?
>
It seems there is no objection, proceeding with patch.
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
Applied to dpdk-next-net/main, thanks.
<...>
>> +Sample RAW rule
>> +~~~~~~~~~~~~~~~
>> +
>> +A RAW rule can be creted as following using ``pattern_hex`` key and mask.
>> +
>
> s/creted/created/
>
fixed while applying
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-02-03 14:14 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-11 5:05 [PATCH] app/testpmd: update raw flow to take hex input nipun.gupta
2022-01-25 12:42 ` Ferruh Yigit
2022-02-03 14:13 ` Ferruh Yigit
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).