Skip to content

Commit 06b8b9e

Browse files
committed
system-offload: Add TC tunnel flags test case.
Add a TC specific test case to test the tunnel match and action flags. Acked-by: Roi Dayan <[email protected]> Acked-by: Simon Horman <[email protected]> Signed-off-by: Eelco Chaudron <[email protected]>
1 parent 316fcc6 commit 06b8b9e

File tree

1 file changed

+59
-0
lines changed

1 file changed

+59
-0
lines changed

tests/system-offloads-traffic.at

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -933,3 +933,62 @@ OVS_WAIT_UNTIL([grep -q "Datapath does not support explicit drop action" ovs-vsw
933933

934934
OVS_TRAFFIC_VSWITCHD_STOP
935935
AT_CLEANUP
936+
937+
AT_SETUP([offload - Tunnel offloading with flags])
938+
AT_SKIP_IF([test $HAVE_NC = no])
939+
OVS_CHECK_VXLAN()
940+
941+
OVS_TRAFFIC_VSWITCHD_START([], [], [-- set Open_vSwitch . \
942+
other_config:hw-offload=true])
943+
AT_SKIP_IF([! grep -q "probe tc: enc flags are supported." ovs-vswitchd.log])
944+
945+
ADD_BR([br-underlay])
946+
947+
AT_CHECK([ovs-ofctl add-flow br0 "actions=normal"])
948+
AT_CHECK([ovs-ofctl add-flow br-underlay "actions=normal"])
949+
950+
ADD_NAMESPACES(at_ns0)
951+
952+
dnl Set up underlay link from host into the namespace using veth pair.
953+
ADD_VETH(p0, at_ns0, br-underlay, "172.31.1.1/24")
954+
AT_CHECK([ip addr add dev br-underlay "172.31.1.100/24"])
955+
AT_CHECK([ip link set dev br-underlay up])
956+
957+
dnl Set up tunnel endpoints on OVS outside the namespace and with a native
958+
dnl Linux device inside the namespace.
959+
ADD_OVS_TUNNEL([vxlan], [br0], [at_vxlan0], [172.31.1.1], [10.1.1.100/24])
960+
ADD_NATIVE_TUNNEL([vxlan], [at_vxlan1], [at_ns0], [172.31.1.100],
961+
[10.1.1.1/24], [id 0 dstport 4789])
962+
963+
dnl First, check the underlay.
964+
NS_CHECK_EXEC([at_ns0], [ping -q -c 3 -i 0.3 -W 2 172.31.1.100 | FORMAT_PING],
965+
[0], [dnl
966+
3 packets transmitted, 3 received, 0% packet loss, time 0ms
967+
])
968+
969+
dnl Check the overlay, with some icmp traffic.
970+
NS_CHECK_EXEC([at_ns0], [ping -q -c 3 -i 0.3 -W 2 10.1.1.100 | FORMAT_PING],
971+
[0], [dnl
972+
3 packets transmitted, 3 received, 0% packet loss, time 0ms
973+
])
974+
975+
# Check for a set tunnel action with df flag set.
976+
AT_CHECK([ovs-appctl dpctl/dump-flows type=tc,offloaded], [], [stdout])
977+
AT_CHECK(
978+
[grep -q -F "set(tunnel(dst=172.31.1.1,ttl=64,tp_dst=4789,flags(df)))" \
979+
stdout])
980+
AT_CHECK(
981+
[grep -q -F "tunnel(tun_id=0x0,src=172.31.1.1,dst=172.31.1.100,tp_dst=4789,flags(-df+csum+key))" \
982+
stdout])
983+
984+
# Now verify the none df, and forced csum case.
985+
AT_CHECK([ovs-vsctl set int at_vxlan0 options:df_default=false \
986+
options:csum=true])
987+
AT_CHECK([ovs-appctl revalidator/wait])
988+
AT_CHECK([ovs-appctl dpctl/dump-flows type=tc,offloaded ], [], [stdout])
989+
AT_CHECK(
990+
[grep -q -F "set(tunnel(dst=172.31.1.1,ttl=64,tp_dst=4789,flags(csum)))" \
991+
stdout])
992+
993+
OVS_TRAFFIC_VSWITCHD_STOP
994+
AT_CLEANUP

0 commit comments

Comments
 (0)