net/mlx5e: E-Switch, Add a check that log_max_l2_table is valid
If log_max_l2_table is 0 there is no really room for one L2 address. and should be treated as not supported. Do the check in MPFS init and for vport context events which both used to update L2 address. Signed-off-by: Roi Dayan <roid@nvidia.com> Reviewed-by: Maor Dickman <maord@nvidia.com> Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
This commit is contained in:
parent
292243d13b
commit
3d7c5f78b8
@ -712,6 +712,9 @@ void esw_vport_change_handle_locked(struct mlx5_vport *vport)
|
||||
struct mlx5_eswitch *esw = dev->priv.eswitch;
|
||||
u8 mac[ETH_ALEN];
|
||||
|
||||
if (!MLX5_CAP_GEN(dev, log_max_l2_table))
|
||||
return;
|
||||
|
||||
mlx5_query_nic_vport_mac_address(dev, vport->vport, true, mac);
|
||||
esw_debug(dev, "vport[%d] Context Changed: perm mac: %pM\n",
|
||||
vport->vport, mac);
|
||||
@ -948,7 +951,8 @@ void mlx5_esw_vport_disable(struct mlx5_eswitch *esw, u16 vport_num)
|
||||
vport->enabled = false;
|
||||
|
||||
/* Disable events from this vport */
|
||||
arm_vport_context_events_cmd(esw->dev, vport->vport, 0);
|
||||
if (MLX5_CAP_GEN(esw->dev, log_max_l2_table))
|
||||
arm_vport_context_events_cmd(esw->dev, vport->vport, 0);
|
||||
|
||||
if (!mlx5_esw_is_manager_vport(esw, vport->vport) &&
|
||||
MLX5_CAP_GEN(esw->dev, vhca_resource_manager))
|
||||
|
@ -99,7 +99,7 @@ int mlx5_mpfs_init(struct mlx5_core_dev *dev)
|
||||
int l2table_size = 1 << MLX5_CAP_GEN(dev, log_max_l2_table);
|
||||
struct mlx5_mpfs *mpfs;
|
||||
|
||||
if (!MLX5_ESWITCH_MANAGER(dev))
|
||||
if (!MLX5_ESWITCH_MANAGER(dev) || l2table_size == 1)
|
||||
return 0;
|
||||
|
||||
mpfs = kzalloc(sizeof(*mpfs), GFP_KERNEL);
|
||||
|
Loading…
x
Reference in New Issue
Block a user