Commit fad8e1b6 authored by Amit Cohen's avatar Amit Cohen Committed by Paolo Abeni

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: default avatarAmit Cohen <amcohen@nvidia.com>
Reviewed-by: default avatarPetr Machata <petrm@nvidia.com>
Signed-off-by: default avatarIdo Schimmel <idosch@nvidia.com>
Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
parent 93303ff8
...@@ -1054,9 +1054,10 @@ enum mlxsw_reg_sfgc_type { ...@@ -1054,9 +1054,10 @@ enum mlxsw_reg_sfgc_type {
*/ */
MLXSW_ITEM32(reg, sfgc, type, 0x00, 0, 4); MLXSW_ITEM32(reg, sfgc, type, 0x00, 0, 4);
enum mlxsw_reg_sfgc_bridge_type { /* bridge_type is used in SFGC and SFMR. */
MLXSW_REG_SFGC_BRIDGE_TYPE_1Q_FID = 0, enum mlxsw_reg_bridge_type {
MLXSW_REG_SFGC_BRIDGE_TYPE_VFID = 1, MLXSW_REG_BRIDGE_TYPE_0 = 0, /* Used for .1q FIDs. */
MLXSW_REG_BRIDGE_TYPE_1 = 1, /* Used for .1d FIDs. */
}; };
/* reg_sfgc_bridge_type /* reg_sfgc_bridge_type
...@@ -1111,7 +1112,7 @@ MLXSW_ITEM32(reg, sfgc, mid_base, 0x10, 0, 16); ...@@ -1111,7 +1112,7 @@ MLXSW_ITEM32(reg, sfgc, mid_base, 0x10, 0, 16);
static inline void static inline void
mlxsw_reg_sfgc_pack(char *payload, enum mlxsw_reg_sfgc_type type, mlxsw_reg_sfgc_pack(char *payload, enum mlxsw_reg_sfgc_type type,
enum mlxsw_reg_sfgc_bridge_type bridge_type, enum mlxsw_reg_bridge_type bridge_type,
enum mlxsw_flood_table_type table_type, enum mlxsw_flood_table_type table_type,
unsigned int flood_table) unsigned int flood_table)
{ {
......
...@@ -71,7 +71,7 @@ static const struct rhashtable_params mlxsw_sp_fid_vni_ht_params = { ...@@ -71,7 +71,7 @@ static const struct rhashtable_params mlxsw_sp_fid_vni_ht_params = {
struct mlxsw_sp_flood_table { struct mlxsw_sp_flood_table {
enum mlxsw_sp_flood_type packet_type; enum mlxsw_sp_flood_type packet_type;
enum mlxsw_reg_sfgc_bridge_type bridge_type; enum mlxsw_reg_bridge_type bridge_type;
enum mlxsw_flood_table_type table_type; enum mlxsw_flood_table_type table_type;
int table_index; int table_index;
}; };
...@@ -709,19 +709,19 @@ static const struct mlxsw_sp_fid_ops mlxsw_sp_fid_8021d_ops = { ...@@ -709,19 +709,19 @@ static const struct mlxsw_sp_fid_ops mlxsw_sp_fid_8021d_ops = {
static const struct mlxsw_sp_flood_table mlxsw_sp_fid_8021d_flood_tables[] = { static const struct mlxsw_sp_flood_table mlxsw_sp_fid_8021d_flood_tables[] = {
{ {
.packet_type = MLXSW_SP_FLOOD_TYPE_UC, .packet_type = MLXSW_SP_FLOOD_TYPE_UC,
.bridge_type = MLXSW_REG_SFGC_BRIDGE_TYPE_VFID, .bridge_type = MLXSW_REG_BRIDGE_TYPE_1,
.table_type = MLXSW_REG_SFGC_TABLE_TYPE_FID, .table_type = MLXSW_REG_SFGC_TABLE_TYPE_FID,
.table_index = 0, .table_index = 0,
}, },
{ {
.packet_type = MLXSW_SP_FLOOD_TYPE_MC, .packet_type = MLXSW_SP_FLOOD_TYPE_MC,
.bridge_type = MLXSW_REG_SFGC_BRIDGE_TYPE_VFID, .bridge_type = MLXSW_REG_BRIDGE_TYPE_1,
.table_type = MLXSW_REG_SFGC_TABLE_TYPE_FID, .table_type = MLXSW_REG_SFGC_TABLE_TYPE_FID,
.table_index = 1, .table_index = 1,
}, },
{ {
.packet_type = MLXSW_SP_FLOOD_TYPE_BC, .packet_type = MLXSW_SP_FLOOD_TYPE_BC,
.bridge_type = MLXSW_REG_SFGC_BRIDGE_TYPE_VFID, .bridge_type = MLXSW_REG_BRIDGE_TYPE_1,
.table_type = MLXSW_REG_SFGC_TABLE_TYPE_FID, .table_type = MLXSW_REG_SFGC_TABLE_TYPE_FID,
.table_index = 2, .table_index = 2,
}, },
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment