flow: Remove flow_wildcards_is_exact().
authorBen Pfaff <blp@nicira.com>
Mon, 18 Jun 2012 22:46:13 +0000 (15:46 -0700)
committerBen Pfaff <blp@nicira.com>
Tue, 4 Sep 2012 18:19:16 +0000 (11:19 -0700)
It's only used in a not-very-useful assertion in some test code.  In
general, exact-match flows make very little sense anymore, and they're
basically on their way out.

Signed-off-by: Ben Pfaff <blp@nicira.com>
lib/flow.c
lib/flow.h
tests/test-classifier.c

index 784edc6..5dcc08b 100644 (file)
@@ -627,48 +627,6 @@ flow_wildcards_init_exact(struct flow_wildcards *wc)
     memset(wc->masks.zeros, 0, sizeof wc->masks.zeros);
 }
 
-/* Returns true if 'wc' is exact-match, false if 'wc' wildcards any bits or
- * fields. */
-bool
-flow_wildcards_is_exact(const struct flow_wildcards *wc)
-{
-    int i;
-
-    BUILD_ASSERT_DECL(FLOW_WC_SEQ == 17);
-
-    if (wc->masks.tun_id != htonll(UINT64_MAX)
-        || wc->masks.nw_src != htonl(UINT32_MAX)
-        || wc->masks.nw_dst != htonl(UINT32_MAX)
-        || wc->masks.tp_src != htons(UINT16_MAX)
-        || wc->masks.tp_dst != htons(UINT16_MAX)
-        || wc->masks.in_port != UINT16_MAX
-        || wc->masks.vlan_tci != htons(UINT16_MAX)
-        || wc->masks.metadata != htonll(UINT64_MAX)
-        || wc->masks.dl_type != htons(UINT16_MAX)
-        || !eth_mask_is_exact(wc->masks.dl_src)
-        || !eth_mask_is_exact(wc->masks.dl_dst)
-        || !eth_mask_is_exact(wc->masks.arp_sha)
-        || !eth_mask_is_exact(wc->masks.arp_tha)
-        || !ipv6_mask_is_exact(&wc->masks.ipv6_src)
-        || !ipv6_mask_is_exact(&wc->masks.ipv6_dst)
-        || wc->masks.ipv6_label != htonl(UINT32_MAX)
-        || !ipv6_mask_is_exact(&wc->masks.nd_target)
-        || wc->masks.nw_proto != UINT8_MAX
-        || wc->masks.nw_frag != UINT8_MAX
-        || wc->masks.nw_tos != UINT8_MAX
-        || wc->masks.nw_ttl != UINT8_MAX) {
-        return false;
-    }
-
-    for (i = 0; i < FLOW_N_REGS; i++) {
-        if (wc->masks.regs[i] != UINT32_MAX) {
-            return false;
-        }
-    }
-
-    return true;
-}
-
 /* Returns true if 'wc' matches every packet, false if 'wc' fixes any bits or
  * fields. */
 bool
index d12a62b..0ed65d2 100644 (file)
@@ -138,7 +138,6 @@ struct flow_wildcards {
 void flow_wildcards_init_catchall(struct flow_wildcards *);
 void flow_wildcards_init_exact(struct flow_wildcards *);
 
-bool flow_wildcards_is_exact(const struct flow_wildcards *);
 bool flow_wildcards_is_catchall(const struct flow_wildcards *);
 
 void flow_wildcards_set_reg_mask(struct flow_wildcards *,
index ae1d81f..d4a524d 100644 (file)
@@ -134,8 +134,6 @@ tcls_insert(struct tcls *tcls, const struct test_rule *rule)
 {
     size_t i;
 
-    assert(!flow_wildcards_is_exact(&rule->cls_rule.wc)
-           || rule->cls_rule.priority == UINT_MAX);
     for (i = 0; i < tcls->n_rules; i++) {
         const struct cls_rule *pos = &tcls->rules[i]->cls_rule;
         if (cls_rule_equal(pos, &rule->cls_rule)) {