From 0aee3827559b384114249901f4a51d8fbbc47dfa Mon Sep 17 00:00:00 2001 From: Paul Blakey Date: Mon, 18 Sep 2017 07:16:02 +0300 Subject: [PATCH] odp-util: Expose ovs flow key attr len table for reuse Make ovs_flow_key_attr_lens() public to be reused by other modules. Signed-off-by: Paul Blakey Reviewed-by: Roi Dayan Signed-off-by: Simon Horman --- lib/odp-util.c | 11 +---------- lib/odp-util.h | 11 +++++++++++ 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/lib/odp-util.c b/lib/odp-util.c index d8daedea7..b348ab680 100644 --- a/lib/odp-util.c +++ b/lib/odp-util.c @@ -56,15 +56,6 @@ VLOG_DEFINE_THIS_MODULE(odp_util); static const char *delimiters = ", \t\r\n"; static const char *delimiters_end = ", \t\r\n)"; -struct attr_len_tbl { - int len; - const struct attr_len_tbl *next; - int next_max; -}; -#define ATTR_LEN_INVALID -1 -#define ATTR_LEN_VARIABLE -2 -#define ATTR_LEN_NESTED -3 - static int parse_odp_key_mask_attr(const char *, const struct simap *port_names, struct ofpbuf *, struct ofpbuf *); static void format_odp_key_attr(const struct nlattr *a, @@ -2212,7 +2203,7 @@ static const struct attr_len_tbl ovs_tun_key_attr_lens[OVS_TUNNEL_KEY_ATTR_MAX + [OVS_TUNNEL_KEY_ATTR_IPV6_DST] = { .len = 16 }, }; -static const struct attr_len_tbl ovs_flow_key_attr_lens[OVS_KEY_ATTR_MAX + 1] = { +const struct attr_len_tbl ovs_flow_key_attr_lens[OVS_KEY_ATTR_MAX + 1] = { [OVS_KEY_ATTR_ENCAP] = { .len = ATTR_LEN_NESTED }, [OVS_KEY_ATTR_PRIORITY] = { .len = 4 }, [OVS_KEY_ATTR_SKB_MARK] = { .len = 4 }, diff --git a/lib/odp-util.h b/lib/odp-util.h index 27c2ab4f0..72a3c30d6 100644 --- a/lib/odp-util.h +++ b/lib/odp-util.h @@ -344,4 +344,15 @@ void odp_put_push_eth_action(struct ofpbuf *odp_actions, const struct eth_addr *eth_src, const struct eth_addr *eth_dst); +struct attr_len_tbl { + int len; + const struct attr_len_tbl *next; + int next_max; +}; + +#define ATTR_LEN_INVALID -1 +#define ATTR_LEN_VARIABLE -2 +#define ATTR_LEN_NESTED -3 + +extern const struct attr_len_tbl ovs_flow_key_attr_lens[OVS_KEY_ATTR_MAX + 1]; #endif /* odp-util.h */ -- 2.39.5