Loading...
1#ifndef __NET_NS_HASH_H__
2#define __NET_NS_HASH_H__
3
4#include <asm/cache.h>
5
6struct net;
7
8static inline unsigned net_hash_mix(struct net *net)
9{
10#ifdef CONFIG_NET_NS
11 /*
12 * shift this right to eliminate bits, that are
13 * always zeroed
14 */
15
16 return (unsigned)(((unsigned long)net) >> L1_CACHE_SHIFT);
17#else
18 return 0;
19#endif
20}
21#endif
1/* SPDX-License-Identifier: GPL-2.0 */
2#ifndef __NET_NS_HASH_H__
3#define __NET_NS_HASH_H__
4
5#include <asm/cache.h>
6
7struct net;
8
9static inline u32 net_hash_mix(const struct net *net)
10{
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
21}
22#endif