[dpdk-dev] [PATCH v4 1/2] app/testpmd: add VXLAN encap/decap support

Iremonger, Bernard bernard.iremonger at intel.com
Tue Jun 26 14:43:56 CEST 2018


Hi Nelio,

> -----Original Message-----
> From: Nelio Laranjeiro [mailto:nelio.laranjeiro at 6wind.com]
> Sent: Thursday, June 21, 2018 8:14 AM
> To: dev at dpdk.org; Adrien Mazarguil <adrien.mazarguil at 6wind.com>; Lu,
> Wenzhuo <wenzhuo.lu at intel.com>; Wu, Jingjing <jingjing.wu at intel.com>;
> Iremonger, Bernard <bernard.iremonger at intel.com>; Awal, Mohammad Abdul
> <mohammad.abdul.awal at intel.com>; Ori Kam <orika at mellanox.com>;
> Stephen Hemminger <stephen at networkplumber.org>
> Subject: [PATCH v4 1/2] app/testpmd: add VXLAN encap/decap support
> 
> Due to the complex VXLAN_ENCAP flow action and based on the fact testpmd
> does not allocate memory, this patch adds a new command in testpmd to
> initialise a global structure containing the necessary information to make the
> outer layer of the packet.  This same global structure will then be used by the
> flow command line in testpmd when the action vxlan_encap will be parsed, at
> this point, the conversion into such action becomes trivial.
> 
> This global structure is only used for the encap action.
> 
> Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro at 6wind.com>
> ---
<snip>


> diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst
> b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
> index 0d6fd50ca..2743043d3 100644
> --- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst
> +++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
> @@ -1534,6 +1534,13 @@ Enable or disable a per queue Tx offloading only on
> a specific Tx queue::
> 
>  This command should be run when the port is stopped, or else it will fail.
> 
> +Config VXLAN Encap outer layers
> +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> +
> +Configure the outer layer to encapsulate a packet inside a VXLAN tunnel::
> +
> + testpmd> set vxlan ipv4|ipv6 (vni) (udp-src) (udp-dst) (ip-src)
> + testpmd> (ip-dst) (mac-src) (mac-dst) set vxlan-with-vlan ipv4|ipv6
> + testpmd> (vni) (udp-src) (udp-dst) (ip-src) (ip-dst) (vlan-tci)
> + testpmd> (mac-src) (mac-dst)
> 
>  Port Functions
>  --------------
> @@ -3650,6 +3657,12 @@ This section lists supported actions and their
> attributes, if any.
> 
>    - ``ethertype``: Ethertype.
> 
> +- ``vxlan_encap``: Performs a VXLAN encapsulation, outer layer
> +configuration
> +  is done through `Config VXLAN Encap outer layers`_.
> +
> +- ``vxlan_decap``: Performs a decapsulation action by stripping all
> +headers of
> +  the VXLAN tunnel network overlay from the matched flow.
> +
>  Destroying flow rules
>  ~~~~~~~~~~~~~~~~~~~~~
> 
> @@ -3915,6 +3928,28 @@ Validate and create a QinQ rule on port 0 to steer
> traffic to a queue on the hos
>     0       0       0       i-      ETH VLAN VLAN=>VF QUEUE
>     1       0       0       i-      ETH VLAN VLAN=>PF QUEUE
> 
> +Sample VXLAN encapsulation rule
> +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> +
> +VXLAN encapsulation outer layer has default value pre-configured in
> +testpmd source code, those can be changed by using the following commands::

make doc-guides-html
sphinx processing guides-html...
dpdk/doc/guides/testpmd_app_ug/testpmd_funcs.rst:3951: WARNING: Literal block expected; none found.

> +
> +IPv4 VXLAN outer header::
> +
> +  testpmd> set vxlan ipv4 4 4 4 127.0.0.1 128.0.0.1 11:11:11:11:11:11
> + 22:22:22:22:22:22  testpmd> flow create 0 ingress pattern end actions
> + vxlan_encap / queue index 0 / end
> +
> +  testpmd> set vxlan-with-vlan ipv4 4 4 4 127.0.0.1 128.0.0.1 34
> + 11:11:11:11:11:11 22:22:22:22:22:22  testpmd> flow create 0 ingress
> + pattern end actions vxlan_encap / queue index 0 / end
> +
> +IPv6 VXLAN outer header::
> +
> +  testpmd> set vxlan ipv6 4 4 4 ::1 ::2222 11:11:11:11:11:11
> + 22:22:22:22:22:22  testpmd> flow create 0 ingress pattern end actions
> + vxlan_encap / queue index 0 / end
> +
> +  testpmd> set vxlan-with-vlan ipv6 4 4 4 ::1 ::2222 34
> + 11:11:11:11:11:11 22:22:22:22:22:22  testpmd> flow create 0 ingress
> + pattern end actions vxlan_encap / queue index 0 / end
> +
>  BPF Functions
>  --------------
> 
> --
> 2.18.0.rc2

Regards,

Bernard.




More information about the dev mailing list