hash.h 332 B

12345678910111213141516171819202122
  1. #ifndef __NET_NS_HASH_H__
  2. #define __NET_NS_HASH_H__
  3. #include <asm/cache.h>
  4. struct net;
  5. static inline u32 net_hash_mix(const struct net *net)
  6. {
  7. #ifdef CONFIG_NET_NS
  8. /*
  9. * shift this right to eliminate bits, that are
  10. * always zeroed
  11. */
  12. return (u32)(((unsigned long)net) >> L1_CACHE_SHIFT);
  13. #else
  14. return 0;
  15. #endif
  16. }
  17. #endif