[dpdk-dev] [PATCH v6 0/3] ethdev: add generic raw tunnel encapsulation

Ori Kam orika at mellanox.com
Mon Oct 22 19:38:08 CEST 2018


This series implement the raw tunnel encapsulation actions
and is based on rfc [1] "add generic L2/L3 tunnel encapsulation actions"

Currenlty the encap/decap actions only support encapsulation
of VXLAN and NVGRE L2 packets (L2 encapsulation is where
the inner packet has a valid Ethernet header, while L3 encapsulation
is where the inner packet doesn't have the Ethernet header).
In addtion the parameter to to the encap action is a list of rte items,
this results in 2 extra translation, between the application to the action
and from the action to the NIC. This results in negetive impact on the
insertion performance.
    
Looking forward there are going to be a need to support many more tunnel
encapsulations. For example MPLSoGRE, MPLSoUDP.
Adding the new encapsulation will result in duplication of code.
For example the code for handling NVGRE and VXLAN are exactly the same,
and each new tunnel will have the same exact structure.
    
This series introduce a raw encapsulation that can support both L2 and L3
tunnel encapsulation.
In order to encap l3 tunnel for example MPLSoDUP:
ETH / IPV4 / UDP / MPLS / IPV4 / L4 .. L7
When creating the flow rule we add 2 actions, the first one is decap in order
to remove the original L2 of the packet and then the encap with the tunnel data.
Decapsulating such a tunnel is done in the following order, first decap the
outer tunnel and then encap the packet with the L2 header.
It is important to notice that from the Nic and PMD both actionsn happens
simultaneously, meaning that at we are always having a valid packet.

This series also inroduce the following commands for testpmd:
* l2_encap
* l2_decap
* mplsogre_encap
* mplsogre_decap
* mplsoudp_encap
* mplsoudp_decap

along with helper function to set teh headers that will be used for the actions,
the same as with vxlan_encap.

[1]https://mails.dpdk.org/archives/dev/2018-August/109944.html

v6:
 * fix compilation error
 * fix typo.

v5:
 * fix typos.

v4:
 * convert to raw encap/decap, according to Adrien suggestion.
 * keep the old vxlan and nvgre encapsulation commands.

v3:
 * rebase on tip.

v2:
 * add missing decap_l3 structure.
 * fix typo.



Ori Kam (3):
  ethdev: add raw encapsulation action
  app/testpmd: add MPLSoUDP encapsulation
  app/testpmd: add MPLSoGRE encapsulation

 app/test-pmd/cmdline.c                      | 637 ++++++++++++++++++++++++++++
 app/test-pmd/cmdline_flow.c                 | 597 ++++++++++++++++++++++++++
 app/test-pmd/testpmd.h                      |  62 +++
 doc/guides/prog_guide/rte_flow.rst          |  51 +++
 doc/guides/testpmd_app_ug/testpmd_funcs.rst | 278 ++++++++++++
 lib/librte_ethdev/rte_flow.c                |   2 +
 lib/librte_ethdev/rte_flow.h                |  59 +++
 7 files changed, 1686 insertions(+)

-- 
1.8.3.1



More information about the dev mailing list