[ovs-dev] [PATCH v12 2/8] odp-util: Export odp_tun_key_from_attr()

Simon Horman horms at verge.net.au
Wed Jun 5 05:28:48 UTC 2013


Rename tun_key_from_attr() as odp_tun_key_from_attr() and export it.
This is in preparation for calling this function outside of odp-util.c.

Signed-off-by: Simon Horman <horms at verge.net.au>

---

v12
* First post
---
 lib/odp-util.c | 8 ++++----
 lib/odp-util.h | 3 +++
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/lib/odp-util.c b/lib/odp-util.c
index 1c48e7b..1c88165 100644
--- a/lib/odp-util.c
+++ b/lib/odp-util.c
@@ -786,8 +786,8 @@ tunnel_key_attr_len(int type)
     return -1;
 }
 
-static enum odp_key_fitness
-tun_key_from_attr(const struct nlattr *attr, struct flow_tnl *tun)
+enum odp_key_fitness
+odp_tun_key_from_attr(const struct nlattr *attr, struct flow_tnl *tun)
 {
     unsigned int left;
     const struct nlattr *a;
@@ -919,7 +919,7 @@ format_odp_key_attr(const struct nlattr *a, struct ds *ds)
 
     case OVS_KEY_ATTR_TUNNEL:
         memset(&tun_key, 0, sizeof tun_key);
-        if (tun_key_from_attr(a, &tun_key) == ODP_FIT_ERROR) {
+        if (odp_tun_key_from_attr(a, &tun_key) == ODP_FIT_ERROR) {
             ds_put_format(ds, "(error)");
         } else {
             ds_put_format(ds, "(tun_id=0x%"PRIx64",src="IP_FMT",dst="IP_FMT","
@@ -2089,7 +2089,7 @@ odp_flow_key_to_flow(const struct nlattr *key, size_t key_len,
     if (present_attrs & (UINT64_C(1) << OVS_KEY_ATTR_TUNNEL)) {
         enum odp_key_fitness res;
 
-        res = tun_key_from_attr(attrs[OVS_KEY_ATTR_TUNNEL], &flow->tunnel);
+        res = odp_tun_key_from_attr(attrs[OVS_KEY_ATTR_TUNNEL], &flow->tunnel);
         if (res == ODP_FIT_ERROR) {
             return ODP_FIT_ERROR;
         } else if (res == ODP_FIT_PERFECT) {
diff --git a/lib/odp-util.h b/lib/odp-util.h
index 0455370..6213418 100644
--- a/lib/odp-util.h
+++ b/lib/odp-util.h
@@ -87,6 +87,9 @@ struct odputil_keybuf {
     uint32_t keybuf[DIV_ROUND_UP(ODPUTIL_FLOW_KEY_BYTES, 4)];
 };
 
+enum odp_key_fitness odp_tun_key_from_attr(const struct nlattr *,
+                                           struct flow_tnl *);
+
 void odp_flow_key_format(const struct nlattr *, size_t, struct ds *);
 int odp_flow_key_from_string(const char *s, const struct simap *port_names,
                              struct ofpbuf *);
-- 
1.8.2.1




More information about the dev mailing list