From: Mukesh Kacker Date: Thu, 30 Jun 2016 19:16:46 +0000 (-0700) Subject: mlx4_core: use higher log_rdmarc_per_qp when scale_profile is set X-Git-Tag: v4.1.12-92~118^2 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=d57b0eec68f5a8e77a17ba0acbb68b777b0f2cdb;p=users%2Fjedix%2Flinux-maple.git mlx4_core: use higher log_rdmarc_per_qp when scale_profile is set Another parameter log_rdmarc_per_qp is scaled up to higher value (128) when scale_profile is set based on new requirement. The commit 58f318ea1272 "net/mlx4_core: Modify default value of log_rdmarc_per_qp to be consistent with HW capability" was modifying the Mellanox defaults to accomplish the same but this change uses scale_profile to be consistent with all the other changes from Mellanox defaults done for HCA parameters. This also (indirectly) fixes a code merge issue with following commits where a change to default value of log_rdmarc_per_qp got inadvertently reverted as two independent changes that interacted were done in the same merge window (albeit this fix does it with a slightly different implementation): 58f318ea1272 "net/mlx4_core: Modify default value of log_rdmarc_per_qp to be consistent with HW capability" 3480399bdf6d "mlx4_core: scale_profile should work without params set to 0" Orabug: 23725942 Signed-off-by: Mukesh Kacker Reviewed-by: Yuval Shaia Acked-by: Santosh Shilimkar --- diff --git a/drivers/net/ethernet/mellanox/mlx4/main.c b/drivers/net/ethernet/mellanox/mlx4/main.c index de4acf2376dd5..e5163b8d76def 100644 --- a/drivers/net/ethernet/mellanox/mlx4/main.c +++ b/drivers/net/ethernet/mellanox/mlx4/main.c @@ -152,6 +152,7 @@ MODULE_PARM_DESC(scale_profile, "Dynamically adjust default profile" #define MLX4_SCALE_LOG_NUM_QP 20 /* 1 Meg */ #define MLX4_SCALE_LOG_NUM_SRQ 18 /* 256K */ #define MLX4_SCALE_LOG_NUM_CQ 18 /* 256K */ +#define MLX4_SCALE_LOG_RDMARC_PER_QP 7 /* 128 */ static bool use_prio; module_param_named(use_prio, use_prio, bool, 0444); @@ -185,7 +186,7 @@ static atomic_t pf_loading = ATOMIC_INIT(0); static struct mlx4_profile default_profile = { .num_qp = 19, .num_srq = 16, - .rdmarc_per_qp = 7, + .rdmarc_per_qp = 4, .num_cq = 16, .num_mcg = 13, .num_mpt = 19, @@ -195,7 +196,7 @@ static struct mlx4_profile default_profile = { static struct mlx4_profile mod_param_profile = { .num_qp = 0, /* 0=>scale_profile or default 19 */ .num_srq = 0, /* 0=>scale_profile or default 16 */ - .rdmarc_per_qp = 4, + .rdmarc_per_qp = 0, /* 0=>scale_profile or default 4 */ .num_cq = 0, /* 0=>scale_profile or default 16 */ .num_mcg = 13, .num_mpt = 19, @@ -281,7 +282,33 @@ static void process_mod_param_profile(struct mlx4_profile *profile) } } - profile->rdmarc_per_qp = 1 << mod_param_profile.rdmarc_per_qp; + if (mod_param_profile.rdmarc_per_qp) { + if (mlx4_scale_profile) + pr_warn("mlx4_core: Both scale_profile and log_rdmarc_per_qp are set. Ignore scale_profile.\n"); + profile->rdmarc_per_qp = 1 << mod_param_profile.rdmarc_per_qp; + } else { + if (mlx4_scale_profile) { + /* Note: This could be set dynamically based on + * system/HCA resources in future. A constant for now. + */ + profile->rdmarc_per_qp = + 1 << MLX4_SCALE_LOG_RDMARC_PER_QP; + pr_info("mlx4_core: Scalable default profile parameters are enabled. Effective log_rdmarc_per_qp is now set to %d.\n", + MLX4_SCALE_LOG_RDMARC_PER_QP); + /* set in mod_param also for sysfs viewing */ + mod_param_profile.rdmarc_per_qp = + MLX4_SCALE_LOG_RDMARC_PER_QP; + } else { + profile->rdmarc_per_qp = + 1 << default_profile.rdmarc_per_qp; + pr_info("mlx4_core: log_rdmarc_per_qp not set and using driver default. Effective log_rdmarc_per_qp is now set to %d.\n", + default_profile.rdmarc_per_qp); + /* set in mod_param also for sysfs viewing */ + mod_param_profile.rdmarc_per_qp = + default_profile.rdmarc_per_qp; + } + } + if (mod_param_profile.num_cq) { if (mlx4_scale_profile)