[ovs-dev] [no-slow 1/6] ofproto-dpif: Add ability to look up an ofproto by UUID.

Ben Pfaff blp at ovn.org
Wed Jan 3 23:31:09 UTC 2018


On Tue, Jan 02, 2018 at 10:24:21AM -0800, Justin Pettit wrote:
> 
> 
> > On Jan 2, 2018, at 8:40 AM, Ben Pfaff <blp at ovn.org> wrote:
> > 
> > On Thu, Dec 21, 2017 at 02:25:10PM -0800, Justin Pettit wrote:
> >> This will have callers in the future.
> >> 
> >> Signed-off-by: Justin Pettit <jpettit at ovn.org>
> > 
> > The new comment in struct ofproto_dpif only refers to one of the
> > hmap_nodes.
> > 
> > Acked-by: Ben Pfaff <blp at ovn.org>
> 
> Thanks.  I added a comment.

I took a second look and noticed that all_ofproto_dpifs_by_* could be
static:

diff --git a/ofproto/ofproto-dpif.c b/ofproto/ofproto-dpif.c
index ab70244396bf..561430c51141 100644
--- a/ofproto/ofproto-dpif.c
+++ b/ofproto/ofproto-dpif.c
@@ -186,11 +186,11 @@ COVERAGE_DEFINE(rev_mcast_snooping);
 struct shash all_dpif_backers = SHASH_INITIALIZER(&all_dpif_backers);
 
 /* All existing ofproto_dpif instances, indexed by ->up.name. */
-struct hmap all_ofproto_dpifs_by_name =
+static struct hmap all_ofproto_dpifs_by_name =
                           HMAP_INITIALIZER(&all_ofproto_dpifs_by_name);
 
 /* All existing ofproto_dpif instances, indexed by ->uuid. */
-struct hmap all_ofproto_dpifs_by_uuid =
+static struct hmap all_ofproto_dpifs_by_uuid =
                           HMAP_INITIALIZER(&all_ofproto_dpifs_by_uuid);
 
 static bool ofproto_use_tnl_push_pop = true;
diff --git a/ofproto/ofproto-dpif.h b/ofproto/ofproto-dpif.h
index 0f7086824f3d..ca7b38b10d19 100644
--- a/ofproto/ofproto-dpif.h
+++ b/ofproto/ofproto-dpif.h
@@ -310,12 +310,7 @@ struct ofproto_dpif {
     uint64_t ams_seqno;
 };
 
-/* All existing ofproto_dpif instances, indexed by ->up.name. */
-extern struct hmap all_ofproto_dpifs_by_name;
 struct ofproto_dpif *ofproto_dpif_lookup_by_name(const char *name);
-
-/* All existing ofproto_dpif instances, indexed by ->uuid. */
-extern struct hmap all_ofproto_dpifs_by_uuid;
 struct ofproto_dpif *ofproto_dpif_lookup_by_uuid(const struct uuid *uuid);
 
 ovs_version_t ofproto_dpif_get_tables_version(struct ofproto_dpif *);



More information about the dev mailing list