summaryrefslogtreecommitdiff
path: root/tests/system-tso-macros.at
diff options
context:
space:
mode:
authorWilliam Tu <u9012063@gmail.com>2020-03-24 15:10:50 -0700
committerWilliam Tu <u9012063@gmail.com>2020-05-14 07:21:34 -0700
commit29bb3093eb8b387ada862ea502626a4cfbaa3358 (patch)
tree3d4ea7d5e7ace8f9a31e4ac4f27d21f79bfc722e /tests/system-tso-macros.at
parentc101cd4171cfe04e214f858b4bbe089e56f13f9b (diff)
downloadopenvswitch-29bb3093eb8b387ada862ea502626a4cfbaa3358.tar.gz
userspace: Enable TSO support for non-DPDK.
This patch enables TSO support for non-DPDK use cases, and also add check-system-tso testsuite. Before TSO, we have to disable checksum offload, allowing the kernel to calculate the TCP/UDP packet checsum. With TSO, we can skip the checksum validation by enabling checksum offload, and with large packet size, we see better performance. Consider container to container use cases: iperf3 -c (ns0) -> veth peer -> OVS -> veth peer -> iperf3 -s (ns1) And I got around 6Gbps, similar to TSO with DPDK-enabled. Acked-by: Flavio Leitner <fbl@sysclose.org> Acked-by: Ilya Maximets <i.maximets@ovn.org> Signed-off-by: William Tu <u9012063@gmail.com>
Diffstat (limited to 'tests/system-tso-macros.at')
-rw-r--r--tests/system-tso-macros.at31
1 files changed, 31 insertions, 0 deletions
diff --git a/tests/system-tso-macros.at b/tests/system-tso-macros.at
new file mode 100644
index 000000000..406334f3e
--- /dev/null
+++ b/tests/system-tso-macros.at
@@ -0,0 +1,31 @@
+# _ADD_BR([name])
+#
+# Expands into the proper ovs-vsctl commands to create a bridge with the
+# appropriate type and properties
+m4_define([_ADD_BR], [[add-br $1 -- set Bridge $1 datapath_type="netdev" protocols=OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15 fail-mode=secure ]])
+
+# OVS_TRAFFIC_VSWITCHD_START([vsctl-args], [vsctl-output], [=override])
+#
+# Creates a database and starts ovsdb-server, starts ovs-vswitchd
+# connected to that database, calls ovs-vsctl to create a bridge named
+# br0 with predictable settings, passing 'vsctl-args' as additional
+# commands to ovs-vsctl. If 'vsctl-args' causes ovs-vsctl to provide
+# output (e.g. because it includes "create" commands) then 'vsctl-output'
+# specifies the expected output after filtering through uuidfilt.
+m4_define([OVS_TRAFFIC_VSWITCHD_START],
+ [
+ OVS_WAIT_WHILE([ip link show ovs-netdev])
+ _OVS_VSWITCHD_START([--disable-system])
+ dnl Add bridges, ports, etc.
+ OVS_WAIT_WHILE([ip link show br0])
+ AT_CHECK([ovs-vsctl set Open_vSwitch . other_config:userspace-tso-enable=true])
+ AT_CHECK([ovs-vsctl -- _ADD_BR([br0]) -- $1 m4_if([$2], [], [], [| uuidfilt])], [0], [$2])
+])
+
+# CONFIGURE_VETH_OFFLOADS([VETH])
+#
+# Enable TCP segmentation offload and scatter-gather for veths.
+m4_define([CONFIGURE_VETH_OFFLOADS],
+ [AT_CHECK([ethtool -K $1 sg on], [0], [ignore], [ignore])]
+ [AT_CHECK([ethtool -K $1 tso on], [0], [ignore], [ignore])]
+)