OXM: Add VLAN VID as a prerequisite for VLAN PCP
[openvswitch] / lib / meta-flow.c
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);