1 /* SPDX-License-Identifier: GPL-2.0 */ 1 /* SPDX-License-Identifier: GPL-2.0 */ 2 #ifndef __NET_NS_HASH_H__ 2 #ifndef __NET_NS_HASH_H__ 3 #define __NET_NS_HASH_H__ 3 #define __NET_NS_HASH_H__ 4 4 5 #include <net/net_namespace.h> !! 5 #include <asm/cache.h> >> 6 >> 7 struct net; 6 8 7 static inline u32 net_hash_mix(const struct ne 9 static inline u32 net_hash_mix(const struct net *net) 8 { 10 { 9 return net->hash_mix; !! 11 #ifdef CONFIG_NET_NS >> 12 /* >> 13 * shift this right to eliminate bits, that are >> 14 * always zeroed >> 15 */ >> 16 >> 17 return (u32)(((unsigned long)net) >> L1_CACHE_SHIFT); >> 18 #else >> 19 return 0; >> 20 #endif 10 } 21 } 11 #endif 22 #endif 12 23
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.