* [PATCH] ib/mlx4: add IB_CQ_REPORT_MISSED_EVENTS support
@ 2010-07-27 8:21 Or Gerlitz
[not found] ` <4C4E96F9.4040503-hKgKHo2Ms0FWk0Htik3J/w@public.gmane.org>
0 siblings, 1 reply; 4+ messages in thread
From: Or Gerlitz @ 2010-07-27 8:21 UTC (permalink / raw)
To: Roland Dreier; +Cc: linux-rdma, Jack Morgenstein, Eli Cohen
enhance the cq arming code to support IB_CQ_REPORT_MISSED_EVENTS
Signed-off-by: Or Gerlitz <ogerlitz-smomgflXvOZWk0Htik3J/w@public.gmane.org>
----
I noted that the IB_CQ_REPORT_MISSED_EVENTS flag was added in the same cycle with mlx4
and maybe as of this, mlx4 didn't implement the flag, which is used by IPoIB
The patch is compile tested only, if the patch seems okay, I can conduct further testing.
diff --git a/drivers/infiniband/hw/mlx4/cq.c b/drivers/infiniband/hw/mlx4/cq.c
index 5a219a2..4366811 100644
--- a/drivers/infiniband/hw/mlx4/cq.c
+++ b/drivers/infiniband/hw/mlx4/cq.c
@@ -755,6 +755,13 @@ int mlx4_ib_arm_cq(struct ib_cq *ibcq, enum ib_cq_notify_flags flags)
to_mdev(ibcq->device)->uar_map,
MLX4_GET_DOORBELL_LOCK(&to_mdev(ibcq->device)->uar_lock));
+ if (flags & IB_CQ_REPORT_MISSED_EVENTS) {
+ struct mlx4_cqe *cqe;
+ cqe = next_cqe_sw(to_mcq(ibcq));
+ if (cqe)
+ return 1;
+ }
+
return 0;
}
--
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] ib/mlx4: add IB_CQ_REPORT_MISSED_EVENTS support
[not found] ` <4C4E96F9.4040503-hKgKHo2Ms0FWk0Htik3J/w@public.gmane.org>
@ 2010-07-27 9:14 ` Eli Cohen
[not found] ` <AANLkTinPRO6mOnCS-SJynkRXmt6J1uV3w5+8PfF6ubxN-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
0 siblings, 1 reply; 4+ messages in thread
From: Eli Cohen @ 2010-07-27 9:14 UTC (permalink / raw)
To: Or Gerlitz; +Cc: Roland Dreier, linux-rdma, Jack Morgenstein, Eli Cohen
I don't think this patch is required for mlx4.
< 0 means an error occurred while requesting notification
== 0 means notification was requested successfully, and if
IB_CQ_REPORT_MISSED_EVENTS was passed in, then no
events were missed and it is safe to wait for another
event.
> 0 is only returned if IB_CQ_REPORT_MISSED_EVENTS was
passed in. It means that the consumer must poll the
CQ again to make sure it is empty to avoid the race
described above.
returning 1 means that you must poll the CQ to avoid a race condition
which is not true for mlx4. For example if you return always 0 than
you don't violate what the changelog says.
On Tue, Jul 27, 2010 at 11:21 AM, Or Gerlitz <ogerlitz-smomgflXvOZWk0Htik3J/w@public.gmane.org> wrote:
> enhance the cq arming code to support IB_CQ_REPORT_MISSED_EVENTS
>
> Signed-off-by: Or Gerlitz <ogerlitz-smomgflXvOZWk0Htik3J/w@public.gmane.org>
>
> ----
>
> I noted that the IB_CQ_REPORT_MISSED_EVENTS flag was added in the same cycle with mlx4
> and maybe as of this, mlx4 didn't implement the flag, which is used by IPoIB
>
> The patch is compile tested only, if the patch seems okay, I can conduct further testing.
>
> diff --git a/drivers/infiniband/hw/mlx4/cq.c b/drivers/infiniband/hw/mlx4/cq.c
> index 5a219a2..4366811 100644
> --- a/drivers/infiniband/hw/mlx4/cq.c
> +++ b/drivers/infiniband/hw/mlx4/cq.c
> @@ -755,6 +755,13 @@ int mlx4_ib_arm_cq(struct ib_cq *ibcq, enum ib_cq_notify_flags flags)
> to_mdev(ibcq->device)->uar_map,
> MLX4_GET_DOORBELL_LOCK(&to_mdev(ibcq->device)->uar_lock));
>
> + if (flags & IB_CQ_REPORT_MISSED_EVENTS) {
> + struct mlx4_cqe *cqe;
> + cqe = next_cqe_sw(to_mcq(ibcq));
> + if (cqe)
> + return 1;
> + }
> +
> return 0;
> }
>
> --
> 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
>
--
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] ib/mlx4: add IB_CQ_REPORT_MISSED_EVENTS support
[not found] ` <AANLkTinPRO6mOnCS-SJynkRXmt6J1uV3w5+8PfF6ubxN-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2010-07-27 9:29 ` Bart Van Assche
2010-07-27 10:55 ` Or Gerlitz
1 sibling, 0 replies; 4+ messages in thread
From: Bart Van Assche @ 2010-07-27 9:29 UTC (permalink / raw)
To: Eli Cohen
Cc: Or Gerlitz, Roland Dreier, linux-rdma, Jack Morgenstein,
Eli Cohen
Can I conclude from this that the polling loop (2) from
http://www.mail-archive.com/linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org/msg04907.html
won't trigger a race on a multiprocessor when using mlx4 hardware ?
Bart.
On Tue, Jul 27, 2010 at 11:14 AM, Eli Cohen <eli-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org> wrote:
>
> I don't think this patch is required for mlx4.
>
> < 0 means an error occurred while requesting notification
> == 0 means notification was requested successfully, and if
> IB_CQ_REPORT_MISSED_EVENTS was passed in, then no
> events were missed and it is safe to wait for another
> event.
> > 0 is only returned if IB_CQ_REPORT_MISSED_EVENTS was
> passed in. It means that the consumer must poll the
> CQ again to make sure it is empty to avoid the race
> described above.
>
> returning 1 means that you must poll the CQ to avoid a race condition
> which is not true for mlx4. For example if you return always 0 than
> you don't violate what the changelog says.
>
> On Tue, Jul 27, 2010 at 11:21 AM, Or Gerlitz <ogerlitz-smomgflXvOZWk0Htik3J/w@public.gmane.org> wrote:
> > enhance the cq arming code to support IB_CQ_REPORT_MISSED_EVENTS
> >
> > Signed-off-by: Or Gerlitz <ogerlitz-smomgflXvOZWk0Htik3J/w@public.gmane.org>
> >
> > ----
> >
> > I noted that the IB_CQ_REPORT_MISSED_EVENTS flag was added in the same cycle with mlx4
> > and maybe as of this, mlx4 didn't implement the flag, which is used by IPoIB
> >
> > The patch is compile tested only, if the patch seems okay, I can conduct further testing.
> >
> > diff --git a/drivers/infiniband/hw/mlx4/cq.c b/drivers/infiniband/hw/mlx4/cq.c
> > index 5a219a2..4366811 100644
> > --- a/drivers/infiniband/hw/mlx4/cq.c
> > +++ b/drivers/infiniband/hw/mlx4/cq.c
> > @@ -755,6 +755,13 @@ int mlx4_ib_arm_cq(struct ib_cq *ibcq, enum ib_cq_notify_flags flags)
> > to_mdev(ibcq->device)->uar_map,
> > MLX4_GET_DOORBELL_LOCK(&to_mdev(ibcq->device)->uar_lock));
> >
> > + if (flags & IB_CQ_REPORT_MISSED_EVENTS) {
> > + struct mlx4_cqe *cqe;
> > + cqe = next_cqe_sw(to_mcq(ibcq));
> > + if (cqe)
> > + return 1;
> > + }
> > +
> > return 0;
> > }
> >
> > --
> > 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
> >
> --
> 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
--
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] ib/mlx4: add IB_CQ_REPORT_MISSED_EVENTS support
[not found] ` <AANLkTinPRO6mOnCS-SJynkRXmt6J1uV3w5+8PfF6ubxN-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-07-27 9:29 ` Bart Van Assche
@ 2010-07-27 10:55 ` Or Gerlitz
1 sibling, 0 replies; 4+ messages in thread
From: Or Gerlitz @ 2010-07-27 10:55 UTC (permalink / raw)
To: Eli Cohen; +Cc: Roland Dreier, linux-rdma, Jack Morgenstein, Eli Cohen
Eli Cohen wrote:
> returning 1 means that you must poll the CQ to avoid a race condition
> which is not true for mlx4.
makes sense, thanks for clarifying that.
Or.
--
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
end of thread, other threads:[~2010-07-27 10:55 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-27 8:21 [PATCH] ib/mlx4: add IB_CQ_REPORT_MISSED_EVENTS support Or Gerlitz
[not found] ` <4C4E96F9.4040503-hKgKHo2Ms0FWk0Htik3J/w@public.gmane.org>
2010-07-27 9:14 ` Eli Cohen
[not found] ` <AANLkTinPRO6mOnCS-SJynkRXmt6J1uV3w5+8PfF6ubxN-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-07-27 9:29 ` Bart Van Assche
2010-07-27 10:55 ` Or Gerlitz
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox