diff mbox

[ovs-dev,RFC,3/4] doc: Convert ovs-test to rST

Message ID 20170410121230.16029-4-stephen@that.guru
State Superseded
Headers show

Commit Message

Stephen Finucane April 10, 2017, 12:12 p.m. UTC
Signed-off-by: Stephen Finucane <stephen@that.guru>
---
See comment on the previous change
---
 Documentation/automake.mk           |   2 +
 Documentation/conf.py               |   3 +
 Documentation/ref/index.rst         |   1 +
 Documentation/ref/ovs-test.rst      | 165 ++++++++++++++++++++++++++++++++++++
 Documentation/ref/ovs-vlan-test.rst |  11 +--
 debian/openvswitch-test.manpages    |   1 -
 manpages.mk                         |  10 ---
 utilities/automake.mk               |   3 -
 8 files changed, 175 insertions(+), 21 deletions(-)
 create mode 100644 Documentation/ref/ovs-test.rst

Comments

Ben Pfaff April 14, 2017, 4:31 a.m. UTC | #1
On Mon, Apr 10, 2017 at 01:12:29PM +0100, Stephen Finucane wrote:
> Signed-off-by: Stephen Finucane <stephen@that.guru>
> ---
> See comment on the previous change

Thanks again, I made similar changes to this one as I did to the
previous.
diff mbox

Patch

diff --git a/Documentation/automake.mk b/Documentation/automake.mk
index 2d62a6a..7b6de65 100644
--- a/Documentation/automake.mk
+++ b/Documentation/automake.mk
@@ -90,6 +90,7 @@  DOC_SOURCE = \
 	Documentation/internals/contributing/libopenvswitch-abi.rst \
 	Documentation/internals/contributing/submitting-patches.rst \
 	Documentation/ref/index.rst \
+	Documentation/ref/ovs-test.rst \
 	Documentation/ref/ovs-vlan-test.rst \
 	Documentation/requirements.txt
 
@@ -118,6 +119,7 @@  ALL_LOCAL += docs-check
 CLEANFILES += docs-check
 
 man_MANS += \
+	$(SPHINXBUILDDIR)/man/ovs-test.1 \
 	$(SPHINXBUILDDIR)/man/ovs-vlan-test.1
 
 check-docs:
diff --git a/Documentation/conf.py b/Documentation/conf.py
index e40302c..28008ed 100644
--- a/Documentation/conf.py
+++ b/Documentation/conf.py
@@ -312,6 +312,9 @@  latex_documents = [
 # One entry per manual page. List of tuples
 # (source start file, name, description, authors, manual section).
 man_pages = [
+    ('ref/ovs-test', 'ovs-test',
+     u'Check Linux drivers for performance, vlan and L3 tunneling problems',
+     [author], 1),
     ('ref/ovs-vlan-test', 'ovs-vlan-test',
      u'Check Linux drivers for problems with vlan traffic',
      [author], 1)
diff --git a/Documentation/ref/index.rst b/Documentation/ref/index.rst
index 1e0d413..635f4df 100644
--- a/Documentation/ref/index.rst
+++ b/Documentation/ref/index.rst
@@ -39,6 +39,7 @@  time:
 .. toctree::
    :maxdepth: 3
 
+   ovs-test
    ovs-vlan-test
 
 The remainder are still in roff format can be found below:
diff --git a/Documentation/ref/ovs-test.rst b/Documentation/ref/ovs-test.rst
new file mode 100644
index 0000000..164068d
--- /dev/null
+++ b/Documentation/ref/ovs-test.rst
@@ -0,0 +1,165 @@ 
+========
+ovs-test
+========
+
+Synopsis
+========
+
+::
+
+    ovs-test -s port
+
+    ovs-test -c server1 server2 [-b targetbandwidth] [-i testinterval] [-d]
+      [-l vlantag] [-t tunnelmodes]
+
+Description
+===========
+
+The :program:`ovs-test` program may be used to check for problems sending
+802.1Q or GRE traffic that Open vSwitch may uncover. These problems, for
+example, can occur when Open vSwitch is used to send 802.1Q traffic through
+physical interfaces running certain drivers of certain Linux kernel versions.
+To run a test, configure IP addresses on `server1` and `server2` for interfaces
+you intended to test. These interfaces could also be already configured OVS
+bridges that have a physical interface attached to them. Then, on one of the
+nodes, run :program:`ovs-test` in server mode and on the other node run it in
+client mode. The client will connect to :program:`ovs-test` server and schedule
+tests between both of them. The :program:`ovs-test` client will perform UDP and
+TCP tests.
+
+UDP tests can report packet loss and achieved bandwidth for various datagram
+sizes. By default target bandwidth for UDP tests is 1Mbit/s.
+
+TCP tests report only achieved bandwidth, because kernel TCP stack takes care
+of flow control and packet loss. TCP tests are essential to detect potential
+TSO related issues.
+
+To determine whether Open vSwitch is encountering any problems, the user must
+compare packet loss and achieved bandwidth in a setup where traffic is being
+directly sent and in one where it is not. If in the 802.1Q or L3 tunneled tests
+both :program:`ovs-test` processes are unable to communicate or the achieved
+bandwidth is much lower compared to direct setup, then, most likely, Open
+vSwitch has encountered a pre-existing kernel or driver bug.
+
+Some examples of the types of problems that may be encountered are:
+
+- When NICs use VLAN stripping on receive they must pass a pointer to a
+  `vlan_group` when reporting the stripped tag to the networking core. If no
+  `vlan_group` is in use then some drivers just drop the extracted tag.
+  Drivers are supposed to only enable stripping if a `vlan_group` is registered
+  but not all of them do that.
+
+- On receive, some drivers handle priority tagged packets specially and don't
+  pass the tag onto the network stack at all, so Open vSwitch never has a
+  chance to see it.
+
+- Some drivers size their receive buffers based on whether a `vlan_group` is
+  enabled, meaning that a maximum size packet with a VLAN tag will not fit if
+  no `vlan_group` is configured.
+
+- On transmit, some drivers expect that VLAN acceleration will be used if it is
+  available, which can only be done if a `vlan_group` is configured. In these
+  cases, the driver may fail to parse the packet and correctly setup checksum
+  offloading or TSO.
+
+Client Mode
+  An :program:`ovs-test` client will connect to two :program:`ovs-test` servers
+  and will ask them to exchange test traffic. It is also possible to spawn an
+  :program:`ovs-test` server automatically from the client.
+
+Server Mode
+  To conduct tests, two :program:`ovs-test` servers must be running on two
+  different hosts where the client can connect. The actual test traffic is
+  exchanged only between both :program:`ovs-test` servers. It is recommended
+  that both servers have their IP addresses in the same subnet, otherwise one
+  would have to make sure that routing is set up correctly.
+
+Options
+=======
+
+.. program:: ovs-test
+
+.. option:: -s <port>, --server <port>
+
+    Run in server mode and wait for the client to establish XML RPC Control
+    Connection on this TCP port. It is recommended to have `ethtool(8)`
+    installed on the server so that it could retrieve information about the NIC
+    driver.
+
+.. option:: -c <server1> <server2>, --client <server1> <server2>
+
+    Run in client mode and schedule tests between `server1` and `server2`,
+    where each server must be given in the following format::
+
+        OuterIP[:OuterPort],InnerIP[/Mask][:InnerPort].
+
+    The `OuterIP` must be already assigned to the physical interface which is
+    going to be tested. This is the IP address where client will try to
+    establish XML RPC connection. If `OuterIP` is 127.0.0.1 then client will
+    automatically spawn a local instance of :program:`ovs-test` server.
+    OuterPort is TCP port where server is listening for incoming XML/RPC
+    control connections to schedule tests (by default it is 15531). The
+    :program:`ovs-test` will automatically assign `InnerIP[/Mask]` to the
+    interfaces that will be created on the fly for testing purposes. It is
+    important that `InnerIP[/Mask]` does not interfere with already existing IP
+    addresses on both :program:`ovs-test` servers and client. InnerPort is port
+    which will be used by server to listen for test traffic that will be
+    encapsulated (by default it is 15532).
+
+.. option:: -b <targetbandwidth>, --bandwidth <targetbandwidth>
+
+    Target bandwidth for UDP tests. The targetbandwidth must be given in bits
+    per second. It is possible to use postfix `M` or `K` to alter the target
+    bandwidth magnitude.
+
+.. option:: -i <testinterval>, --interval <testinterval>
+
+    How long each test should run. By default 5 seconds.
+
+.. option:: -h, --help
+
+    Prints a brief help message to the console.
+
+.. option:: -V, --version
+
+    Prints version information to the console.
+
+The following test modes are supported by :program:`ovs-test`. It is possible
+to combine multiple of them in a single :program:`ovs-test` invocation.
+
+.. option:: -d, --direct
+
+    Perform direct tests between both OuterIP addresses. These tests could be
+    used as a reference to compare 802.1Q or L3 tunneling test results.
+
+.. option:: -l <vlantag>, --vlan-tag <vlantag>
+
+    Perform 802.1Q tests between both servers. These tests will create a
+    temporary OVS bridge, if necessary, and attach a VLAN tagged port to
+    it for testing purposes.
+
+.. option:: -t <tunnelmodes>, --tunnel-modes <tunnelmodes>
+
+    Perform L3 tunneling tests. The given argument is a comma sepa‐ rated
+    string that specifies all the L3 tunnel modes that should be tested (e.g.
+    gre). The L3 tunnels are terminated on interface that has the OuterIP
+    address assigned.
+
+Examples
+========
+
+On host 1.2.3.4 start :program:`ovs-test` in server mode::
+
+    ovs-test -s 15531
+
+On host 1.2.3.5 start :program:`ovs-test` in client mode and do direct, VLAN
+and GRE tests between both nodes::
+
+    ovs-test -c 127.0.0.1,1.1.1.1/30 1.2.3.4,1.1.1.2/30 -d -l 123 -t
+    gre
+
+See Also
+========
+
+`ovs-vswitchd(8)`, `ovs-ofctl(8)`, `ovs-vsctl(8)`, :program:`ovs-vlan-test`,
+`ethtool(8)`, `uname(1)`
diff --git a/Documentation/ref/ovs-vlan-test.rst b/Documentation/ref/ovs-vlan-test.rst
index f29835f..1e4fea6 100644
--- a/Documentation/ref/ovs-vlan-test.rst
+++ b/Documentation/ref/ovs-vlan-test.rst
@@ -12,14 +12,11 @@  Synopsis
 Description
 ===========
 
-.. TODO(stephenfin): Add the `:program:` prefixes to `ovs-test` once that doc
-   is converted
-
 The :program:`ovs-vlan-test` utility has some limitations, for example, it does
 not use TCP in its tests. Also it does not take into account MTU to detect
 potential edge cases. To overcome those limitations a new tool was developed -
-`ovs-test`. `ovs-test` is currently supported only on Debian so, if possible,
-try to use that on instead of :program:`ovs-vlan-test`.
+:program:`ovs-test`. :program:`ovs-test` is currently supported only on Debian
+so, if possible, try to use that on instead of :program:`ovs-vlan-test`.
 
 The :program:`ovs-vlan-test` program may be used to check for problems sending
 802.1Q traffic which may occur when running Open vSwitch. These problems can
@@ -113,5 +110,5 @@  Run an :program:`ovs-vlan-test` client with a control server located at
 See Also
 ========
 
-`ovs-vswitchd(8)`, `ovs-ofctl(8)`, `ovs-vsctl(8)`, `ovs-test(8)`, `ethtool(8)`,
-`uname(1)`
+`ovs-vswitchd(8)`, `ovs-ofctl(8)`, `ovs-vsctl(8)`, :program:`ovs-test`,
+`ethtool(8)`, `uname(1)`
diff --git a/debian/openvswitch-test.manpages b/debian/openvswitch-test.manpages
index 7aa762e..3f71858 100644
--- a/debian/openvswitch-test.manpages
+++ b/debian/openvswitch-test.manpages
@@ -1,2 +1 @@ 
 utilities/ovs-l3ping.8
-utilities/ovs-test.8
diff --git a/manpages.mk b/manpages.mk
index 372d06c..ec165ba 100644
--- a/manpages.mk
+++ b/manpages.mk
@@ -204,16 +204,6 @@  utilities/ovs-tcpundump.1.in:
 lib/common-syn.man:
 lib/common.man:
 
-utilities/ovs-test.8: \
-	utilities/ovs-test.8.in \
-	lib/common-syn.man \
-	lib/common.man \
-	utilities/ovs-vlan-bugs.man
-utilities/ovs-test.8.in:
-lib/common-syn.man:
-lib/common.man:
-utilities/ovs-vlan-bugs.man:
-
 utilities/ovs-testcontroller.8: \
 	utilities/ovs-testcontroller.8.in \
 	lib/common.man \
diff --git a/utilities/automake.mk b/utilities/automake.mk
index 02531f6..1636cb9 100644
--- a/utilities/automake.mk
+++ b/utilities/automake.mk
@@ -71,7 +71,6 @@  MAN_ROOTS += \
 	utilities/ovs-tcpdump.8.in \
 	utilities/ovs-tcpundump.1.in \
 	utilities/ovs-vlan-bug-workaround.8.in \
-	utilities/ovs-test.8.in \
 	utilities/ovs-vsctl.8.in
 MAN_FRAGMENTS += utilities/ovs-vlan-bugs.man
 CLEANFILES += \
@@ -98,7 +97,6 @@  CLEANFILES += \
 	utilities/ovs-tcpundump \
 	utilities/ovs-tcpundump.1 \
 	utilities/ovs-test \
-	utilities/ovs-test.8 \
 	utilities/ovs-vlan-test \
 	utilities/ovs-vlan-bug-workaround.8 \
 	utilities/ovs-vsctl.8
@@ -117,7 +115,6 @@  man_MANS += \
 	utilities/ovs-tcpdump.8 \
 	utilities/ovs-tcpundump.1 \
 	utilities/ovs-vlan-bug-workaround.8 \
-	utilities/ovs-test.8 \
 	utilities/ovs-vsctl.8
 
 utilities_ovs_appctl_SOURCES = utilities/ovs-appctl.c