From 5b3160430a475e196df3e1c060785cda82be92ad Mon Sep 17 00:00:00 2001 From: Ajaykumar Hotchandani Date: Thu, 22 Jan 2015 16:04:05 -0800 Subject: [PATCH] rds: disable cq balance This should be enabled back after IB_CQ_VECTOR_LEAST_ATTACHED is added. Signed-off-by: Ajaykumar Hotchandani --- net/rds/ib.c | 4 ++++ net/rds/ib.h | 2 ++ net/rds/ib_cm.c | 10 ++++++++++ net/rds/rds.h | 2 ++ 4 files changed, 18 insertions(+) diff --git a/net/rds/ib.c b/net/rds/ib.c index a768633ac627..dbc4f5ea9107 100644 --- a/net/rds/ib.c +++ b/net/rds/ib.c @@ -57,7 +57,9 @@ unsigned int rds_ib_haip_enabled = 0; unsigned int rds_ib_haip_fallback = 1; unsigned int rds_ib_apm_timeout = RDS_IB_DEFAULT_TIMEOUT; unsigned int rds_ib_rnr_retry_count = RDS_IB_DEFAULT_RNR_RETRY_COUNT; +#if IB_RDS_CQ_VECTOR_SUPPORTED unsigned int rds_ib_cq_balance_enabled = 1; +#endif static char *rds_ib_haip_failover_groups = NULL; module_param(rds_ib_fmr_1m_pool_size, int, 0444); @@ -81,8 +83,10 @@ MODULE_PARM_DESC(rds_ib_haip_fallback, " HAIP failback Enabled"); module_param(rds_ib_haip_failover_groups, charp, 0444); MODULE_PARM_DESC(rds_ib_haip_failover_groups, "[,]*[;[,]*]*"); +#if IB_RDS_CQ_VECTOR_SUPPORTED module_param(rds_ib_cq_balance_enabled, int, 0444); MODULE_PARM_DESC(rds_ib_cq_balance_enabled, " CQ load balance Enabled"); +#endif /* * we have a clumsy combination of RCU and a rwsem protecting this list diff --git a/net/rds/ib.h b/net/rds/ib.h index 944b6e692743..816db3e3153f 100644 --- a/net/rds/ib.h +++ b/net/rds/ib.h @@ -431,7 +431,9 @@ extern unsigned int rds_ib_haip_enabled; extern unsigned int rds_ib_haip_fallback; extern unsigned int rds_ib_haip_failover_enabled; extern unsigned int rds_ib_apm_timeout; +#if IB_RDS_CQ_VECTOR_SUPPORTED extern unsigned int rds_ib_cq_balance_enabled; +#endif extern spinlock_t ib_nodev_conns_lock; extern struct list_head ib_nodev_conns; diff --git a/net/rds/ib_cm.c b/net/rds/ib_cm.c index 228c21138cae..8a805b5c72ca 100644 --- a/net/rds/ib_cm.c +++ b/net/rds/ib_cm.c @@ -464,8 +464,10 @@ static int rds_ib_find_least_loaded_vector(struct rds_ib_device *rds_ibdev) int index = rds_ibdev->dev->num_comp_vectors - 1; int min = rds_ibdev->vector_load[rds_ibdev->dev->num_comp_vectors - 1]; +#if IB_RDS_CQ_VECTOR_SUPPORTED if (!rds_ib_cq_balance_enabled) return IB_CQ_VECTOR_LEAST_ATTACHED; +#endif for (i = rds_ibdev->dev->num_comp_vectors - 1; i >= 0; i--) { if (rds_ibdev->vector_load[i] < min) { @@ -519,8 +521,10 @@ static int rds_ib_setup_qp(struct rds_connection *conn) ret = PTR_ERR(ic->i_scq); ic->i_scq = NULL; rdsdebug("ib_create_cq send failed: %d\n", ret); +#if IB_RDS_CQ_VECTOR_SUPPORTED if (ic->i_scq_vector != IB_CQ_VECTOR_LEAST_ATTACHED) rds_ibdev->vector_load[ic->i_scq_vector]--; +#endif goto out; } @@ -539,8 +543,10 @@ static int rds_ib_setup_qp(struct rds_connection *conn) ret = PTR_ERR(ic->i_rcq); ic->i_rcq = NULL; rdsdebug("ib_create_cq recv failed: %d\n", ret); +#if IB_RDS_CQ_VECTOR_SUPPORTED if (ic->i_scq_vector != IB_CQ_VECTOR_LEAST_ATTACHED) rds_ibdev->vector_load[ic->i_rcq_vector]--; +#endif goto out; } @@ -1068,16 +1074,20 @@ void rds_ib_conn_shutdown(struct rds_connection *conn) rdma_destroy_qp(ic->i_cm_id); if (ic->i_rcq) { +#if IB_RDS_CQ_VECTOR_SUPPORTED if (ic->rds_ibdev && ic->i_rcq_vector != IB_CQ_VECTOR_LEAST_ATTACHED) ic->rds_ibdev->vector_load[ic->i_rcq_vector]--; +#endif ib_destroy_cq(ic->i_rcq); } if (ic->i_scq) { +#if IB_RDS_CQ_VECTOR_SUPPORTED if (ic->rds_ibdev && ic->i_scq_vector != IB_CQ_VECTOR_LEAST_ATTACHED) ic->rds_ibdev->vector_load[ic->i_scq_vector]--; +#endif ib_destroy_cq(ic->i_scq); } diff --git a/net/rds/rds.h b/net/rds/rds.h index dfe88f1a99b6..f329354a07fc 100644 --- a/net/rds/rds.h +++ b/net/rds/rds.h @@ -21,6 +21,8 @@ #define RDS_PROTOCOL_MINOR(v) ((v) & 255) #define RDS_PROTOCOL(maj, min) (((maj) << 8) | min) +#define IB_RDS_CQ_VECTOR_SUPPORTED 0 + /* * XXX randomly chosen, but at least seems to be unused: * # 18464-18768 Unassigned -- 2.51.0