OXM: Add VLAN VID as a prerequisite for VLAN PCP
authorSimon Horman <horms@verge.net.au>
Mon, 23 Jul 2012 02:36:44 +0000 (11:36 +0900)
committerBen Pfaff <blp@nicira.com>
Mon, 23 Jul 2012 16:21:40 +0000 (09:21 -0700)
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
lib/meta-flow.c
lib/meta-flow.h
tests/ovs-ofctl.at

index 101409a2cbaefcdc8458a35b2827fe0685e71b83..c50cfc5359215119ae0210481cf232c4a9b1afd5 100644 (file)
@@ -188,7 +188,7 @@ static const struct mf_field mf_fields[MFF_N_IDS] = {
         1, 3,
         MFM_NONE, 0,
         MFS_DECIMAL,
-        MFP_NONE,
+        MFP_VLAN_VID,
         true,
         OXM_OF_VLAN_PCP, "OXM_OF_VLAN_PCP",
         OXM_OF_VLAN_PCP, "OXM_OF_VLAN_PCP",
@@ -826,6 +826,8 @@ mf_are_prereqs_ok(const struct mf_field *mf, const struct flow *flow)
         return flow->dl_type == htons(ETH_TYPE_IP);
     case MFP_IPV6:
         return flow->dl_type == htons(ETH_TYPE_IPV6);
+    case MFP_VLAN_VID:
+        return flow->vlan_tci & htons(VLAN_CFI);
     case MFP_IP_ANY:
         return is_ip_any(flow);
 
index 28d43ebc78e4de62236308f93bd82616602fe729..12a4baa26868f41e11f4802c6346f3e7f0db0647 100644 (file)
@@ -156,6 +156,7 @@ enum mf_prereqs {
 
     /* L2 requirements. */
     MFP_ARP,
+    MFP_VLAN_VID,
     MFP_IPV4,
     MFP_IPV6,
     MFP_IP_ANY,
index af364868b48c59556a55a9e3af327b38fd3350c0..c9a349c557dc800bbfedbff38fad4f9bfc5ba9b1 100644 (file)
@@ -1311,10 +1311,12 @@ OXM_OF_ETH_TYPE(0800) OXM_OF_IN_PORT(00000012)
 # vlan
 OXM_OF_VLAN_VID(1009) OXM_OF_VLAN_VID(1009) # Duplicate Field
 OXM_OF_VLAN_VID(f009)           # Bad Value
+OXM_OF_VLAN_PCP(00)             # Bad Pre-Requisite
 OXM_OF_VLAN_VID(0000)           # Packets without 802.1Q header or with VID=0
 OXM_OF_VLAN_VID(1123)           # Packets with VID=123, any PCP
 OXM_OF_VLAN_VID(1123) OXM_OF_VLAN_PCP(01) # Packets with VID=123, PCP=1.
 OXM_OF_VLAN_VID(0123)           # Does not make sense (but supported anyway)
+OXM_OF_VLAN_VID(0123) OXM_OF_VLAN_PCP(01)  #Bad Pre-Requisite
 
 # IP ECN
 OXM_OF_ETH_TYPE(0800) OXM_OF_IP_ECN(03)
@@ -1494,10 +1496,12 @@ OXM_OF_IN_PORT(00000012), OXM_OF_ETH_TYPE(0800)
 # vlan
 nx_pull_match() returned error OFPBMC_DUP_FIELD
 nx_pull_match() returned error OFPBMC_BAD_VALUE
+nx_pull_match() returned error OFPBMC_BAD_PREREQ
 OXM_OF_VLAN_VID(0000)
 OXM_OF_VLAN_VID(1123)
 OXM_OF_VLAN_VID(1123), OXM_OF_VLAN_PCP(01)
 OXM_OF_VLAN_VID(0123)
+nx_pull_match() returned error OFPBMC_BAD_PREREQ
 
 # IP ECN
 OXM_OF_ETH_TYPE(0800), OXM_OF_IP_ECN(03)