From 3f1db626594ed8e106c1550c098fb673fce8d9c3 Mon Sep 17 00:00:00 2001 From: Santosh Shilimkar Date: Wed, 17 Feb 2016 10:10:14 -0800 Subject: [PATCH] RDS: IB: drop discontinued IB CQ_VECTOR support IB_CQ_VECTOR_LEAST_ATTACHED was OFED 1.5 feature which later Mellanox dropped. As per them 'least attached' was not a way to distribute the load and that actually fools the user to think it does so. The fact that some cpu had 'least amount of attached cqs' has nothing to do with this cpu actual load. This is why the feature never made to upstream. On UEK4, the code is already under #if 0 because feature isn't available. Time to clean up the dead code considering its already dropped from upstream as well as OFED2.0+ onwards. Orabug: 23027670 Tested-by: Michael Nowak Tested-by: Rose Wang Tested-by: Rafael Alejandro Peralez Signed-off-by: Santosh Shilimkar --- net/rds/ib.c | 7 ------ net/rds/ib.h | 3 --- net/rds/ib_cm.c | 57 +++++-------------------------------------------- net/rds/rds.h | 2 -- 4 files changed, 5 insertions(+), 64 deletions(-) diff --git a/net/rds/ib.c b/net/rds/ib.c index 3ade8031849e7..d68ea09c19664 100644 --- a/net/rds/ib.c +++ b/net/rds/ib.c @@ -59,9 +59,6 @@ unsigned int rds_ib_active_bonding_reconnect_delay = 1; unsigned int rds_ib_active_bonding_trigger_delay_max_msecs; /* = 0; */ unsigned int rds_ib_active_bonding_trigger_delay_min_msecs; /* = 0; */ 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_active_bonding_failover_groups = NULL; unsigned int rds_ib_active_bonding_arps = RDS_IB_DEFAULT_NUM_ARPS; static char *rds_ib_active_bonding_excl_ips = "169.254/16,172.10/16"; @@ -90,10 +87,6 @@ module_param(rds_ib_active_bonding_trigger_delay_min_msecs, int, 0444); MODULE_PARM_DESC(rds_ib_active_bonding_trigger_delay_min_msecs, " Active Bonding Min delay before active " "bonding is triggered(msecs)"); -#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 module_param(rds_ib_active_bonding_arps, int, 0444); MODULE_PARM_DESC(rds_ib_active_bonding_arps, " Num ARPs to be sent when IP moved"); module_param(rds_ib_active_bonding_excl_ips, charp, 0444); diff --git a/net/rds/ib.h b/net/rds/ib.h index f6b06641a8826..c1c7a629a2e7f 100644 --- a/net/rds/ib.h +++ b/net/rds/ib.h @@ -558,9 +558,6 @@ extern unsigned int rds_ib_retry_count; extern unsigned int rds_ib_rnr_retry_count; extern unsigned int rds_ib_active_bonding_enabled; extern unsigned int rds_ib_active_bonding_fallback; -#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 4507e7ca8f18b..458d718215da8 100644 --- a/net/rds/ib_cm.c +++ b/net/rds/ib_cm.c @@ -580,28 +580,6 @@ static void rds_ib_qp_event_handler(struct ib_event *event, void *data) } } -static int rds_ib_find_least_loaded_vector(struct rds_ib_device *rds_ibdev) -{ - int i; - 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) { - index = i; - min = rds_ibdev->vector_load[i]; - } - } - - rds_ibdev->vector_load[index]++; - return index; -} - /* * This needs to be very careful to not leave IS_ERR pointers around for * cleanup to trip over. @@ -634,41 +612,28 @@ static int rds_ib_setup_qp(struct rds_connection *conn) ic->i_pd = rds_ibdev->pd; ic->i_mr = rds_ibdev->mr; - ic->i_scq_vector = rds_ib_find_least_loaded_vector(rds_ibdev); ic->i_scq = ib_create_cq(dev, rds_ib_cq_comp_handler_send, rds_ib_cq_event_handler, conn, - ic->i_send_ring.w_nr + 1, - ic->i_scq_vector); + ic->i_send_ring.w_nr + 1, 0); if (IS_ERR(ic->i_scq)) { 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; } - ic->i_rcq_vector = rds_ib_find_least_loaded_vector(rds_ibdev); if (rds_ib_srq_enabled) ic->i_rcq = ib_create_cq(dev, rds_ib_cq_comp_handler_recv, rds_ib_cq_event_handler, conn, - rds_ib_srq_max_wr - 1, - ic->i_rcq_vector); + rds_ib_srq_max_wr - 1, 0); else ic->i_rcq = ib_create_cq(dev, rds_ib_cq_comp_handler_recv, rds_ib_cq_event_handler, conn, - ic->i_recv_ring.w_nr, - ic->i_rcq_vector); + ic->i_recv_ring.w_nr, 0); if (IS_ERR(ic->i_rcq)) { 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; } @@ -1185,23 +1150,11 @@ void rds_ib_conn_shutdown(struct rds_connection *conn) if (ic->i_cm_id->qp) 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 + if (ic->i_rcq) 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 + if (ic->i_scq) ib_destroy_cq(ic->i_scq); - } /* then free the resources that ib callbacks use */ if (ic->i_send_hdrs) diff --git a/net/rds/rds.h b/net/rds/rds.h index 6978f0db84243..a3d6284edd2a7 100644 --- a/net/rds/rds.h +++ b/net/rds/rds.h @@ -25,8 +25,6 @@ #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.49.0