aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/drivers/net/ethernet/mellanox/mlx4/profile.c
diff options
context:
space:
mode:
authorTariq Toukan <tariqt@mellanox.com>2018-07-24 14:31:45 +0300
committerDavid S. Miller <davem@davemloft.net>2018-07-25 16:30:38 -0700
commit7cc77bf4c29c88af8d3d02d6dc88a71f85ecb1b6 (patch)
tree08c02321783891af748bb15cae929c66eee78a79 /drivers/net/ethernet/mellanox/mlx4/profile.c
parentMerge branch 'mlx5-Offload-setting-matching-on-tunnel-tos-ttl' (diff)
downloadwireguard-linux-7cc77bf4c29c88af8d3d02d6dc88a71f85ecb1b6.tar.xz
wireguard-linux-7cc77bf4c29c88af8d3d02d6dc88a71f85ecb1b6.zip
net/mlx4_core: Allow MTTs starting at any index
Allow obtaining MTTs starting at any index, thus give a better cache utilization. For this, allow setting log_mtts_per_seg to 0, and use this in default. Signed-off-by: Tariq Toukan <tariqt@mellanox.com> Signed-off-by: Eli Cohen <eli@mellanox.co.il> Signed-off-by: Anaty Rahamim Bar Kat <anaty@mellanox.com> Reviewed-by: Jack Morgenstein <jackm@dev.mellanox.co.il> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/mellanox/mlx4/profile.c')
-rw-r--r--drivers/net/ethernet/mellanox/mlx4/profile.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx4/profile.c b/drivers/net/ethernet/mellanox/mlx4/profile.c
index bae8b22edbb7..ba361c5fbda3 100644
--- a/drivers/net/ethernet/mellanox/mlx4/profile.c
+++ b/drivers/net/ethernet/mellanox/mlx4/profile.c
@@ -105,7 +105,8 @@ u64 mlx4_make_profile(struct mlx4_dev *dev,
request->num_mtt =
roundup_pow_of_two(max_t(unsigned, request->num_mtt,
min(1UL << (31 - log_mtts_per_seg),
- si.totalram >> (log_mtts_per_seg - 1))));
+ (si.totalram << 1) >> log_mtts_per_seg)));
+
profile[MLX4_RES_QP].size = dev_cap->qpc_entry_sz;
profile[MLX4_RES_RDMARC].size = dev_cap->rdmarc_entry_sz;