[PATCH 0/6] Add hash support to libnl caches

roopa at cumulusnetworks.com roopa at cumulusnetworks.com
Mon Nov 5 00:13:00 EST 2012


From: roopa <roopa at cumulusnetworks.com>

[Resending patches previously submitted at
http://lists.infradead.org/pipermail/libnl/2012-November/000718.html]

This patch series adds hash lookup functionality for libnl caches.
In our tests we have found that the current linear search for libnl
cache objects does not scale well.

The current list representation continues to exist.
Hash support requires each object type to define a keygen operation
to generate the hash key. The hash is allocated at cache creation time.
If the cache object type does not support the keygen op, hash table is
not created for that cache.

This series adds keygen functions to link, neigh and route objects.

Note: Could not really verify if the documentation built correctly.
Can fix if there are problems.

Signed-off-by: Shrijeet Mukherjee <shm at cumulusnetworks.com>
Signed-off-by: Nolan Leake <nolan at cumulusnetworks.com>
Signed-off-by: Roopa Prabhu <roopa at cumulusnetworks.com>
Reviewed-by: Wilson Kok <wkok at cumulusnetworks.com>

roopa (6):
  Add hash function
  Add nl hashtable structures and access functions
  Add hash support in cache mngr
  Add hash support to link cache
  Add hash support to neigh cache
  Add hash support to route cache

 include/netlink-types.h      |    2 +
 include/netlink/cache-api.h  |    3 +
 include/netlink/cache.h      |    2 +
 include/netlink/hash.h       |   69 ++++++
 include/netlink/hashtable.h  |   53 +++++
 include/netlink/object-api.h |    9 +
 include/netlink/object.h     |    2 +
 include/netlink/route/link.h |    2 +
 lib/Makefile.am              |    2 +-
 lib/cache.c                  |   86 +++++++-
 lib/hash.c                   |  482 ++++++++++++++++++++++++++++++++++++++++++
 lib/hashtable.c              |  141 ++++++++++++
 lib/object.c                 |   21 ++
 lib/route/link.c             |   34 +++
 lib/route/neigh.c            |   50 +++++
 lib/route/route_obj.c        |   55 +++++
 16 files changed, 1009 insertions(+), 4 deletions(-)
 create mode 100644 include/netlink/hash.h
 create mode 100644 include/netlink/hashtable.h
 create mode 100644 lib/hash.c
 create mode 100644 lib/hashtable.c

-- 
1.7.2.5




More information about the libnl mailing list