@@ -1574,7 +1574,7 @@ static int mlxsw_sp_port_kill_vid(struct net_device *dev,
1574
1574
*/
1575
1575
f = mlxsw_sp_vport_fid_get (mlxsw_sp_vport );
1576
1576
if (f && !WARN_ON (!f -> leave ))
1577
- f -> leave (mlxsw_sp_vport );
1577
+ f -> leave (mlxsw_sp_port_vlan );
1578
1578
1579
1579
mlxsw_sp_port_vport_destroy (mlxsw_sp_vport );
1580
1580
@@ -4192,19 +4192,21 @@ static void
4192
4192
mlxsw_sp_port_pvid_vport_lag_join (struct mlxsw_sp_port * mlxsw_sp_port ,
4193
4193
struct net_device * lag_dev , u16 lag_id )
4194
4194
{
4195
+ struct mlxsw_sp_port_vlan * mlxsw_sp_port_vlan ;
4195
4196
struct mlxsw_sp_port * mlxsw_sp_vport ;
4196
4197
struct mlxsw_sp_fid * f ;
4197
4198
4198
4199
mlxsw_sp_vport = mlxsw_sp_port_vport_find (mlxsw_sp_port , 1 );
4199
4200
if (WARN_ON (!mlxsw_sp_vport ))
4200
4201
return ;
4201
4202
4203
+ mlxsw_sp_port_vlan = mlxsw_sp_port_vlan_find_by_vid (mlxsw_sp_port , 1 );
4202
4204
/* If vPort is assigned a RIF, then leave it since it's no
4203
4205
* longer valid.
4204
4206
*/
4205
4207
f = mlxsw_sp_vport_fid_get (mlxsw_sp_vport );
4206
4208
if (f )
4207
- f -> leave (mlxsw_sp_vport );
4209
+ f -> leave (mlxsw_sp_port_vlan );
4208
4210
4209
4211
mlxsw_sp_vport -> lag_id = lag_id ;
4210
4212
mlxsw_sp_vport -> lagged = 1 ;
@@ -4214,16 +4216,18 @@ mlxsw_sp_port_pvid_vport_lag_join(struct mlxsw_sp_port *mlxsw_sp_port,
4214
4216
static void
4215
4217
mlxsw_sp_port_pvid_vport_lag_leave (struct mlxsw_sp_port * mlxsw_sp_port )
4216
4218
{
4219
+ struct mlxsw_sp_port_vlan * mlxsw_sp_port_vlan ;
4217
4220
struct mlxsw_sp_port * mlxsw_sp_vport ;
4218
4221
struct mlxsw_sp_fid * f ;
4219
4222
4220
4223
mlxsw_sp_vport = mlxsw_sp_port_vport_find (mlxsw_sp_port , 1 );
4221
4224
if (WARN_ON (!mlxsw_sp_vport ))
4222
4225
return ;
4223
4226
4227
+ mlxsw_sp_port_vlan = mlxsw_sp_port_vlan_find_by_vid (mlxsw_sp_port , 1 );
4224
4228
f = mlxsw_sp_vport_fid_get (mlxsw_sp_vport );
4225
4229
if (f )
4226
- f -> leave (mlxsw_sp_vport );
4230
+ f -> leave (mlxsw_sp_port_vlan );
4227
4231
4228
4232
mlxsw_sp_vport -> dev = mlxsw_sp_port -> dev ;
4229
4233
mlxsw_sp_vport -> lagged = 0 ;
@@ -4652,7 +4656,8 @@ static int mlxsw_sp_vfid_op(struct mlxsw_sp *mlxsw_sp, u16 fid, bool create)
4652
4656
return mlxsw_reg_write (mlxsw_sp -> core , MLXSW_REG (sfmr ), sfmr_pl );
4653
4657
}
4654
4658
4655
- static void mlxsw_sp_vport_vfid_leave (struct mlxsw_sp_port * mlxsw_sp_vport );
4659
+ static void
4660
+ mlxsw_sp_port_vlan_vfid_leave (struct mlxsw_sp_port_vlan * mlxsw_sp_port_vlan );
4656
4661
4657
4662
static struct mlxsw_sp_fid * mlxsw_sp_vfid_create (struct mlxsw_sp * mlxsw_sp ,
4658
4663
struct net_device * br_dev )
@@ -4679,7 +4684,7 @@ static struct mlxsw_sp_fid *mlxsw_sp_vfid_create(struct mlxsw_sp *mlxsw_sp,
4679
4684
if (!f )
4680
4685
goto err_allocate_vfid ;
4681
4686
4682
- f -> leave = mlxsw_sp_vport_vfid_leave ;
4687
+ f -> leave = mlxsw_sp_port_vlan_vfid_leave ;
4683
4688
f -> fid = fid ;
4684
4689
f -> dev = br_dev ;
4685
4690
@@ -4767,17 +4772,22 @@ static int mlxsw_sp_vport_vfid_join(struct mlxsw_sp_port *mlxsw_sp_vport,
4767
4772
return err ;
4768
4773
}
4769
4774
4770
- static void mlxsw_sp_vport_vfid_leave (struct mlxsw_sp_port * mlxsw_sp_vport )
4775
+ static void
4776
+ mlxsw_sp_port_vlan_vfid_leave (struct mlxsw_sp_port_vlan * mlxsw_sp_port_vlan )
4771
4777
{
4772
- struct mlxsw_sp_fid * f = mlxsw_sp_vport_fid_get (mlxsw_sp_vport );
4773
- struct mlxsw_sp_port * mlxsw_sp_port ;
4778
+ struct mlxsw_sp_port * mlxsw_sp_port = mlxsw_sp_port_vlan -> mlxsw_sp_port ;
4779
+ struct mlxsw_sp_port * mlxsw_sp_vport ;
4780
+ u16 vid = mlxsw_sp_port_vlan -> vid ;
4781
+ struct mlxsw_sp_fid * f ;
4782
+
4783
+ mlxsw_sp_vport = mlxsw_sp_port_vport_find (mlxsw_sp_port , vid );
4784
+ f = mlxsw_sp_vport_fid_get (mlxsw_sp_vport );
4774
4785
4775
4786
netdev_dbg (mlxsw_sp_vport -> dev , "Left FID=%d\n" , f -> fid );
4776
4787
4777
4788
mlxsw_sp_vport_fid_set (mlxsw_sp_vport , NULL );
4778
4789
f -> ref_count -- ;
4779
4790
4780
- mlxsw_sp_port = mlxsw_sp_vport_port (mlxsw_sp_vport );
4781
4791
if (mlxsw_sp_port -> nr_port_vid_map == 1 )
4782
4792
mlxsw_sp_port_vlan_mode_trans (mlxsw_sp_port );
4783
4793
mlxsw_sp_port -> nr_port_vid_map -- ;
@@ -4797,11 +4807,15 @@ static int mlxsw_sp_vport_bridge_join(struct mlxsw_sp_port *mlxsw_sp_vport,
4797
4807
{
4798
4808
struct mlxsw_sp_fid * f = mlxsw_sp_vport_fid_get (mlxsw_sp_vport );
4799
4809
u16 vid = mlxsw_sp_vport_vid_get (mlxsw_sp_vport );
4810
+ struct mlxsw_sp_port_vlan * mlxsw_sp_port_vlan ;
4800
4811
struct net_device * dev = mlxsw_sp_vport -> dev ;
4812
+ struct mlxsw_sp_port * mlxsw_sp_port ;
4801
4813
int err ;
4802
4814
4815
+ mlxsw_sp_port = mlxsw_sp_vport_port (mlxsw_sp_vport );
4816
+ mlxsw_sp_port_vlan = mlxsw_sp_port_vlan_find_by_vid (mlxsw_sp_port , vid );
4803
4817
if (f && !WARN_ON (!f -> leave ))
4804
- f -> leave (mlxsw_sp_vport );
4818
+ f -> leave (mlxsw_sp_port_vlan );
4805
4819
4806
4820
err = mlxsw_sp_vport_vfid_join (mlxsw_sp_vport , br_dev );
4807
4821
if (err ) {
@@ -4826,17 +4840,21 @@ static int mlxsw_sp_vport_bridge_join(struct mlxsw_sp_port *mlxsw_sp_vport,
4826
4840
return 0 ;
4827
4841
4828
4842
err_port_vid_learning_set :
4829
- mlxsw_sp_vport_vfid_leave ( mlxsw_sp_vport );
4843
+ mlxsw_sp_port_vlan_vfid_leave ( mlxsw_sp_port_vlan );
4830
4844
return err ;
4831
4845
}
4832
4846
4833
4847
static void mlxsw_sp_vport_bridge_leave (struct mlxsw_sp_port * mlxsw_sp_vport )
4834
4848
{
4835
4849
u16 vid = mlxsw_sp_vport_vid_get (mlxsw_sp_vport );
4850
+ struct mlxsw_sp_port_vlan * mlxsw_sp_port_vlan ;
4851
+ struct mlxsw_sp_port * mlxsw_sp_port ;
4836
4852
4837
4853
mlxsw_sp_port_vid_learning_set (mlxsw_sp_vport , vid , false);
4838
4854
4839
- mlxsw_sp_vport_vfid_leave (mlxsw_sp_vport );
4855
+ mlxsw_sp_port = mlxsw_sp_vport_port (mlxsw_sp_vport );
4856
+ mlxsw_sp_port_vlan = mlxsw_sp_port_vlan_find_by_vid (mlxsw_sp_port , vid );
4857
+ mlxsw_sp_port_vlan_vfid_leave (mlxsw_sp_port_vlan );
4840
4858
4841
4859
mlxsw_sp_vport -> learning = 0 ;
4842
4860
mlxsw_sp_vport -> learning_sync = 0 ;
0 commit comments