[ovs-dev,2/4] odp-util: Expose ovs flow key attr len table for reuse

Submitted by Roi Dayan on Aug. 8, 2017, 2:21 p.m.

Details

Message ID 1502202114-57266-3-git-send-email-roid@mellanox.com
State New
Headers show

Commit Message

Roi Dayan Aug. 8, 2017, 2:21 p.m.
From: Paul Blakey <paulb@mellanox.com>

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>
---
 lib/odp-util.c | 11 +----------
 lib/odp-util.h | 11 +++++++++++
 2 files changed, 12 insertions(+), 10 deletions(-)

Patch hide | download patch | download mbox

diff --git a/lib/odp-util.c b/lib/odp-util.c
index ef8b39d..a782565 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,
@@ -2198,7 +2189,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 27c2ab4..72a3c30 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 */