blob: 69a6715d9f3fd16c9a6e90f9be403ba0cba1f022 [file] [log] [blame]
Pavel Emelyanov0b441912008-06-16 17:14:11 -07001#ifndef __NET_NS_HASH_H__
2#define __NET_NS_HASH_H__
3
4#include <asm/cache.h>
5
6struct net;
7
Eric Dumazet6eada012015-03-18 14:05:33 -07008static inline u32 net_hash_mix(const struct net *net)
Pavel Emelyanov0b441912008-06-16 17:14:11 -07009{
10#ifdef CONFIG_NET_NS
11 /*
12 * shift this right to eliminate bits, that are
13 * always zeroed
14 */
15
Eric Dumazet6eada012015-03-18 14:05:33 -070016 return (u32)(((unsigned long)net) >> L1_CACHE_SHIFT);
Pavel Emelyanov0b441912008-06-16 17:14:11 -070017#else
18 return 0;
19#endif
20}
21#endif