[ovs-dev] [PATCH] ofp-util: Recognise wildcarded VLAN as NXM only.
Ethan Jackson
ethan at nicira.com
Sat Mar 31 01:30:59 PDT 2012
Is there any reason we can't simply ignore the CFI bit? Something like the
following? I'm having trouble working out exactly how the CFI bit in OpenFlow
matches interacts with the various versions and the classifier.
Ethan
---
lib/ofp-util.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/lib/ofp-util.c b/lib/ofp-util.c
index 90475f7..9c29eb2 100644
--- a/lib/ofp-util.c
+++ b/lib/ofp-util.c
@@ -1165,6 +1165,7 @@ enum ofputil_protocol
ofputil_usable_protocols(const struct cls_rule *rule)
{
const struct flow_wildcards *wc = &rule->wc;
+ uint16_t vlan_tci_mask = ntohs(wc->vlan_tci_mask);
BUILD_ASSERT_DECL(FLOW_WC_SEQ == 9);
@@ -1214,6 +1215,14 @@ ofputil_usable_protocols(const struct cls_rule *rule)
return OFPUTIL_P_NXM_ANY;
}
+ /* Only NXM supports arbitrary masking of vlan_tci. */
+ if ((vlan_tci_mask & VLAN_PCP_MASK
+ && (vlan_tci_mask & VLAN_PCP_MASK) != VLAN_PCP_MASK)
+ || (vlan_tci_mask & VLAN_VID_MASK
+ && (vlan_tci_mask & VLAN_VID_MASK) != VLAN_VID_MASK)) {
+ return OFPUTIL_P_NXM_ANY;
+ }
+
/* Only NXM supports bitwise matching on transport port. */
if ((wc->tp_src_mask && wc->tp_src_mask != htons(UINT16_MAX)) ||
(wc->tp_dst_mask && wc->tp_dst_mask != htons(UINT16_MAX))) {
--
1.7.9.4
More information about the dev
mailing list