summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Blakey <paulb@mellanox.com>2017-09-18 07:16:02 +0300
committerSimon Horman <simon.horman@netronome.com>2017-11-16 08:03:16 -0800
commit0aee3827559b384114249901f4a51d8fbbc47dfa (patch)
tree45c05159b09a68607af3d7d0b07c1203b3844d6f
parente5b1657e6f67a28c36d3d22bbe758d451f99ec1f (diff)
downloadopenvswitch-0aee3827559b384114249901f4a51d8fbbc47dfa.tar.gz
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 <paulb@mellanox.com> Reviewed-by: Roi Dayan <roid@mellanox.com> Signed-off-by: Simon Horman <simon.horman@netronome.com>
-rw-r--r--lib/odp-util.c11
-rw-r--r--lib/odp-util.h11
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 */