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