Commit bc2055f8 authored by Ido Schimmel's avatar Ido Schimmel Committed by David S. Miller

mlxsw: Enable configuration of flooding domains

As part of the introduction of L2 offloads, allow different ports to
join/leave the flooding domain, according to user configuration.
Signed-off-by: default avatarIdo Schimmel <idosch@mellanox.com>
Signed-off-by: default avatarJiri Pirko <jiri@mellanox.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 573c7ba0
...@@ -363,7 +363,7 @@ static inline void mlxsw_reg_sftr_pack(char *payload, ...@@ -363,7 +363,7 @@ static inline void mlxsw_reg_sftr_pack(char *payload,
unsigned int flood_table, unsigned int flood_table,
unsigned int index, unsigned int index,
enum mlxsw_flood_table_type table_type, enum mlxsw_flood_table_type table_type,
unsigned int range) unsigned int range, u8 port, bool set)
{ {
MLXSW_REG_ZERO(sftr, payload); MLXSW_REG_ZERO(sftr, payload);
mlxsw_reg_sftr_swid_set(payload, 0); mlxsw_reg_sftr_swid_set(payload, 0);
...@@ -371,8 +371,8 @@ static inline void mlxsw_reg_sftr_pack(char *payload, ...@@ -371,8 +371,8 @@ static inline void mlxsw_reg_sftr_pack(char *payload,
mlxsw_reg_sftr_index_set(payload, index); mlxsw_reg_sftr_index_set(payload, index);
mlxsw_reg_sftr_table_type_set(payload, table_type); mlxsw_reg_sftr_table_type_set(payload, table_type);
mlxsw_reg_sftr_range_set(payload, range); mlxsw_reg_sftr_range_set(payload, range);
mlxsw_reg_sftr_port_set(payload, MLXSW_PORT_CPU_PORT, 1); mlxsw_reg_sftr_port_set(payload, port, set);
mlxsw_reg_sftr_port_mask_set(payload, MLXSW_PORT_CPU_PORT, 1); mlxsw_reg_sftr_port_mask_set(payload, port, 1);
} }
/* SPMLR - Switch Port MAC Learning Register /* SPMLR - Switch Port MAC Learning Register
......
...@@ -1377,7 +1377,8 @@ static int mlxsw_sx_flood_init(struct mlxsw_sx *mlxsw_sx) ...@@ -1377,7 +1377,8 @@ static int mlxsw_sx_flood_init(struct mlxsw_sx *mlxsw_sx)
sftr_pl = kmalloc(MLXSW_REG_SFTR_LEN, GFP_KERNEL); sftr_pl = kmalloc(MLXSW_REG_SFTR_LEN, GFP_KERNEL);
if (!sftr_pl) if (!sftr_pl)
return -ENOMEM; return -ENOMEM;
mlxsw_reg_sftr_pack(sftr_pl, 0, 0, MLXSW_REG_SFGC_TABLE_TYPE_SINGLE, 0); mlxsw_reg_sftr_pack(sftr_pl, 0, 0, MLXSW_REG_SFGC_TABLE_TYPE_SINGLE, 0,
MLXSW_PORT_CPU_PORT, true);
err = mlxsw_reg_write(mlxsw_sx->core, MLXSW_REG(sftr), sftr_pl); err = mlxsw_reg_write(mlxsw_sx->core, MLXSW_REG(sftr), sftr_pl);
kfree(sftr_pl); kfree(sftr_pl);
if (err) if (err)
......
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