Skip to content

Commit 08c75b2

Browse files
Dotan BarakMukesh Kacker
authored andcommitted
mlx4_core: allow to use 0 in log_mtts_per_seg
This allows us to obtain MTTs starting at any index thus give better cache utilization. Signed-off-by: Eli Cohen <[email protected]> Signed-off-by: Dotan Barak <[email protected]> Reviewed-by: Jack Morgenstein <[email protected]> Signed-off-by: Vladimir Sokolovsky <[email protected]> (Ported from Mellanox OFED 2.4) Signed-off-by: Mukesh Kacker <[email protected]>
1 parent 3788851 commit 08c75b2

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

drivers/net/ethernet/mellanox/mlx4/main.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -140,9 +140,10 @@ static bool use_prio;
140140
module_param_named(use_prio, use_prio, bool, 0444);
141141
MODULE_PARM_DESC(use_prio, "Enable steering by VLAN priority on ETH ports (deprecated)");
142142

143-
int log_mtts_per_seg = ilog2(MLX4_MTT_ENTRY_PER_SEG);
143+
int log_mtts_per_seg = ilog2(1);
144144
module_param_named(log_mtts_per_seg, log_mtts_per_seg, int, 0444);
145-
MODULE_PARM_DESC(log_mtts_per_seg, "Log2 number of MTT entries per segment (1-7)");
145+
MODULE_PARM_DESC(log_mtts_per_seg, "Log2 number of MTT entries per segment "
146+
"(0-7) (default: 0)");
146147

147148
static int port_type_array[2] = {MLX4_PORT_TYPE_NONE, MLX4_PORT_TYPE_NONE};
148149
static int arr_argc = 2;
@@ -3757,7 +3758,7 @@ static int __init mlx4_verify_params(void)
37573758
if (use_prio != 0)
37583759
pr_warn("mlx4_core: use_prio - obsolete module param, ignored\n");
37593760

3760-
if ((log_mtts_per_seg < 1) || (log_mtts_per_seg > 7)) {
3761+
if ((log_mtts_per_seg < 0) || (log_mtts_per_seg > 7)) {
37613762
pr_warn("mlx4_core: bad log_mtts_per_seg: %d\n",
37623763
log_mtts_per_seg);
37633764
return -1;

drivers/net/ethernet/mellanox/mlx4/mlx4.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ enum {
8181
MLX4_MIN_MGM_LOG_ENTRY_SIZE = 7,
8282
MLX4_MAX_MGM_LOG_ENTRY_SIZE = 12,
8383
MLX4_MAX_QP_PER_MGM = 4 * ((1 << MLX4_MAX_MGM_LOG_ENTRY_SIZE) / 16 - 2),
84-
MLX4_MTT_ENTRY_PER_SEG = 8,
8584
};
8685

8786
enum {

0 commit comments

Comments
 (0)