[ofa-general] [RFC][PATCH] IPoIB-cm: release connection if post_send drain WR failure
Shirley Ma
xma at us.ibm.com
Tue Jun 24 17:51:42 PDT 2008
Hello Roland,
In case post_send drain WR failure, release connections in stale task.
Signed-off-by: Shirley Ma <xma at us.ibm.com>
--------------------------
drivers/infiniband/ulp/ipoib/ipoib_cm.c | 11 +++++++++++
1 files changed, 11 insertions(+), 0 deletions(-)
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_cm.c b/drivers/infiniband/ulp/ipoib/ipoib_cm.c
index 442dd49..06e5933 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib_cm.c
+++ b/drivers/infiniband/ulp/ipoib/ipoib_cm.c
@@ -1344,6 +1344,17 @@ static void ipoib_cm_stale_task(struct work_struct *work)
int ret;
spin_lock_irq(&priv->lock);
+ /* in case post drain WR failure, clean up connection here */
+ while (!list_empty(&priv->cm.rx_flush_list)) {
+ /* List is sorted by LRU, start from tail,
+ * stop when we see a recently used entry */
+ p = list_entry(priv->cm.rx_flush_list.prev, typeof(*p), list);
+ p->state = IPOIB_CM_RX_ERROR;
+ if (time_before_eq(jiffies, p->jiffies + IPOIB_CM_RX_DRAIN))
+ break;
+ list_move(&p->list, &priv->cm.rx_reap_list);
+
+ }
/* wait for the CQ drain, and clean up stale connections */
while (!list_empty(&priv->cm.rx_error_list)) {
/* List is sorted by LRU, start from tail,
(See attached file: post_drain_wr_failure.patch)
Shirley
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openfabrics.org/pipermail/general/attachments/20080624/aae7b87f/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: post_drain_wr_failure.patch
Type: application/octet-stream
Size: 1190 bytes
Desc: not available
URL: <http://lists.openfabrics.org/pipermail/general/attachments/20080624/aae7b87f/attachment.obj>
More information about the general
mailing list