[dpdk-dev] [PATCH v2 1/3] app/testpmd: support raw encap/decap actions

Ferruh Yigit ferruh.yigit at intel.com
Mon Jul 8 19:41:19 CEST 2019


On 7/2/2019 2:53 PM, Xiaoyu Min wrote:
> This patch intend to support
> action_raw_encap/decap [1] in a generic and convenient way.
> 
> Two new commands - set raw_encap, set raw_decap are introduced just
> like the other commands for encap/decap, i.e. set vxlan.
> 
> These two commands have corresponding global buffers
> which can be used by PMD as the input buffer for raw encap/decap.
> 
> The commands use the rte_flow pattern syntax to help user build the
> raw buffer in a convenient way.
> 
> A common way to use it:
> 
> - encap matched egress packet with VxLAN tunnel:
> testpmd> set raw_encap eth src is 10:11:22:33:44:55 / vlan tci is 1
> 	 inner_type is 0x0800 / ipv4 / udp dst is 4789 / vxlan vni
> 	 is 2 / end_set
> testpmd> flow create 0 egress pattern eth / ipv4 / end actions
> 	 raw_encap / end
> 
> - decap l2 header and encap GRE tunnel on matched egress packet:
> testpmd> set raw_decap eth / end_set
> testpmd> set raw_encap eth dst is 10:22:33:44:55:66 / ipv4 / gre
> 	 protocol is 0x0800 / end_set
> testpmd> flow create 0 egress pattern eth / ipv4 / end actions
> 	 raw_decap / raw_encap / end
> 
> - decap VxLAN tunnel and encap l2 header on matched ingress packet:
> testpmd> set raw_encap eth src is 10:11:22:33:44:55 type is 0x0800 /
> 	 end_set
> testpmd> set raw_decap eth / ipv4 / udp / vxlan / end_set
> testpmd> flow create 0 ingress pattern eth / ipv4 / udp dst is 250 /
>          vxlan vni is 0x1234 / ipv4 / end actions raw_decap /
>          raw_encap / queue index 1 / mark id 0x1234 / end
> 
> [1] http://mails.dpdk.org/archives/dev/2018-October/116092.html
> 
> Signed-off-by: Xiaoyu Min <jackmin at mellanox.com>
> ---
>  app/test-pmd/cmdline.c                      |  13 +
>  app/test-pmd/cmdline_flow.c                 | 536 +++++++++++++++++++-
>  app/test-pmd/testpmd.h                      |   2 +
>  doc/guides/testpmd_app_ug/testpmd_funcs.rst |  48 ++
>  4 files changed, 598 insertions(+), 1 deletion(-)
> 
> diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
> index e7c4beecc2..ec4ea2f125 100644
> --- a/app/test-pmd/cmdline.c
> +++ b/app/test-pmd/cmdline.c
> @@ -760,6 +760,12 @@ static void cmd_help_long_parsed(void *parsed_result,
>  			" eth-src (eth-src) eth-dst (eth-dst)\n"
>  			"       Configure the NVGRE encapsulation for flows.\n\n"
>  
> +			"raw_encap {flow items}"
> +			"	Configure the encapsulation with raw data.\n\n"
> +
> +			"raw_decap {flow items}"
> +			"	Configure the decapsulation with raw data.\n\n"
> +
>  			, list_pkt_forwarding_modes()
>  		);
>  	}
> @@ -1137,6 +1143,12 @@ static void cmd_help_long_parsed(void *parsed_result,
>  			"flow isolate {port_id} {boolean}\n"
>  			"    Restrict ingress traffic to the defined"
>  			" flow rules\n\n"
> +
> +			"set raw_encap {flow items}\n"
> +			"	Config encap with raw data.\n\n"
> +
> +			"set raw_decap {flow items}\n"
> +			"	Config decap with raw data.\n\n"
>  		);
>  	}
>  

help string adds two set of commands, "set raw_encap/raw_decap" &
"raw_encap/raw_decap", but from documentation and commit log it seems only first
one added, can you please check?




More information about the dev mailing list