forked from mirrors/linux
		
	net: add a comment on netdev->last_rx
As some driver authors seem to reintroduce dev->last_rx use,
add a comment to strongly discourage this.
Since commit 6cf3f41e6c (bonding, net: Move last_rx update into bonding
recv logic), network drivers dont need to update last_rx themselves,
unless they use this field to implement a timeout.
Not updating last_rx helps not dirtying a cache line, improving
performance in SMP.
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
			
			
This commit is contained in:
		
							parent
							
								
									ba4fd9d828
								
							
						
					
					
						commit
						4dc89133f4
					
				
					 1 changed files with 8 additions and 1 deletions
				
			
		| 
						 | 
					@ -953,7 +953,14 @@ struct net_device {
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
 * Cache line mostly used on receive path (including eth_type_trans())
 | 
					 * Cache line mostly used on receive path (including eth_type_trans())
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
	unsigned long		last_rx;	/* Time of last Rx	*/
 | 
						unsigned long		last_rx;	/* Time of last Rx
 | 
				
			||||||
 | 
											 * This should not be set in
 | 
				
			||||||
 | 
											 * drivers, unless really needed,
 | 
				
			||||||
 | 
											 * because network stack (bonding)
 | 
				
			||||||
 | 
											 * use it if/when necessary, to
 | 
				
			||||||
 | 
											 * avoid dirtying this cache line.
 | 
				
			||||||
 | 
											 */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	/* Interface address info used in eth_type_trans() */
 | 
						/* Interface address info used in eth_type_trans() */
 | 
				
			||||||
	unsigned char		*dev_addr;	/* hw address, (before bcast
 | 
						unsigned char		*dev_addr;	/* hw address, (before bcast
 | 
				
			||||||
						   because most packets are
 | 
											   because most packets are
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue