aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDevesh Sharma <devesh.sharma@broadcom.com>2016-02-11 00:21:52 -0500
committerDoug Ledford <dledford@redhat.com>2016-02-17 10:07:20 -0500
commitb41f7852f3b981df30727f5cd64c1877ceee794e (patch)
tree7b88b0c16ac22ea6066045ee67706ecf176593e7
parent75c1657e1d50730dc0130a67977f7831a4e241f4 (diff)
RDMA/ocrdma: Fix arm logic to align with new cq API
Today ocrdma driver defer arming the CQ till poll is called. This was used to prevent calling poll-cq on an armed CQ. Recently a set of new CQ API has been introduced into the linux kernel. The implementation of this API guarantees that a given CQ is never armed before calling poll on it. Most of the kernel ULPs have already moved to use this new API or have a code where poll is called before arming the CQ. Thus, the above workaround in ocrdma is not needed anymore. This patch removes the additional logic to deffer arm till poll is called. This patch adds a simple scheme where ib_req_notify_cq() will actually arm the cq. Signed-off-by: Devesh Sharma <devesh.sharma@broadcom.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
-rw-r--r--drivers/infiniband/hw/ocrdma/ocrdma.h3
-rw-r--r--drivers/infiniband/hw/ocrdma/ocrdma_verbs.c18
2 files changed, 4 insertions, 17 deletions
diff --git a/drivers/infiniband/hw/ocrdma/ocrdma.h b/drivers/infiniband/hw/ocrdma/ocrdma.h
index 040bb8b5cb15..12503f15fbd6 100644
--- a/drivers/infiniband/hw/ocrdma/ocrdma.h
+++ b/drivers/infiniband/hw/ocrdma/ocrdma.h
@@ -323,9 +323,6 @@ struct ocrdma_cq {
323 */ 323 */
324 u32 max_hw_cqe; 324 u32 max_hw_cqe;
325 bool phase_change; 325 bool phase_change;
326 bool deferred_arm, deferred_sol;
327 bool first_arm;
328
329 spinlock_t cq_lock ____cacheline_aligned; /* provide synchronization 326 spinlock_t cq_lock ____cacheline_aligned; /* provide synchronization
330 * to cq polling 327 * to cq polling
331 */ 328 */
diff --git a/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c b/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c
index 37620b4baafb..12420e4ecf3d 100644
--- a/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c
+++ b/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c
@@ -1094,7 +1094,6 @@ struct ib_cq *ocrdma_create_cq(struct ib_device *ibdev,
1094 spin_lock_init(&cq->comp_handler_lock); 1094 spin_lock_init(&cq->comp_handler_lock);
1095 INIT_LIST_HEAD(&cq->sq_head); 1095 INIT_LIST_HEAD(&cq->sq_head);
1096 INIT_LIST_HEAD(&cq->rq_head); 1096 INIT_LIST_HEAD(&cq->rq_head);
1097 cq->first_arm = true;
1098 1097
1099 if (ib_ctx) { 1098 if (ib_ctx) {
1100 uctx = get_ocrdma_ucontext(ib_ctx); 1099 uctx = get_ocrdma_ucontext(ib_ctx);
@@ -2910,12 +2909,9 @@ expand_cqe:
2910 } 2909 }
2911stop_cqe: 2910stop_cqe:
2912 cq->getp = cur_getp; 2911 cq->getp = cur_getp;
2913 if (cq->deferred_arm || polled_hw_cqes) { 2912
2914 ocrdma_ring_cq_db(dev, cq->id, cq->deferred_arm, 2913 if (polled_hw_cqes)
2915 cq->deferred_sol, polled_hw_cqes); 2914 ocrdma_ring_cq_db(dev, cq->id, false, false, polled_hw_cqes);
2916 cq->deferred_arm = false;
2917 cq->deferred_sol = false;
2918 }
2919 2915
2920 return i; 2916 return i;
2921} 2917}
@@ -2999,13 +2995,7 @@ int ocrdma_arm_cq(struct ib_cq *ibcq, enum ib_cq_notify_flags cq_flags)
2999 if (cq_flags & IB_CQ_SOLICITED) 2995 if (cq_flags & IB_CQ_SOLICITED)
3000 sol_needed = true; 2996 sol_needed = true;
3001 2997
3002 if (cq->first_arm) { 2998 ocrdma_ring_cq_db(dev, cq_id, arm_needed, sol_needed, 0);
3003 ocrdma_ring_cq_db(dev, cq_id, arm_needed, sol_needed, 0);
3004 cq->first_arm = false;
3005 }
3006
3007 cq->deferred_arm = true;
3008 cq->deferred_sol = sol_needed;
3009 spin_unlock_irqrestore(&cq->cq_lock, flags); 2999 spin_unlock_irqrestore(&cq->cq_lock, flags);
3010 3000
3011 return 0; 3001 return 0;