* [PATCH] RDMA/ocrdma: Fix arm logic to align with new cq API
@ 2016-02-11 5:21 Devesh Sharma
[not found] ` <1455168112-12803-1-git-send-email-devesh.sharma-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
0 siblings, 1 reply; 4+ messages in thread
From: Devesh Sharma @ 2016-02-11 5:21 UTC (permalink / raw)
To: linux-rdma-u79uwXL29TY76Z2rM5mHXA
Cc: dledford-H+wXaHxf7aLQT0dZR+AlfA, Devesh Sharma
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-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
---
drivers/infiniband/hw/ocrdma/ocrdma.h | 3 ---
drivers/infiniband/hw/ocrdma/ocrdma_verbs.c | 18 ++++--------------
2 files changed, 4 insertions(+), 17 deletions(-)
diff --git a/drivers/infiniband/hw/ocrdma/ocrdma.h b/drivers/infiniband/hw/ocrdma/ocrdma.h
index 040bb8b..12503f1 100644
--- a/drivers/infiniband/hw/ocrdma/ocrdma.h
+++ b/drivers/infiniband/hw/ocrdma/ocrdma.h
@@ -323,9 +323,6 @@ struct ocrdma_cq {
*/
u32 max_hw_cqe;
bool phase_change;
- bool deferred_arm, deferred_sol;
- bool first_arm;
-
spinlock_t cq_lock ____cacheline_aligned; /* provide synchronization
* to cq polling
*/
diff --git a/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c b/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c
index 37620b4..12420e4 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,
spin_lock_init(&cq->comp_handler_lock);
INIT_LIST_HEAD(&cq->sq_head);
INIT_LIST_HEAD(&cq->rq_head);
- cq->first_arm = true;
if (ib_ctx) {
uctx = get_ocrdma_ucontext(ib_ctx);
@@ -2910,12 +2909,9 @@ expand_cqe:
}
stop_cqe:
cq->getp = cur_getp;
- if (cq->deferred_arm || polled_hw_cqes) {
- ocrdma_ring_cq_db(dev, cq->id, cq->deferred_arm,
- cq->deferred_sol, polled_hw_cqes);
- cq->deferred_arm = false;
- cq->deferred_sol = false;
- }
+
+ if (polled_hw_cqes)
+ ocrdma_ring_cq_db(dev, cq->id, false, false, polled_hw_cqes);
return i;
}
@@ -2999,13 +2995,7 @@ int ocrdma_arm_cq(struct ib_cq *ibcq, enum ib_cq_notify_flags cq_flags)
if (cq_flags & IB_CQ_SOLICITED)
sol_needed = true;
- if (cq->first_arm) {
- ocrdma_ring_cq_db(dev, cq_id, arm_needed, sol_needed, 0);
- cq->first_arm = false;
- }
-
- cq->deferred_arm = true;
- cq->deferred_sol = sol_needed;
+ ocrdma_ring_cq_db(dev, cq_id, arm_needed, sol_needed, 0);
spin_unlock_irqrestore(&cq->cq_lock, flags);
return 0;
--
1.8.3.1
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] RDMA/ocrdma: Fix arm logic to align with new cq API
[not found] ` <1455168112-12803-1-git-send-email-devesh.sharma-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
@ 2016-02-11 21:13 ` Parav Pandit
[not found] ` <CAG53R5UnRqq9Gf5fFZJr+e_3DQvz7ViveJJAz6FBFYBaADtMJA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
0 siblings, 1 reply; 4+ messages in thread
From: Parav Pandit @ 2016-02-11 21:13 UTC (permalink / raw)
To: Devesh Sharma; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Doug Ledford
On Thu, Feb 11, 2016 at 10:51 AM, Devesh Sharma
<devesh.sharma-dY08KVG/lbpWk0Htik3J/w@public.gmane.org> wrote:
> 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.
You might want to wait for NFS whose patches are in pipe to migrate to
newer APIs before merging this?
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] RDMA/ocrdma: Fix arm logic to align with new cq API
[not found] ` <CAG53R5UnRqq9Gf5fFZJr+e_3DQvz7ViveJJAz6FBFYBaADtMJA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2016-02-12 3:46 ` Devesh Sharma
[not found] ` <CANjDDBgH-4Foq02f8wE2bdg7OprvT84gLNY6-9uPNgYWEFKLPg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
0 siblings, 1 reply; 4+ messages in thread
From: Devesh Sharma @ 2016-02-12 3:46 UTC (permalink / raw)
To: Parav Pandit; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Doug Ledford
Hi Parav,
I have tested this patch with nfsrdma + linux-4.4 (i.e. without
Chuck's patches to use new CQ API)
iozone on nfsrdma mount point passed.
-Regards
Devesh
On Fri, Feb 12, 2016 at 2:43 AM, Parav Pandit <pandit.parav-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> On Thu, Feb 11, 2016 at 10:51 AM, Devesh Sharma
> <devesh.sharma-dY08KVG/lbpWk0Htik3J/w@public.gmane.org> wrote:
>> 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.
>
> You might want to wait for NFS whose patches are in pipe to migrate to
> newer APIs before merging this?
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] RDMA/ocrdma: Fix arm logic to align with new cq API
[not found] ` <CANjDDBgH-4Foq02f8wE2bdg7OprvT84gLNY6-9uPNgYWEFKLPg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2016-02-17 15:57 ` Doug Ledford
0 siblings, 0 replies; 4+ messages in thread
From: Doug Ledford @ 2016-02-17 15:57 UTC (permalink / raw)
To: Devesh Sharma, Parav Pandit; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA
[-- Attachment #1: Type: text/plain, Size: 919 bytes --]
On 02/11/2016 10:46 PM, Devesh Sharma wrote:
> Hi Parav,
>
> I have tested this patch with nfsrdma + linux-4.4 (i.e. without
> Chuck's patches to use new CQ API)
> iozone on nfsrdma mount point passed.
>
> -Regards
> Devesh
>
> On Fri, Feb 12, 2016 at 2:43 AM, Parav Pandit <pandit.parav-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>> On Thu, Feb 11, 2016 at 10:51 AM, Devesh Sharma
>> <devesh.sharma-dY08KVG/lbpWk0Htik3J/w@public.gmane.org> wrote:
>>> 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.
>>
>> You might want to wait for NFS whose patches are in pipe to migrate to
>> newer APIs before merging this?
Thanks, I've picked this up for 4.5-rc.
--
Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
GPG KeyID: 0E572FDD
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 884 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-02-17 15:57 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-11 5:21 [PATCH] RDMA/ocrdma: Fix arm logic to align with new cq API Devesh Sharma
[not found] ` <1455168112-12803-1-git-send-email-devesh.sharma-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
2016-02-11 21:13 ` Parav Pandit
[not found] ` <CAG53R5UnRqq9Gf5fFZJr+e_3DQvz7ViveJJAz6FBFYBaADtMJA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-02-12 3:46 ` Devesh Sharma
[not found] ` <CANjDDBgH-4Foq02f8wE2bdg7OprvT84gLNY6-9uPNgYWEFKLPg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-02-17 15:57 ` Doug Ledford
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).