Hi Nelio, > -----Original Message----- > From: Nelio Laranjeiro [mailto:nelio.laranje...@6wind.com] > Sent: Thursday, June 21, 2018 8:14 AM > To: dev@dpdk.org; Adrien Mazarguil <adrien.mazarg...@6wind.com>; Lu, > Wenzhuo <wenzhuo...@intel.com>; Wu, Jingjing <jingjing...@intel.com>; > Iremonger, Bernard <bernard.iremon...@intel.com>; Awal, Mohammad Abdul > <mohammad.abdul.a...@intel.com>; Ori Kam <or...@mellanox.com>; > Stephen Hemminger <step...@networkplumber.org> > Subject: [PATCH v4 2/2] app/testpmd: add NVGRE encap/decap support > > Due to the complex NVGRE_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 nvgre_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.laranje...@6wind.com> > --- > app/test-pmd/cmdline.c | 118 ++++++++++++++++++ > app/test-pmd/cmdline_flow.c | 129 ++++++++++++++++++++ > app/test-pmd/testpmd.c | 15 +++ > app/test-pmd/testpmd.h | 15 +++ > doc/guides/testpmd_app_ug/testpmd_funcs.rst | 37 ++++++ > 5 files changed, 314 insertions(+)
<snip> > diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst > b/doc/guides/testpmd_app_ug/testpmd_funcs.rst > index 2743043d3..17e0fef63 100644 > --- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst > +++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst > @@ -1542,6 +1542,14 @@ Configure the outer layer to encapsulate a packet > inside a VXLAN tunnel:: > testpmd> set vxlan ipv4|ipv6 (vni) (udp-src) (udp-dst) (ip-src) (ip-dst) > (mac-src) > (mac-dst) > testpmd> set vxlan-with-vlan ipv4|ipv6 (vni) (udp-src) (udp-dst) (ip-src) > (ip-dst) > (vlan-tci) (mac-src) (mac-dst) > > +Config NVGRE Encap outer layers > +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > + > +Configure the outer layer to encapsulate a packet inside a NVGRE tunnel:: > + > + testpmd> set nvgre ipv4|ipv6 (tni) (ip-src) (ip-dst) (mac-src) > + testpmd> (mac-dst) set nvgre-with-vlan ipv4|ipv6 (tni) (ip-src) > + testpmd> (ip-dst) (vlan-tci) (mac-src) (mac-dst) > + > Port Functions > -------------- > > @@ -3663,6 +3671,12 @@ This section lists supported actions and their > attributes, if any. > - ``vxlan_decap``: Performs a decapsulation action by stripping all headers > of > the VXLAN tunnel network overlay from the matched flow. > > +- ``nvgre_encap``: Performs a NVGRE encapsulation, outer layer > +configuration > + is done through `Config NVGRE Encap outer layers`_. > + > +- ``nvgre_decap``: Performs a decapsulation action by stripping all > +headers of > + the NVGRE tunnel network overlay from the matched flow. > + > Destroying flow rules > ~~~~~~~~~~~~~~~~~~~~~ > > @@ -3950,6 +3964,29 @@ IPv6 VXLAN outer header:: > 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 > > +Sample NVGRE encapsulation rule > +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > + > +NVGRE 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:3973: WARNING: Literal block expected; none found. > + > +IPv4 NVGRE outer header:: > + > + testpmd> set nvgre ipv4 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 > + nvgre_encap / queue index 0 / end > + > + testpmd> set nvgre-with-vlan 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 NVGRE outer header:: > + > + testpmd> set nvgre ipv6 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 nvgre-with-vlan ipv6 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.