From: Jesse Gross Date: Tue, 9 Jun 2015 17:29:43 +0000 (-0700) Subject: odp-util: Remove last use of odp_tun_key_from_attr for formatting. X-Git-Tag: v2.4.0~107 X-Git-Url: http://git.cascardo.eti.br/?a=commitdiff_plain;h=48954dab23eecfe895d7cb34c26587f400297618;p=cascardo%2Fovs.git odp-util: Remove last use of odp_tun_key_from_attr for formatting. We formerly converted tunnel attributes to their flow representation before formatting but now perform all operations directly on the netlink attributes. There is one remaining use of odp_tun_key_from_attr() that is not used for the purposes of generating a flow. This is to check the mask but this no longer makes sense given the way that we format the flow itself. In fact, the code is not actually invoked any more, so we can simply remove it. This retains the special case for tunnels as a safety measure but it should not matter in practice. Signed-off-by: Jesse Gross Acked-by: Ben Pfaff --- diff --git a/lib/odp-util.c b/lib/odp-util.c index f99683a24..76dc44bae 100644 --- a/lib/odp-util.c +++ b/lib/odp-util.c @@ -1520,18 +1520,7 @@ odp_mask_is_exact(enum ovs_key_attr attr, const void *mask, size_t size) && ipv6_mask_is_exact((const struct in6_addr *)ipv6_mask->ipv6_dst); } if (attr == OVS_KEY_ATTR_TUNNEL) { - const struct flow_tnl *tun_mask = mask; - - return tun_mask->flags == FLOW_TNL_F_MASK - && tun_mask->tun_id == OVS_BE64_MAX - && tun_mask->ip_src == OVS_BE32_MAX - && tun_mask->ip_dst == OVS_BE32_MAX - && tun_mask->ip_tos == UINT8_MAX - && tun_mask->ip_ttl == UINT8_MAX - && tun_mask->tp_src == OVS_BE16_MAX - && tun_mask->tp_dst == OVS_BE16_MAX - && tun_mask->gbp_id == OVS_BE16_MAX - && tun_mask->gbp_flags == UINT8_MAX; + return false; } if (attr == OVS_KEY_ATTR_ARP) { @@ -1548,16 +1537,12 @@ odp_mask_is_exact(enum ovs_key_attr attr, const void *mask, size_t size) static bool odp_mask_attr_is_exact(const struct nlattr *ma) { - struct flow_tnl tun_mask; enum ovs_key_attr attr = nl_attr_type(ma); const void *mask; size_t size; if (attr == OVS_KEY_ATTR_TUNNEL) { - memset(&tun_mask, 0, sizeof tun_mask); - odp_tun_key_from_attr(ma, &tun_mask); - mask = &tun_mask; - size = sizeof tun_mask; + return false; } else { mask = nl_attr_get(ma); size = nl_attr_get_size(ma);