2008-06-17 04:14:11 +04:00
|
|
|
#ifndef __NET_NS_HASH_H__
|
|
|
|
#define __NET_NS_HASH_H__
|
|
|
|
|
|
|
|
#include <asm/cache.h>
|
|
|
|
|
|
|
|
struct net;
|
|
|
|
|
2015-03-19 00:05:33 +03:00
|
|
|
static inline u32 net_hash_mix(const struct net *net)
|
2008-06-17 04:14:11 +04:00
|
|
|
{
|
|
|
|
#ifdef CONFIG_NET_NS
|
|
|
|
/*
|
|
|
|
* shift this right to eliminate bits, that are
|
|
|
|
* always zeroed
|
|
|
|
*/
|
|
|
|
|
2015-03-19 00:05:33 +03:00
|
|
|
return (u32)(((unsigned long)net) >> L1_CACHE_SHIFT);
|
2008-06-17 04:14:11 +04:00
|
|
|
#else
|
|
|
|
return 0;
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
#endif
|