Hello Roland,

      I am sorry I missed one line during splitting so regenrate this
patch.

This patch releases all staled connections, otherwise all statled connections
will remain untill the nodes down or IPoIB module being removed. It causes
waste lots of resource in the long run.

Signed-off-by: Shirley Ma <[EMAIL PROTECTED]>
---------------------

 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 ae67379..9bc12ea 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib_cm.c
+++ b/drivers/infiniband/ulp/ipoib/ipoib_cm.c
@@ -61,6 +61,7 @@ MODULE_PARM_DESC(cm_data_debug_level,

 #define IPOIB_CM_RX_UPDATE_TIME (256 * HZ)
 #define IPOIB_CM_RX_TIMEOUT     (2 * 256 * HZ)
+#define IPOIB_CM_RX_DRAIN    (60 * HZ)
 #define IPOIB_CM_RX_DELAY       (3 * 256 * HZ)
 #define IPOIB_CM_RX_UPDATE_MASK (0x3)

@@ -1343,6 +1344,15 @@ static void ipoib_cm_stale_task(struct work_struct *work)
      int ret;

      spin_lock_irq(&priv->lock);
+     /* 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,
+            * stop when we see a recently used entry */
+           p = list_entry(priv->cm.rx_error_list.prev, typeof(*p), list);
+           if (time_before_eq(jiffies, p->jiffies + IPOIB_CM_RX_DRAIN))
+                 break;
+           list_move(&p->list, &priv->cm.rx_reap_list);
+     }
      while (!list_empty(&priv->cm.passive_ids)) {
            /* List is sorted by LRU, start from tail,
             * stop when we see a recently used entry */
@@ -1351,6 +1361,7 @@ static void ipoib_cm_stale_task(struct work_struct *work)
                  break;
            list_move(&p->list, &priv->cm.rx_error_list);
            p->state = IPOIB_CM_RX_ERROR;
+           p->jiffies = jiffies;
            spin_unlock_irq(&priv->lock);
            ret = ib_modify_qp(p->qp, &ipoib_cm_err_attr, IB_QP_STATE);
            if (ret)

(See attached file: stale_connection_cleanup.patch)

Thanks
Shirley

Attachment: stale_connection_cleanup.patch
Description: Binary data

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

To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general

Reply via email to