Skip to content

Commit 8c2da08

Browse files
Amit CohenPaolo Abeni
authored andcommitted
mlxsw: spectrum_fid: Configure egress VID classification for multicast
The device includes two main tables to support layer 2 multicast (i.e., MDB and flooding). These are the PGT (Port Group Table) table and the MPE (Multicast Port Egress) table. - PGT is {MID -> (bitmap of local_port, SPME index)} - MPE is {(Local port, SMPE index) -> eVID} In the legacy model, software did not interact with MPE table as it was completely hidden in firmware. In the new model, software needs to populate the table itself in order to map from {Local port, SMPE} to an egress VID. This is done using the SMPE register. Configure SMPE register when a {Local port, VID} are mapped/unmapped to a 802.1d and 802.1q emulated FIDs. The MPE table is not relevant for rFIDs as firmware handles their flooding. Signed-off-by: Amit Cohen <[email protected]> Reviewed-by: Petr Machata <[email protected]> Signed-off-by: Ido Schimmel <[email protected]> Signed-off-by: Paolo Abeni <[email protected]>
1 parent aa845e3 commit 8c2da08

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -622,6 +622,18 @@ mlxsw_sp_fid_port_vid_list_del(struct mlxsw_sp_fid *fid, u16 local_port,
622622
}
623623
}
624624

625+
static int
626+
mlxsw_sp_fid_mpe_table_map(const struct mlxsw_sp_fid *fid, u16 local_port,
627+
u16 vid, bool valid)
628+
{
629+
struct mlxsw_sp *mlxsw_sp = fid->fid_family->mlxsw_sp;
630+
char smpe_pl[MLXSW_REG_SMPE_LEN];
631+
632+
mlxsw_reg_smpe_pack(smpe_pl, local_port, fid->fid_index,
633+
valid ? vid : 0);
634+
return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(smpe), smpe_pl);
635+
}
636+
625637
static int mlxsw_sp_fid_8021d_port_vid_map(struct mlxsw_sp_fid *fid,
626638
struct mlxsw_sp_port *mlxsw_sp_port,
627639
u16 vid)
@@ -635,6 +647,12 @@ static int mlxsw_sp_fid_8021d_port_vid_map(struct mlxsw_sp_fid *fid,
635647
if (err)
636648
return err;
637649

650+
if (fid->fid_family->mlxsw_sp->ubridge) {
651+
err = mlxsw_sp_fid_mpe_table_map(fid, local_port, vid, true);
652+
if (err)
653+
goto err_mpe_table_map;
654+
}
655+
638656
err = mlxsw_sp_fid_port_vid_list_add(fid, mlxsw_sp_port->local_port,
639657
vid);
640658
if (err)
@@ -652,6 +670,9 @@ static int mlxsw_sp_fid_8021d_port_vid_map(struct mlxsw_sp_fid *fid,
652670
mlxsw_sp->fid_core->port_fid_mappings[local_port]--;
653671
mlxsw_sp_fid_port_vid_list_del(fid, mlxsw_sp_port->local_port, vid);
654672
err_port_vid_list_add:
673+
if (fid->fid_family->mlxsw_sp->ubridge)
674+
mlxsw_sp_fid_mpe_table_map(fid, local_port, vid, false);
675+
err_mpe_table_map:
655676
__mlxsw_sp_fid_port_vid_map(fid, mlxsw_sp_port->local_port, vid, false);
656677
return err;
657678
}
@@ -667,6 +688,8 @@ mlxsw_sp_fid_8021d_port_vid_unmap(struct mlxsw_sp_fid *fid,
667688
mlxsw_sp_port_vlan_mode_trans(mlxsw_sp_port);
668689
mlxsw_sp->fid_core->port_fid_mappings[local_port]--;
669690
mlxsw_sp_fid_port_vid_list_del(fid, mlxsw_sp_port->local_port, vid);
691+
if (fid->fid_family->mlxsw_sp->ubridge)
692+
mlxsw_sp_fid_mpe_table_map(fid, local_port, vid, false);
670693
__mlxsw_sp_fid_port_vid_map(fid, mlxsw_sp_port->local_port, vid, false);
671694
}
672695

0 commit comments

Comments
 (0)