OXM inspired match field names.
authorJarno Rajahalme <jrajahalme@nicira.com>
Thu, 24 Oct 2013 20:19:28 +0000 (13:19 -0700)
committerBen Pfaff <blp@nicira.com>
Fri, 1 Nov 2013 21:21:59 +0000 (14:21 -0700)
Adds OXM inspired aliases for match fields that don't have them
already ("ip_proto", "ip_ecn", "ip_dscp", and "tunnel_id").

"ip_dscp" replaces the earlier undocumented "nw_tos_shifted",
and takes the DSCP value (0-63), which is then shifted
appropriately when applied to an IP packet.
The number of bits for this field is fixed from 8 to 6.

Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
lib/meta-flow.c
tests/ovs-ofctl.at
utilities/ovs-ofctl.8.in

index f53f3c4..9f39c18 100644 (file)
@@ -49,7 +49,7 @@ const struct mf_field mf_fields[MFF_N_IDS] = {
     /* ## -------- ## */
 
     {
-        MFF_TUN_ID, "tun_id", NULL,
+        MFF_TUN_ID, "tun_id", "tunnel_id",
         MF_FIELD_SIZES(be64),
         MFM_FULLY,
         MFS_HEXADECIMAL,
@@ -411,7 +411,7 @@ const struct mf_field mf_fields[MFF_N_IDS] = {
     },
 
     {
-        MFF_IP_PROTO, "nw_proto", NULL,
+        MFF_IP_PROTO, "nw_proto", "ip_proto",
         MF_FIELD_SIZES(u8),
         MFM_NONE,
         MFS_DECIMAL,
@@ -433,8 +433,8 @@ const struct mf_field mf_fields[MFF_N_IDS] = {
         OFPUTIL_P_ANY,   /* Will be shifted for OXM. */
         OFPUTIL_P_NONE,
     }, {
-        MFF_IP_DSCP_SHIFTED, "nw_tos_shifted", NULL,
-        MF_FIELD_SIZES(u8),
+        MFF_IP_DSCP_SHIFTED, "ip_dscp", NULL,
+        1, 6,
         MFM_NONE,
         MFS_DECIMAL,
         MFP_IP_ANY,
@@ -444,7 +444,7 @@ const struct mf_field mf_fields[MFF_N_IDS] = {
         OFPUTIL_P_ANY,   /* Will be shifted for non-OXM. */
         OFPUTIL_P_NONE,
     }, {
-        MFF_IP_ECN, "nw_ecn", NULL,
+        MFF_IP_ECN, "nw_ecn", "ip_ecn",
         1, 2,
         MFM_NONE,
         MFS_DECIMAL,
index 4272fb1..01ef8e7 100644 (file)
@@ -70,8 +70,8 @@ for test_case in \
     'ipv6,nw_proto=1                             NXM,OXM' \
     'ip,nw_tos=0xf0                              any' \
     'ipv6,nw_tos=0xf0                            NXM,OXM' \
-    'ip,nw_tos_shifted=0x3c                      any' \
-    'ipv6,nw_tos_shifted=0x3c                    NXM,OXM' \
+    'ip,ip_dscp=0x3c                             any' \
+    'ipv6,ip_dscp=0x3c                           NXM,OXM' \
     'ip,nw_ecn=1                                 NXM,OXM' \
     'ipv6,nw_ecn=1                               NXM,OXM' \
     'ip,nw_ttl=5                                 NXM,OXM' \
@@ -252,8 +252,8 @@ for test_case in \
     'ipv6 nw_proto 1/1' \
     'ip nw_tos 0xf0/0xf0' \
     'ipv6 nw_tos 0xf0/0xf0' \
-    'ip nw_tos_shifted 0x3c/0xf0' \
-    'ipv6 nw_tos_shifted 0x3c/0xf0' \
+    'ip ip_dscp 0x3c/0xf0' \
+    'ipv6 ip_dscp 0x3c/0xf0' \
     'ip nw_ecn 1/1' \
     'ipv6 nw_ecn 1/1' \
     'ip nw_ttl 5/1' \
index 81c90bd..168e955 100644 (file)
@@ -594,6 +594,7 @@ When \fBdl_type\fR is wildcarded or set to a value other than 0x0800,
 (see \fBFlow Syntax\fR above).
 .
 .IP \fBnw_proto=\fIproto\fR
+.IQ \fBip_proto=\fIproto\fR
 When \fBip\fR or \fBdl_type=0x0800\fR is specified, matches IP
 protocol type \fIproto\fR, which is specified as a decimal number
 between 0 and 255, inclusive (e.g. 1 to match ICMP packets or 6 to match
@@ -626,7 +627,16 @@ When \fBdl_type\fR is wildcarded or set to a value other than 0x0800 or
 0x86dd, the value of \fBnw_tos\fR is ignored (see \fBFlow Syntax\fR
 above).
 .
+.IP \fBip_dscp=\fIdscp\fR
+Matches IP ToS/DSCP or IPv6 traffic class field \fIdscp\fR, which is
+specified as a decimal number between 0 and 63, inclusive.
+.IP
+When \fBdl_type\fR is wildcarded or set to a value other than 0x0800 or
+0x86dd, the value of \fBip_dscp\fR is ignored (see \fBFlow Syntax\fR
+above).
+.
 .IP \fBnw_ecn=\fIecn\fR
+.IQ \fBip_ecn=\fIecn\fR
 Matches \fIecn\fR bits in IP ToS or IPv6 traffic class fields, which is
 specified as a decimal number between 0 and 3, inclusive.
 .IP
@@ -920,6 +930,7 @@ address option.  An address is specified as 6 pairs of hexadecimal
 digits delimited by colons.
 .
 .IP \fBtun_id=\fItunnel-id\fR[\fB/\fImask\fR]
+.IQ \fBtunnel_id=\fItunnel-id\fR[\fB/\fImask\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 and a nonzero key value) will have a nonzero tunnel ID.