summaryrefslogtreecommitdiff
path: root/libdde-linux26/contrib/include/net/netns/hash.h
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2013-07-27 22:15:01 +0000
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2013-07-27 22:15:01 +0000
commit7996a3d79d55b7f879dfd62e202bbfe2963718d3 (patch)
tree8d9f6759fec4099b9be503c11c7ed174f7204980 /libdde-linux26/contrib/include/net/netns/hash.h
parent4fbe7358c7747a9165f776eb19addbb9baf7def2 (diff)
really properly move files
Diffstat (limited to 'libdde-linux26/contrib/include/net/netns/hash.h')
-rw-r--r--libdde-linux26/contrib/include/net/netns/hash.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/libdde-linux26/contrib/include/net/netns/hash.h b/libdde-linux26/contrib/include/net/netns/hash.h
new file mode 100644
index 00000000..548d78f2
--- /dev/null
+++ b/libdde-linux26/contrib/include/net/netns/hash.h
@@ -0,0 +1,21 @@
+#ifndef __NET_NS_HASH_H__
+#define __NET_NS_HASH_H__
+
+#include <asm/cache.h>
+
+struct net;
+
+static inline unsigned net_hash_mix(struct net *net)
+{
+#ifdef CONFIG_NET_NS
+ /*
+ * shift this right to eliminate bits, that are
+ * always zeroed
+ */
+
+ return (unsigned)(((unsigned long)net) >> L1_CACHE_SHIFT);
+#else
+ return 0;
+#endif
+}
+#endif