@@ -101,6 +101,8 @@ struct mlxsw_sp_fid_ops {
101
101
u16 * p_pgt_size );
102
102
u16 (* fid_mid )(const struct mlxsw_sp_fid * fid ,
103
103
const struct mlxsw_sp_flood_table * flood_table );
104
+ void (* fid_pack )(char * sfmr_pl , const struct mlxsw_sp_fid * fid ,
105
+ enum mlxsw_reg_sfmr_op op );
104
106
};
105
107
106
108
struct mlxsw_sp_fid_family {
@@ -466,7 +468,8 @@ static int mlxsw_sp_fid_op(const struct mlxsw_sp_fid *fid, bool valid)
466
468
struct mlxsw_sp * mlxsw_sp = fid -> fid_family -> mlxsw_sp ;
467
469
char sfmr_pl [MLXSW_REG_SFMR_LEN ];
468
470
469
- mlxsw_sp_fid_pack_ctl (sfmr_pl , fid , mlxsw_sp_sfmr_op (valid ));
471
+ fid -> fid_family -> ops -> fid_pack (sfmr_pl , fid ,
472
+ mlxsw_sp_sfmr_op (valid ));
470
473
return mlxsw_reg_write (mlxsw_sp -> core , MLXSW_REG (sfmr ), sfmr_pl );
471
474
}
472
475
@@ -476,7 +479,9 @@ static int mlxsw_sp_fid_edit_op(const struct mlxsw_sp_fid *fid,
476
479
struct mlxsw_sp * mlxsw_sp = fid -> fid_family -> mlxsw_sp ;
477
480
char sfmr_pl [MLXSW_REG_SFMR_LEN ];
478
481
479
- mlxsw_sp_fid_pack_ctl (sfmr_pl , fid , MLXSW_REG_SFMR_OP_CREATE_FID );
482
+ fid -> fid_family -> ops -> fid_pack (sfmr_pl , fid ,
483
+ MLXSW_REG_SFMR_OP_CREATE_FID );
484
+
480
485
mlxsw_reg_sfmr_vv_set (sfmr_pl , fid -> vni_valid );
481
486
mlxsw_reg_sfmr_vni_set (sfmr_pl , be32_to_cpu (fid -> vni ));
482
487
mlxsw_reg_sfmr_vtfp_set (sfmr_pl , fid -> nve_flood_index_valid );
@@ -1130,6 +1135,7 @@ static const struct mlxsw_sp_fid_ops mlxsw_sp_fid_8021d_ops_ctl = {
1130
1135
.flood_table_init = mlxsw_sp_fid_flood_table_init_ctl ,
1131
1136
.pgt_size = mlxsw_sp_fid_8021d_pgt_size ,
1132
1137
.fid_mid = mlxsw_sp_fid_fid_mid_ctl ,
1138
+ .fid_pack = mlxsw_sp_fid_pack_ctl ,
1133
1139
};
1134
1140
1135
1141
#define MLXSW_SP_FID_8021Q_MAX (VLAN_N_VID - 2)
@@ -1312,6 +1318,7 @@ static const struct mlxsw_sp_fid_ops mlxsw_sp_fid_rfid_ops_ctl = {
1312
1318
.nve_flood_index_set = mlxsw_sp_fid_rfid_nve_flood_index_set ,
1313
1319
.nve_flood_index_clear = mlxsw_sp_fid_rfid_nve_flood_index_clear ,
1314
1320
.vid_to_fid_rif_update = mlxsw_sp_fid_rfid_vid_to_fid_rif_update ,
1321
+ .fid_pack = mlxsw_sp_fid_pack_ctl ,
1315
1322
};
1316
1323
1317
1324
static int mlxsw_sp_fid_dummy_setup (struct mlxsw_sp_fid * fid , const void * arg )
@@ -1374,6 +1381,7 @@ static const struct mlxsw_sp_fid_ops mlxsw_sp_fid_dummy_ops = {
1374
1381
.vni_clear = mlxsw_sp_fid_dummy_vni_clear ,
1375
1382
.nve_flood_index_set = mlxsw_sp_fid_dummy_nve_flood_index_set ,
1376
1383
.nve_flood_index_clear = mlxsw_sp_fid_dummy_nve_flood_index_clear ,
1384
+ .fid_pack = mlxsw_sp_fid_pack ,
1377
1385
};
1378
1386
1379
1387
static int mlxsw_sp_fid_8021q_configure (struct mlxsw_sp_fid * fid )
@@ -1474,6 +1482,7 @@ static const struct mlxsw_sp_fid_ops mlxsw_sp_fid_8021q_ops_ctl = {
1474
1482
.flood_table_init = mlxsw_sp_fid_flood_table_init_ctl ,
1475
1483
.pgt_size = mlxsw_sp_fid_8021d_pgt_size ,
1476
1484
.fid_mid = mlxsw_sp_fid_fid_mid_ctl ,
1485
+ .fid_pack = mlxsw_sp_fid_pack_ctl ,
1477
1486
};
1478
1487
1479
1488
/* There are 4K-2 802.1Q FIDs */
0 commit comments