[ofa-general] Re: [RFC][PATCH] last wqe event handler patch

Eli Cohen eli at mellanox.co.il
Wed Jun 25 01:25:52 PDT 2008


What you describe makes sense to me but it looks like your fix opens
another hole. Now you removed the limit on the number of drain WRs that
may be posted and you risk a CQ overflow. Wouldn't it be simpler to just
move one entry from the flush list to the drain list instead of moving
appending the whole flush list to the drain list?

diff --git a/drivers/infiniband/ulp/ipoib/ipoib_cm.c b/drivers/infiniband/ulp/ipoib/ipoib_cm.c
index 6223fc3..1fcbf7b 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib_cm.c
+++ b/drivers/infiniband/ulp/ipoib/ipoib_cm.c
@@ -222,7 +222,7 @@ static void ipoib_cm_start_rx_drain(struct ipoib_dev_priv *priv)
 	if (ib_post_send(p->qp, &ipoib_cm_rx_drain_wr, &bad_wr))
 		ipoib_warn(priv, "failed to post drain wr\n");
 
-	list_splice_init(&priv->cm.rx_flush_list, &priv->cm.rx_drain_list);
+	list_move(priv->cm.rx_flush_list.next, &priv->cm.rx_drain_list);
 }
 
 static void ipoib_cm_rx_event_handler(struct ib_event *event, void *ctx)




On Tue, 2008-06-24 at 23:16 -0700, Shirley Ma wrote:
> Hello Roland,
> 
> Let's assume this senarios: 
> 
> 1. QP100 last WQE reached event, QP100 context is added into
> flush_list, and then it is put into drain_list, and does post_send of
> a drain WR.
> 2. QP200 last WQE reached event, QP200 context is added into
> flush_list, but not drain_list since only one drain WR will be posted
> 3. QP300 ...., QP300 context is added into flush_list, but not
> drain_list
> 
> So QP100 is on drain_list, QP200, QP300 are on flush_list
> 
> In rcq poll_cq,
> 1. QP 100 drain WR cqe is polled, it will put QP100 into reap_list
> then call ipoib_cm_start_rx_drain(), post_send of QP200 drain WR, and
> QP200, QP300 are both moved from flush_list to drain_list
> 2. QP 200 drain WR cqe is polled, it will move both QP200 and QP300
> from drain_list to reap_list
> 3. QP300 cqe comes, but QP300 context has been freed, ---> panic.
> 
> Does that make sense?
> 
> Thanks
> Shirley 
> 
> _______________________________________________
> general mailing list
> general at lists.openfabrics.org
> http://lists.openfabrics.org/cgi-bin/mailman/listinfo/general
> 
> To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general


--
Eli Cohen
Mellanox Technologies LTD.
SW- Linux
Phone: +972 (4) 909 7200 (ext 276)
Mobile: +972 (54) 650 1206
E-mail: eli at mellanox.co.il

----------------------------------------------------------------------
Emails belong on computers, trees belong in forests; if you must print
this, do it on recycled paper.
http://www.greenpeace.org/international/
----------------------------------------------------------------------


Disclaimer added by CodeTwo Exchange Rules
http://www.codetwo.com



More information about the general mailing list