mirror of
				git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
				synced 2025-10-31 16:54:21 +00:00 
			
		
		
		
	net: ethernet: ti: cpsw: fix vlan configuration while down/up
The vlan configuration is not restored after interface donw/up sequence (if dual-emac - both interfaces). Tested on am572x EVM. Steps to check: ~# ip link add link eth1 name eth1.100 type vlan id 100 ~# ifconfig eth0 down ~# ifconfig eth1 down Try to remove vid and observe warning: ~# ip link del eth1.100 [ 739.526757] net eth1: removing vlanid 100 from vlan filter [ 739.533322] failed to kill vid 0081/100 for device eth1 This patch fixes it, restoring only vlan ALE entries and all other unicast/multicast entries are restored by system calling rx_mode ndo. Reviewed-by: Grygorii Strashko <grygorii.strashko@ti.com> Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
		
							parent
							
								
									15180eca56
								
							
						
					
					
						commit
						00fe471205
					
				
					 1 changed files with 17 additions and 0 deletions
				
			
		|  | @ -565,6 +565,9 @@ static const struct cpsw_stats cpsw_gstrings_ch_stats[] = { | ||||||
| 				(func)(slave++, ##arg);			\ | 				(func)(slave++, ##arg);			\ | ||||||
| 	} while (0) | 	} while (0) | ||||||
| 
 | 
 | ||||||
|  | static int cpsw_ndo_vlan_rx_add_vid(struct net_device *ndev, | ||||||
|  | 				    __be16 proto, u16 vid); | ||||||
|  | 
 | ||||||
| static inline int cpsw_get_slave_port(u32 slave_num) | static inline int cpsw_get_slave_port(u32 slave_num) | ||||||
| { | { | ||||||
| 	return slave_num + 1; | 	return slave_num + 1; | ||||||
|  | @ -1951,9 +1954,23 @@ static void cpsw_mqprio_resume(struct cpsw_slave *slave, struct cpsw_priv *priv) | ||||||
| 	slave_write(slave, tx_prio_map, tx_prio_rg); | 	slave_write(slave, tx_prio_map, tx_prio_rg); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | static int cpsw_restore_vlans(struct net_device *vdev, int vid, void *arg) | ||||||
|  | { | ||||||
|  | 	struct cpsw_priv *priv = arg; | ||||||
|  | 
 | ||||||
|  | 	if (!vdev) | ||||||
|  | 		return 0; | ||||||
|  | 
 | ||||||
|  | 	cpsw_ndo_vlan_rx_add_vid(priv->ndev, 0, vid); | ||||||
|  | 	return 0; | ||||||
|  | } | ||||||
|  | 
 | ||||||
| /* restore resources after port reset */ | /* restore resources after port reset */ | ||||||
| static void cpsw_restore(struct cpsw_priv *priv) | static void cpsw_restore(struct cpsw_priv *priv) | ||||||
| { | { | ||||||
|  | 	/* restore vlan configurations */ | ||||||
|  | 	vlan_for_each(priv->ndev, cpsw_restore_vlans, priv); | ||||||
|  | 
 | ||||||
| 	/* restore MQPRIO offload */ | 	/* restore MQPRIO offload */ | ||||||
| 	for_each_slave(priv, cpsw_mqprio_resume, priv); | 	for_each_slave(priv, cpsw_mqprio_resume, priv); | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		
		Reference in a new issue
	
	 Ivan Khoronzhuk
						Ivan Khoronzhuk