Skip to content

Commit fad8e1b

Browse files
Amit CohenPaolo Abeni
authored andcommitted
mlxsw: Prepare 'bridge_type' field for SFMR usage
Under the legacy bridge model, the field 'bridge_type' is used only in SFGC register, to determine the type of flood table (FID/FID offset). Under the unified bridge model, it will be used also in SFMR register. When a BUM packet needs to be flooded, SFGC is used to provide the 'mid_base' for PGT table. The access to SFGC is by {packet type, bridge type}. Under the unified bridge model, software is responsible for configuring 'bridge_type' as part of SFMR. As preparation for the new required configuration, rename 'enum mlxsw_reg_sfgc_bridge_type' to 'enum mlxsw_reg_bridge_type'. Then it can be used also in SFMR. In addition, align the names of the values to internal documentation. 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 93303ff commit fad8e1b

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

drivers/net/ethernet/mellanox/mlxsw/reg.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1054,9 +1054,10 @@ enum mlxsw_reg_sfgc_type {
10541054
*/
10551055
MLXSW_ITEM32(reg, sfgc, type, 0x00, 0, 4);
10561056

1057-
enum mlxsw_reg_sfgc_bridge_type {
1058-
MLXSW_REG_SFGC_BRIDGE_TYPE_1Q_FID = 0,
1059-
MLXSW_REG_SFGC_BRIDGE_TYPE_VFID = 1,
1057+
/* bridge_type is used in SFGC and SFMR. */
1058+
enum mlxsw_reg_bridge_type {
1059+
MLXSW_REG_BRIDGE_TYPE_0 = 0, /* Used for .1q FIDs. */
1060+
MLXSW_REG_BRIDGE_TYPE_1 = 1, /* Used for .1d FIDs. */
10601061
};
10611062

10621063
/* reg_sfgc_bridge_type
@@ -1111,7 +1112,7 @@ MLXSW_ITEM32(reg, sfgc, mid_base, 0x10, 0, 16);
11111112

11121113
static inline void
11131114
mlxsw_reg_sfgc_pack(char *payload, enum mlxsw_reg_sfgc_type type,
1114-
enum mlxsw_reg_sfgc_bridge_type bridge_type,
1115+
enum mlxsw_reg_bridge_type bridge_type,
11151116
enum mlxsw_flood_table_type table_type,
11161117
unsigned int flood_table)
11171118
{

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ static const struct rhashtable_params mlxsw_sp_fid_vni_ht_params = {
7171

7272
struct mlxsw_sp_flood_table {
7373
enum mlxsw_sp_flood_type packet_type;
74-
enum mlxsw_reg_sfgc_bridge_type bridge_type;
74+
enum mlxsw_reg_bridge_type bridge_type;
7575
enum mlxsw_flood_table_type table_type;
7676
int table_index;
7777
};
@@ -709,19 +709,19 @@ static const struct mlxsw_sp_fid_ops mlxsw_sp_fid_8021d_ops = {
709709
static const struct mlxsw_sp_flood_table mlxsw_sp_fid_8021d_flood_tables[] = {
710710
{
711711
.packet_type = MLXSW_SP_FLOOD_TYPE_UC,
712-
.bridge_type = MLXSW_REG_SFGC_BRIDGE_TYPE_VFID,
712+
.bridge_type = MLXSW_REG_BRIDGE_TYPE_1,
713713
.table_type = MLXSW_REG_SFGC_TABLE_TYPE_FID,
714714
.table_index = 0,
715715
},
716716
{
717717
.packet_type = MLXSW_SP_FLOOD_TYPE_MC,
718-
.bridge_type = MLXSW_REG_SFGC_BRIDGE_TYPE_VFID,
718+
.bridge_type = MLXSW_REG_BRIDGE_TYPE_1,
719719
.table_type = MLXSW_REG_SFGC_TABLE_TYPE_FID,
720720
.table_index = 1,
721721
},
722722
{
723723
.packet_type = MLXSW_SP_FLOOD_TYPE_BC,
724-
.bridge_type = MLXSW_REG_SFGC_BRIDGE_TYPE_VFID,
724+
.bridge_type = MLXSW_REG_BRIDGE_TYPE_1,
725725
.table_type = MLXSW_REG_SFGC_TABLE_TYPE_FID,
726726
.table_index = 2,
727727
},

0 commit comments

Comments
 (0)