summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/net/forwarding/vxlan_bridge_1d.sh
diff options
context:
space:
mode:
authorPetr Machata <petrm@mellanox.com>2018-11-19 16:11:22 +0000
committerDavid S. Miller <davem@davemloft.net>2018-11-19 17:59:44 -0800
commit1e5abfb3ff41a532f687875ada9ea2af7a1069b3 (patch)
tree8306e30e7286241a9d1638e98d70bdff2c2e4244 /tools/testing/selftests/net/forwarding/vxlan_bridge_1d.sh
parentd417ecf533fe014de667705f58ae5c579f7740b9 (diff)
selftests: forwarding: vxlan_bridge_1d: Add an ECN encap test
Test that ECN bits in the VXLAN envelope are correctly deduced from the overlay packet. Signed-off-by: Petr Machata <petrm@mellanox.com> Signed-off-by: Ido Schimmel <idosch@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'tools/testing/selftests/net/forwarding/vxlan_bridge_1d.sh')
-rwxr-xr-xtools/testing/selftests/net/forwarding/vxlan_bridge_1d.sh26
1 files changed, 26 insertions, 0 deletions
diff --git a/tools/testing/selftests/net/forwarding/vxlan_bridge_1d.sh b/tools/testing/selftests/net/forwarding/vxlan_bridge_1d.sh
index ac1070937ae7..82a124cbd523 100755
--- a/tools/testing/selftests/net/forwarding/vxlan_bridge_1d.sh
+++ b/tools/testing/selftests/net/forwarding/vxlan_bridge_1d.sh
@@ -70,6 +70,7 @@ export VXPORT
test_unicast
test_ttl
test_tos
+ test_ecn_encap
reapply_config
ping_ipv4
test_flood
@@ -521,6 +522,31 @@ test_tos()
log_test "VXLAN: envelope TOS inheritance"
}
+__test_ecn_encap()
+{
+ local q=$1; shift
+ local tos=$1; shift
+
+ RET=0
+
+ tc filter add dev v1 egress pref 77 prot ip \
+ flower ip_tos $tos action pass
+ sleep 1
+ vxlan_ping_test $h1 192.0.2.3 "-Q $q" v1 egress 77 10
+ tc filter del dev v1 egress pref 77 prot ip
+
+ log_test "VXLAN: ECN encap: $q->$tos"
+}
+
+test_ecn_encap()
+{
+ # In accordance with INET_ECN_encapsulate()
+ __test_ecn_encap 0x00 0x00
+ __test_ecn_encap 0x01 0x01
+ __test_ecn_encap 0x02 0x02
+ __test_ecn_encap 0x03 0x02
+}
+
test_all()
{
echo "Running tests with UDP port $VXPORT"