From: Ben Pfaff Date: Tue, 7 Dec 2010 20:47:40 +0000 (-0800) Subject: ofp-parse: Add support for tun_id. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4c5df7f7740c8a111289d460176cd9c94967329f;p=openvswitch ofp-parse: Add support for tun_id. This updates the ovs-ofctl manpage even though ovs-ofctl doesn't really support tun_id yet. --- diff --git a/lib/ofp-parse.c b/lib/ofp-parse.c index 490c9dff..49408454 100644 --- a/lib/ofp-parse.c +++ b/lib/ofp-parse.c @@ -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); diff --git a/utilities/ovs-ofctl.8.in b/utilities/ovs-ofctl.8.in index 7ffad2b6..8cd5ef00 100644 --- a/utilities/ovs-ofctl.8.in +++ b/utilities/ovs-ofctl.8.in @@ -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: