Skip to contentSkip to conversation

ipoib: Fix lockup of the tx queue

PATCH In review Eli Cohen 5 participants 10 messages Mar 3, 2010 – Mar 16, 2010 8 messages not in the archive InfiniBand

lore
Share & tools
lore

Eli Cohen

author
#0 lore raw

PATCH 1/1 ipoib: Fix lockup of the tx queue

The ipoib UD QP reports send completions to priv->send_cq which is unarmed generally; it only gets armed when the number of outstanding send requests (e.g. those for which a completion was not polled yet) reaches the size of the tx queue. This arming (done using ib_req_notify_cq()) is done only in the send path for the UD QP. However, when sending CM packets, the net queue may be stopped for the same reasons but no measures are taken to recover the UD path from a lockup.
Consider this scenario: a host sends high rate of both CM and UD packets. Suppose also that the tx queue length is N. If at some time the number of outstanding UD packets is more than N/2 and the overall outstanding packets is N-1, and now CM sends a packet making the number of outstanding equal N, the tx queue will be stopped. When all the CM packets will complete, the number of outstanding packets will still be higher than N/2 so the tx queue will not be enabled.
Fix this by calling ib_req_notify_cq() when the queue is stopped in the CM path.

---
 drivers/infiniband/ulp/ipoib/ipoib_cm.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
drivers/infiniband/ulp/ipoib/ipoib_cm.c +2 -0
index 30bdf42..f8302c2 100644
@@ -752,6 +752,8 @@ void ipoib_cm_send(struct net_device *dev, struct sk_buff *skb, struct ipoib_cm_
 		if (++priv->tx_outstanding == ipoib_sendq_size) {
 			ipoib_dbg(priv, "TX ring 0x%x full, stopping kernel net queue\n",
 				  tx->qp->qp_num);
+			if (ib_req_notify_cq(priv->send_cq, IB_CQ_NEXT_COMP))
+				ipoib_warn(priv, "request notify on send CQ failed\n");
 			netif_stop_queue(dev);
 		}
 	}
Signature · 6 lines
1.7.0

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): 20100303122752.GA29784-8YAHvHwT2UEvbXDkjdHOrw/[email protected]

#2 lore raw

good debugging, applied thanks.

I do worry (as Moni mentioned) that this doesn't explain why you would get send failures in this case, but the patch itself is well-explained and looks "obviously correct" so I think we should apply it.

Signature · 7 lines
Roland Dreier  <[email protected]>
For corporate legal information go to:
http://www.cisco.com/web/about/doing_business/legal/cri/index.html
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): adaiq92czdt.fsf-BjVyx320WGW9gfZ95n9DRSW4+XlvGpQz@public.gmane.org

#4 lore raw
Quoted 5 lines · Roland Dreier

good debugging, applied thanks.

I do worry (as Moni mentioned) that this doesn't explain why you would get send failures in this case, but the patch itself is well-explained and looks "obviously correct" so I think we should apply it.

Well, after more testing it seems there may still be a problem. I haven't isolated it yet though. I could definitely use help reviewing the code changes.

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): 1268343670.2255.44.camel-/[email protected]

#6 lore raw

Sorry, I was referring to my patch not Eli's.

Quoted 7 lines · Ralph Campbell
Quoted 5 lines · Roland Dreier

good debugging, applied thanks.

I do worry (as Moni mentioned) that this doesn't explain why you would get send failures in this case, but the patch itself is well-explained and looks "obviously correct" so I think we should apply it.

Quoted 8 lines

Well, after more testing it seems there may still be a problem. I haven't isolated it yet though. I could definitely use help reviewing the code changes.

_______________________________________________
ewg mailing list [email protected]
http://lists.openfabrics.org/cgi-bin/mailman/listinfo/ewg

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): 1268343937.2255.46.camel-/[email protected]

#8 lore raw
Quoted 1 line

Sorry, I was referring to my patch not Eli's.

Heh, I never would have said anything about your patch was "obvious". I skimmed yours once but I do want to read it more carefully.

Did you ever say what test case you are using to provoke the problem you're fixing?

Signature · 7 lines
Roland Dreier  <[email protected]>
For corporate legal information go to:
http://www.cisco.com/web/about/doing_business/legal/cri/index.html
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): ada3a06cyqw.fsf-BjVyx320WGW9gfZ95n9DRSW4+XlvGpQz@public.gmane.org

#10 lore raw
Quoted 6 lines · Roland Dreier
Quoted 1 line

Sorry, I was referring to my patch not Eli's.

Heh, I never would have said anything about your patch was "obvious". I skimmed yours once but I do want to read it more carefully.

Did you ever say what test case you are using to provoke the problem you're fixing?

I think I did but it is just UDP stress tests in general. Throwing in some link failures and switching between connected and datagram modes helps too. netperf, qperf, etc. should work. Anything which causes the connected mode QP to fail should exercise the fix too.

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

#11 lore raw
In reply to a message not in the archive
Quoted 4 lines · Roland Dreier

I do worry (as Moni mentioned) that this doesn't explain why you would get send failures in this case, but the patch itself is well-explained and looks "obviously correct" so I think we should apply it.

It could be a problem in the hardware driver.
Josh, can you tell what kind of hardware you were using?
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): 20100314065238.GA23263-8YAHvHwT2UEvbXDkjdHOrw/[email protected]

#13 lore raw

Everything has MT264328 ConnectX cards using the mlx4_ib driver. Boot/file servers are using an HP OEM 2.7.000 firmware. Compute nodes have cards using Sun OEM 2.6.200 FW.

-JE

Quoted 9 lines · Eli Cohen
Quoted 4 lines · Roland Dreier

I do worry (as Moni mentioned) that this doesn't explain why you would get send failures in this case, but the patch itself is well-explained and looks "obviously correct" so I think we should apply it.

It could be a problem in the hardware driver. Josh, can you tell what kind of hardware you were using?

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): a72123c41003150925t173815e6lc1e94c999be45357-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org

#15 lore raw
Quoted 4 lines · Josh England

Everything has MT264328 ConnectX cards using the mlx4_ib driver. Boot/file servers are using an HP OEM 2.7.000 firmware. Compute nodes have cards using Sun OEM 2.6.200 FW.

You probably mean MT26428? Anyway, do you still see the post send failed messages? If you do, could you apply this patch so we'll have better insight as for the reason?
http://patchwork.kernel.org/patch/83593/
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): 20100316063323.GA1887-8YAHvHwT2UEvbXDkjdHOrw/[email protected]

#17 lore raw
Quoted 7 lines · Eli Cohen
Quoted 4 lines · Josh England

Everything has MT264328 ConnectX cards using the mlx4_ib driver. Boot/file servers are using an HP OEM 2.7.000 firmware.  Compute nodes have cards using Sun OEM 2.6.200 FW.

You probably mean MT26428?

Yeah...threw an extra digit in there...

Quoted 4 lines

Anyway, do you still see the post send
failed messages? If you do, could you apply this patch so we'll have better insight as for the reason?
http://patchwork.kernel.org/patch/83593/

I'll throw the patch in and try to get some datagram-mode testing in soon. I haven't gone back since the CM code fix.

-JE
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html