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