| 
									
										
										
										
											2008-06-16 17:14:11 -07:00
										 |  |  | #ifndef __NET_NS_HASH_H__
 | 
					
						
							|  |  |  | #define __NET_NS_HASH_H__
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #include <asm/cache.h>
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | struct net; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-04-15 05:58:06 +00:00
										 |  |  | static inline unsigned int net_hash_mix(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 | 
					
						
							|  |  |  | 	 */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	return (unsigned)(((unsigned long)net) >> L1_CACHE_SHIFT); | 
					
						
							|  |  |  | #else
 | 
					
						
							|  |  |  | 	return 0; | 
					
						
							|  |  |  | #endif
 | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | #endif
 |