ofp-parse: Add support for tun_id.
authorBen Pfaff <blp@nicira.com>
Tue, 7 Dec 2010 20:47:40 +0000 (12:47 -0800)
committerBen Pfaff <blp@nicira.com>
Tue, 7 Dec 2010 20:47:40 +0000 (12:47 -0800)
This updates the ovs-ofctl manpage even though ovs-ofctl doesn't really
support tun_id yet.

lib/ofp-parse.c
utilities/ovs-ofctl.8.in

index 490c9df..4940845 100644 (file)
@@ -382,6 +382,7 @@ parse_protocol(const char *name, const struct protocol **p_out)
 }
 
 #define FIELDS                                              \
+    FIELD(F_TUN_ID,      "tun_id",      FWW_TUN_ID)         \
     FIELD(F_IN_PORT,     "in_port",     FWW_IN_PORT)        \
     FIELD(F_DL_VLAN,     "dl_vlan",     0)                  \
     FIELD(F_DL_VLAN_PCP, "dl_vlan_pcp", 0)                  \
@@ -439,6 +440,10 @@ parse_field_value(struct cls_rule *rule, enum field_index index,
     uint16_t port_no;
 
     switch (index) {
+    case F_TUN_ID:
+        cls_rule_set_tun_id(rule, htonl(str_to_u32(value)));
+        break;
+
     case F_IN_PORT:
         if (!parse_port_name(value, &port_no)) {
             port_no = atoi(value);
index 7ffad2b..8cd5ef0 100644 (file)
@@ -337,6 +337,26 @@ as a decimal number between 0 and 255, inclusive.
 .IP
 When \fBdl_type\fR and \fBnw_proto\fR take other values, the values of
 these settings are ignored (see \fBFlow Syntax\fR above).
+.IP \fBtun_id=\fItunnel\-id\fR
+Matches tunnel identifier \fItunnel\-id\fR.  Only packets that arrive
+over a tunnel that carries a key (e.g. GRE with the RFC 2890 key
+extension) will have a nonzero tunnel ID.
+.IP
+\fBtun_id\fR requires use of one of two Nicira extensions to OpenFlow:
+.RS
+.IP "NXM (Nicira Extended Match)"
+This extension fully supports \fBtun_id\fR. 
+.IP "Tunnel ID from Cookie"
+This extension supports \fBtun_id\fR with two caveats: the top 32 bits
+of the \fBcookie\fR (see below) are used for \fItunnel\-id\fR and thus
+unavailable for other use, and specifying \fBtun_id\fR on
+\fBdump\-flows\fR or \fBdump\-aggregate\fR has no effect.
+.RE
+.IP
+When \fBtun_id\fR is specified, \fBovs\-ofctl\fR will automatically
+attempt to negotiate use of one of these extensions, preferring NXM.
+If the switch does not support either extension, then \fBovs\-ofctl\fR
+will report a fatal error.
 .
 .PP
 The following shorthand notations are also available: