From: Ben Pfaff Date: Mon, 18 Jun 2012 22:46:13 +0000 (-0700) Subject: flow: Remove flow_wildcards_is_exact(). X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e7b4ef5eacebe5d5cae85c0076960f276b16554c;p=openvswitch flow: Remove flow_wildcards_is_exact(). 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 --- diff --git a/lib/flow.c b/lib/flow.c index 784edc67..5dcc08b1 100644 --- a/lib/flow.c +++ b/lib/flow.c @@ -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 diff --git a/lib/flow.h b/lib/flow.h index d12a62bf..0ed65d2e 100644 --- a/lib/flow.h +++ b/lib/flow.h @@ -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 *, diff --git a/tests/test-classifier.c b/tests/test-classifier.c index ae1d81f2..d4a524d3 100644 --- a/tests/test-classifier.c +++ b/tests/test-classifier.c @@ -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)) {