@@ -588,8 +588,8 @@ static int mlxsw_sp_port_fdb_uc_op(struct mlxsw_sp_port *mlxsw_sp_port,
588
588
}
589
589
590
590
static int mlxsw_sp_port_fdb_uc_lag_op (struct mlxsw_sp * mlxsw_sp , u16 lag_id ,
591
- const char * mac , u16 fid , bool adding ,
592
- bool dynamic )
591
+ const char * mac , u16 fid , u16 lag_vid ,
592
+ bool adding , bool dynamic )
593
593
{
594
594
char * sfd_pl ;
595
595
int err ;
@@ -600,8 +600,8 @@ static int mlxsw_sp_port_fdb_uc_lag_op(struct mlxsw_sp *mlxsw_sp, u16 lag_id,
600
600
601
601
mlxsw_reg_sfd_pack (sfd_pl , mlxsw_sp_sfd_op (adding ), 0 );
602
602
mlxsw_reg_sfd_uc_lag_pack (sfd_pl , 0 , mlxsw_sp_sfd_rec_policy (dynamic ),
603
- mac , fid , MLXSW_REG_SFD_REC_ACTION_NOP , 0 ,
604
- lag_id );
603
+ mac , fid , MLXSW_REG_SFD_REC_ACTION_NOP ,
604
+ lag_vid , lag_id );
605
605
err = mlxsw_reg_write (mlxsw_sp -> core , MLXSW_REG (sfd ), sfd_pl );
606
606
kfree (sfd_pl );
607
607
@@ -614,6 +614,7 @@ mlxsw_sp_port_fdb_static_add(struct mlxsw_sp_port *mlxsw_sp_port,
614
614
struct switchdev_trans * trans )
615
615
{
616
616
u16 fid = fdb -> vid ;
617
+ u16 lag_vid = 0 ;
617
618
618
619
if (switchdev_trans_ph_prepare (trans ))
619
620
return 0 ;
@@ -622,6 +623,7 @@ mlxsw_sp_port_fdb_static_add(struct mlxsw_sp_port *mlxsw_sp_port,
622
623
u16 vfid = mlxsw_sp_vport_vfid_get (mlxsw_sp_port );
623
624
624
625
fid = mlxsw_sp_vfid_to_fid (vfid );
626
+ lag_vid = mlxsw_sp_vport_vid_get (mlxsw_sp_port );
625
627
}
626
628
627
629
if (!fid )
@@ -633,7 +635,8 @@ mlxsw_sp_port_fdb_static_add(struct mlxsw_sp_port *mlxsw_sp_port,
633
635
else
634
636
return mlxsw_sp_port_fdb_uc_lag_op (mlxsw_sp_port -> mlxsw_sp ,
635
637
mlxsw_sp_port -> lag_id ,
636
- fdb -> addr , fid , true, false);
638
+ fdb -> addr , fid , lag_vid ,
639
+ true, false);
637
640
}
638
641
639
642
static int mlxsw_sp_port_obj_add (struct net_device * dev ,
@@ -756,11 +759,13 @@ mlxsw_sp_port_fdb_static_del(struct mlxsw_sp_port *mlxsw_sp_port,
756
759
const struct switchdev_obj_port_fdb * fdb )
757
760
{
758
761
u16 fid = fdb -> vid ;
762
+ u16 lag_vid = 0 ;
759
763
760
764
if (mlxsw_sp_port_is_vport (mlxsw_sp_port )) {
761
765
u16 vfid = mlxsw_sp_vport_vfid_get (mlxsw_sp_port );
762
766
763
767
fid = mlxsw_sp_vfid_to_fid (vfid );
768
+ lag_vid = mlxsw_sp_vport_vid_get (mlxsw_sp_port );
764
769
}
765
770
766
771
if (!mlxsw_sp_port -> lagged )
@@ -770,7 +775,7 @@ mlxsw_sp_port_fdb_static_del(struct mlxsw_sp_port *mlxsw_sp_port,
770
775
else
771
776
return mlxsw_sp_port_fdb_uc_lag_op (mlxsw_sp_port -> mlxsw_sp ,
772
777
mlxsw_sp_port -> lag_id ,
773
- fdb -> addr , fid ,
778
+ fdb -> addr , fid , lag_vid ,
774
779
false, false);
775
780
}
776
781
@@ -1039,6 +1044,7 @@ static void mlxsw_sp_fdb_notify_mac_lag_process(struct mlxsw_sp *mlxsw_sp,
1039
1044
{
1040
1045
struct mlxsw_sp_port * mlxsw_sp_port ;
1041
1046
char mac [ETH_ALEN ];
1047
+ u16 lag_vid = 0 ;
1042
1048
u16 lag_id ;
1043
1049
u16 vid , fid ;
1044
1050
int err ;
@@ -1062,13 +1068,14 @@ static void mlxsw_sp_fdb_notify_mac_lag_process(struct mlxsw_sp *mlxsw_sp,
1062
1068
}
1063
1069
1064
1070
vid = mlxsw_sp_vport_vid_get (mlxsw_sp_vport );
1071
+ lag_vid = vid ;
1065
1072
/* Override the physical port with the vPort. */
1066
1073
mlxsw_sp_port = mlxsw_sp_vport ;
1067
1074
} else {
1068
1075
vid = fid ;
1069
1076
}
1070
1077
1071
- err = mlxsw_sp_port_fdb_uc_lag_op (mlxsw_sp , lag_id , mac , fid ,
1078
+ err = mlxsw_sp_port_fdb_uc_lag_op (mlxsw_sp , lag_id , mac , fid , lag_vid ,
1072
1079
adding && mlxsw_sp_port -> learning ,
1073
1080
true);
1074
1081
if (err ) {
0 commit comments