numam-dpdk/app
Gregory Etelson 1b9f274623 app/testpmd: add commands for tunnel offload
Tunnel Offload API provides hardware independent, unified model
to offload tunneled traffic. Key model elements are:
 - apply matches to both outer and inner packet headers
   during entire offload procedure;
 - restore outer header of partially offloaded packet;
 - model is implemented as a set of helper functions.

Implementation details:

* Create application tunnel:
flow tunnel create <port> type <tunnel type>
On success, the command creates application tunnel object and returns
the tunnel descriptor. Tunnel descriptor is used in subsequent flow
creation commands to reference the tunnel.

* Create tunnel steering flow rule:
tunnel_set <tunnel descriptor> parameter used with steering rule
template.

* Create tunnel matching flow rule:
tunnel_match <tunnel descriptor> used with matching rule template.

* If tunnel steering rule was offloaded, outer header of a partially
offloaded packet is restored after miss.

Example:
test packet=
<Ether  dst=24:8a:07:8d:ae:d6 src=50:6b:4b:cc:fc:e2 type=IPv4 |
<IP  version=4 ihl=5 proto=udp src=1.1.1.1 dst=1.1.1.10 |
<UDP  sport=4789 dport=4789 len=58 chksum=0x7f7b |
<VXLAN  NextProtocol=Ethernet vni=0x0 |
<Ether  dst=24:aa:aa:aa:aa:d6 src=50:bb:bb:bb:bb:e2 type=IPv4 |
<IP  version=4 ihl=5 proto=icmp src=2.2.2.2 dst=2.2.2.200 |
<ICMP  type=echo-request code=0 chksum=0xf7ff id=0x0 seq=0x0 |>>>>>>>
>>> len(packet)
92

testpmd> flow flush 0
testpmd> port 0/queue 0: received 1 packets
src=50:6B:4B:CC:FC:E2 - dst=24:8A:07:8D:AE:D6 - type=0x0800 -
length=92

testpmd> flow tunnel 0 type vxlan
port 0: flow tunnel #1 type vxlan
testpmd> flow create 0 ingress group 0 tunnel_set 1
         pattern eth /ipv4 / udp dst is 4789 / vxlan / end
         actions  jump group 0 / end
Flow rule #0 created
testpmd> port 0/queue 0: received 1 packets
tunnel restore info: - vxlan tunnel - outer header present # <--
  src=50:6B:4B:CC:FC:E2 - dst=24:8A:07:8D:AE:D6 - type=0x0800 -
length=92

testpmd> flow create 0 ingress group 0 tunnel_match 1
         pattern eth / ipv4 / udp dst is 4789 / vxlan / eth / ipv4 /
         end
         actions set_mac_dst mac_addr 02:CA:FE:CA:FA:80 /
         queue index 0 / end
Flow rule #1 created
testpmd> port 0/queue 0: received 1 packets
  src=50:BB:BB:BB:BB:E2 - dst=02:CA:FE:CA:FA:80 - type=0x0800 -
length=42

* Destroy flow tunnel
flow tunnel destroy <port> id <tunnel id>

* Show existing flow tunnels
flow tunnel list <port>

Signed-off-by: Gregory Etelson <getelson@nvidia.com>
2020-10-16 19:48:19 +02:00
..
pdump build: remove makefiles 2020-09-08 00:09:50 +02:00
proc-info app/procinfo: close devices before exit 2020-10-06 22:00:35 +02:00
test eal: add cache line demotion API 2020-10-16 14:11:45 +02:00
test-acl acl: add 512-bit AVX512 classify method 2020-10-14 14:23:01 +02:00
test-bbdev app/bbdev: fix test vector symlink 2020-10-14 21:32:11 +02:00
test-cmdline cmdline: make implementation logically opaque 2020-10-15 00:39:10 +02:00
test-compress-perf build: remove makefiles 2020-09-08 00:09:50 +02:00
test-crypto-perf crypto/scheduler: rename slave to worker 2020-10-14 21:31:46 +02:00
test-eventdev eventdev: express DLB/DLB2 PMD constraints 2020-10-15 23:16:07 +02:00
test-fib build: remove makefiles 2020-09-08 00:09:50 +02:00
test-flow-perf app/flow-perf: allow fixed values for actions 2020-09-18 18:55:11 +02:00
test-pipeline app: use new link status print format 2020-09-21 18:05:37 +02:00
test-pmd app/testpmd: add commands for tunnel offload 2020-10-16 19:48:19 +02:00
test-regex build: remove makefiles 2020-09-08 00:09:50 +02:00
test-sad app/test-sad: fix uninitialized variable 2020-10-14 21:06:56 +02:00
meson.build app/regex: add RegEx test application 2020-07-30 09:13:52 +02:00