[ovs-dev] [PATCH] utilities/ovs-ofctl.8.in: Added clarifications and examples to ovs-ofctl man page

Ori Shoshan ori.shoshan at guardicore.com
Sun Aug 14 09:49:00 UTC 2016


Added a few examples and clarifications to the man page to explain points I had difficulty figuring out without reading code/tests.

Signed-off-by: Ori Shoshan <ori.shoshan at guardicore.com>
---

1 file changed, 22 insertions(+), 2 deletions(-)


diff --git a/utilities/ovs-ofctl.8.in b/utilities/ovs-ofctl.8.in
index 84057c0..997a8eb 100644
--- a/utilities/ovs-ofctl.8.in
+++ b/utilities/ovs-ofctl.8.in
@@ -2186,16 +2186,23 @@ Adds a match criterion to the new flow.
 The first form specifies that \fIfield\fR must match the literal
 \fIvalue\fR, e.g. \fBdl_type=0x0800\fR.  All of the fields and values
 for \fBovs\-ofctl\fR flow syntax are available with their usual
-meanings.
+meanings. Note that shorthand notation matchers (e.g. \fBip\fR in place of
+\fBdl_type=0x0800\fR) are not available in flows created by learn actions.
 .IP
 The second form specifies that \fIfield\fB[\fIstart\fB..\fIend\fB]\fR
 in the new flow must match \fIsrc\fB[\fIstart\fB..\fIend\fB]\fR taken
 from the flow currently being processed.
+For example, \fINXM_OF_UDP_DST\fB[]\fR=\fINXM_OF_UDP_SRC\fB[]\fR on a
+TCP packet for which the UDP src port is \fB53\fR, creates a flow which
+matches \fINXM_OF_UDP_DST\fB[]\fR=\fB53\fR.
 .IP
 The third form is a shorthand for the second form.  It specifies that
-\fIfield\fB[\fIstart\fB..\fIend\fB]\fR in the new flow must match
+\fIfield\fB[\fIstart\fB..\fIend\fB]\fR in the new flow must match the same
 \fIfield\fB[\fIstart\fB..\fIend\fB]\fR taken from the flow currently
 being processed.
+For example, \fINXM_OF_TCP_DST\fB[]\fR on a TCP packet
+for which the TCP dst port is \fB80\fR, creates a flow which
+matches \fINXM_OF_TCP_DST\fB[]\fR=\fB80\fR.
 .
 .IP \fBload:\fIvalue\fB\->\fIdst\fB[\fIstart\fB..\fIend\fB]
 .IQ \fBload:\fIsrc\fB[\fIstart\fB..\fIend\fB]\->\fIdst\fB[\fIstart\fB..\fIend\fB]
@@ -3185,6 +3192,19 @@ some traffic has passed through.)
 \fBovs\-ofctl dump\-flows br0\fR
 Prints the flow entries in the switch.
 .
+.TP
+\fBovs\-ofctl add\-flow table=0 actions=learn(table=1,hard_timeout=10, NXM_OF_VLAN_TCI[0..11],output:NXM_OF_IN_PORT[]), resubmit(,1)\fR
+\fBovs\-ofctl add\-flow  table=1 priority=0 actions=flood\fR
+Implements a level 2 MAC learning switch using the learn.
+.
+.TP
+\fBovs\-ofctl add\-flow br0 'table=0,priority=0 actions=load:3->NXM_NX_REG0[0..15],learn(table=0,priority=1,idle_timeout=10,NXM_OF_ETH_SRC[],NXM_OF_VLAN_TCI[0..11],output:NXM_NX_REG0[0..15]),output:2\fR
+In this use of a learn action, the first packet from each source MAC
+will be sent to port 2. Subsequent packets will be output to port 3,
+with an idle timeout of 10 seconds.
+.
+Additional examples may be found documented as part of related sections.
+.
 .SH "SEE ALSO"
 .
 .BR ovs\-appctl (8),



More information about the dev mailing list