diff mbox series

[v6,3/9] app/testpmd: add GENEVE header option length support

Message ID 20210114070743.2377-4-shirik@nvidia.com (mailing list archive)
State Changes Requested, archived
Delegated to: Ferruh Yigit
Headers show
Series ethdev: introduce GENEVE header TLV option item | expand

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Shiri Kuzin Jan. 14, 2021, 7:07 a.m. UTC
From: Viacheslav Ovsiienko <viacheslavo@nvidia.com>

The patch adds the GENEVE rte flow option length support to
command line interpreter. The flow command with GENEVE
option items looks like:

    flow create 0 ingress pattern eth / ipv4 / udp / geneve vni
    is 100 optlen is 2 / end actions drop / end

The option length should be specified in 32-bit words, this
value specifies the all options length in the GENEVE header.

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
---
 app/test-pmd/cmdline_flow.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

Comments

Ori Kam Jan. 14, 2021, 2:36 p.m. UTC | #1
> -----Original Message-----
> From: Shiri Kuzin <shirik@nvidia.com>
> Sent: Thursday, January 14, 2021 9:08 AM
> To: dev@dpdk.org
> Subject: [PATCH v6 3/9] app/testpmd: add GENEVE header option length
> support
> 
> From: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
> 
> The patch adds the GENEVE rte flow option length support to
> command line interpreter. The flow command with GENEVE
> option items looks like:
> 
>     flow create 0 ingress pattern eth / ipv4 / udp / geneve vni
>     is 100 optlen is 2 / end actions drop / end
> 
> The option length should be specified in 32-bit words, this
> value specifies the all options length in the GENEVE header.
> 
> Signed-off-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
> ---
>  app/test-pmd/cmdline_flow.c | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c
> index 98afde82cc..1ef4d4f75d 100644
> --- a/app/test-pmd/cmdline_flow.c
> +++ b/app/test-pmd/cmdline_flow.c
> @@ -223,6 +223,7 @@ enum index {
>  	ITEM_GENEVE,
>  	ITEM_GENEVE_VNI,
>  	ITEM_GENEVE_PROTO,
> +	ITEM_GENEVE_OPTLEN,
>  	ITEM_VXLAN_GPE,
>  	ITEM_VXLAN_GPE_VNI,
>  	ITEM_ARP_ETH_IPV4,
> @@ -1101,6 +1102,7 @@ static const enum index item_gtp[] = {
>  static const enum index item_geneve[] = {
>  	ITEM_GENEVE_VNI,
>  	ITEM_GENEVE_PROTO,
> +	ITEM_GENEVE_OPTLEN,
>  	ITEM_NEXT,
>  	ZERO,
>  };
> @@ -2807,6 +2809,14 @@ static const struct token token_list[] = {
>  		.args = ARGS(ARGS_ENTRY_HTON(struct
> rte_flow_item_geneve,
>  					     protocol)),
>  	},
> +	[ITEM_GENEVE_OPTLEN] = {
> +		.name = "optlen",
> +		.help = "GENEVE options length in dwords",
> +		.next = NEXT(item_geneve, NEXT_ENTRY(UNSIGNED),
> item_param),
> +		.args = ARGS(ARGS_ENTRY_MASK_HTON(struct
> rte_flow_item_geneve,
> +						  ver_opt_len_o_c_rsvd0,
> +						  "\x3f\x00")),
> +	},
>  	[ITEM_VXLAN_GPE] = {
>  		.name = "vxlan-gpe",
>  		.help = "match VXLAN-GPE header",
> --
> 2.21.0

Acked-by: Ori Kam <orika@nvidia.com>
Thanks,
Ori
diff mbox series

Patch

diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c
index 98afde82cc..1ef4d4f75d 100644
--- a/app/test-pmd/cmdline_flow.c
+++ b/app/test-pmd/cmdline_flow.c
@@ -223,6 +223,7 @@  enum index {
 	ITEM_GENEVE,
 	ITEM_GENEVE_VNI,
 	ITEM_GENEVE_PROTO,
+	ITEM_GENEVE_OPTLEN,
 	ITEM_VXLAN_GPE,
 	ITEM_VXLAN_GPE_VNI,
 	ITEM_ARP_ETH_IPV4,
@@ -1101,6 +1102,7 @@  static const enum index item_gtp[] = {
 static const enum index item_geneve[] = {
 	ITEM_GENEVE_VNI,
 	ITEM_GENEVE_PROTO,
+	ITEM_GENEVE_OPTLEN,
 	ITEM_NEXT,
 	ZERO,
 };
@@ -2807,6 +2809,14 @@  static const struct token token_list[] = {
 		.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_geneve,
 					     protocol)),
 	},
+	[ITEM_GENEVE_OPTLEN] = {
+		.name = "optlen",
+		.help = "GENEVE options length in dwords",
+		.next = NEXT(item_geneve, NEXT_ENTRY(UNSIGNED), item_param),
+		.args = ARGS(ARGS_ENTRY_MASK_HTON(struct rte_flow_item_geneve,
+						  ver_opt_len_o_c_rsvd0,
+						  "\x3f\x00")),
+	},
 	[ITEM_VXLAN_GPE] = {
 		.name = "vxlan-gpe",
 		.help = "match VXLAN-GPE header",