summaryrefslogtreecommitdiff
path: root/datapath/linux
diff options
context:
space:
mode:
authorPravin Shelar <pshelar@nicira.com>2011-09-09 19:09:47 -0700
committerPravin Shelar <pshelar@nicira.com>2011-09-09 19:09:47 -0700
commit3544358aa5960b148bc31435a0062e9392530ec2 (patch)
treeaf87a0e875081e2222fefd6e92ad1deb55be2fc7 /datapath/linux
parentd9065a90b6b955aa38586c952e8804ca7a22547e (diff)
downloadopenvswitch-3544358aa5960b148bc31435a0062e9392530ec2.tar.gz
datapath: Improve kernel hash table
Currently OVS uses its own hashing implmentation for hash tables which has some problems, e.g. error case on deletion code. Following patch replaces that with hlist based hash table which is consistent with other kernel hash tables. As Jesse suggested, flex-array is used for allocating hash buckets, So that we can have large hash-table without large contiguous kernel memory. Signed-off-by: Pravin B Shelar <pshelar@nicira.com> Acked-by: Jesse Gross <jesse@nicira.com>
Diffstat (limited to 'datapath/linux')
-rw-r--r--datapath/linux/compat/include/linux/rculist.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/datapath/linux/compat/include/linux/rculist.h b/datapath/linux/compat/include/linux/rculist.h
index 4164c0e99..64e390591 100644
--- a/datapath/linux/compat/include/linux/rculist.h
+++ b/datapath/linux/compat/include/linux/rculist.h
@@ -9,4 +9,15 @@
#include <linux/list.h>
#endif
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27)
+#define hlist_del_init_rcu rpl_hlist_del_init_rcu
+static inline void hlist_del_init_rcu(struct hlist_node *n)
+{
+ if (!hlist_unhashed(n)) {
+ __hlist_del(n);
+ n->pprev = NULL;
+ }
+}
+#endif
+
#endif