Message ID | 20210527043609.654854-17-saeed@kernel.org |
---|---|
State | New |
Headers | show |
Series | mlx5 misc updates 2021-05-26 | expand |
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/sf/dev/dev.c b/drivers/net/ethernet/mellanox/mlx5/core/sf/dev/dev.c index 6a0c6f965ad1..9f9728324731 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/sf/dev/dev.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/sf/dev/dev.c @@ -227,7 +227,8 @@ void mlx5_sf_dev_table_create(struct mlx5_core_dev *dev) max_sfs = MLX5_CAP_GEN(dev, max_num_sf); else max_sfs = 1 << MLX5_CAP_GEN(dev, log_max_sf); - table->sf_bar_length = 1 << (MLX5_CAP_GEN(dev, log_min_sf_size) + 12); + table->sf_bar_length = 1 << (max_t(u8, MLX5_CAP_GEN(dev, log_min_sf_size) + 12, + PAGE_SHIFT)); table->base_address = pci_resource_start(dev->pdev, 2); table->max_sfs = max_sfs; xa_init(&table->devices);