<html><body>
<p>Hello Roland,<br>
<br>
This patch releases all staled connections, otherwise all statled connections<br>
will remain untill the nodes down or IPoIB module being removed. It causes <br>
waste lots of resource in the long run.<br>
<br>
Signed-off-by: Shirley Ma <xma@us.ibm.com><br>
---------------------<br>
<br>
drivers/infiniband/ulp/ipoib/ipoib_cm.c | 10 ++++++++++<br>
1 files changed, 10 insertions(+), 0 deletions(-)<br>
<br>
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_cm.c b/drivers/infiniband/ulp/ipoib/ipoib_cm.c<br>
index ae67379..442dd49 100644<br>
--- a/drivers/infiniband/ulp/ipoib/ipoib_cm.c<br>
+++ b/drivers/infiniband/ulp/ipoib/ipoib_cm.c<br>
@@ -61,6 +61,7 @@ MODULE_PARM_DESC(cm_data_debug_level,<br>
<br>
#define IPOIB_CM_RX_UPDATE_TIME (256 * HZ)<br>
#define IPOIB_CM_RX_TIMEOUT (2 * 256 * HZ)<br>
+#define IPOIB_CM_RX_DRAIN (60 * HZ)<br>
#define IPOIB_CM_RX_DELAY (3 * 256 * HZ)<br>
#define IPOIB_CM_RX_UPDATE_MASK (0x3)<br>
<br>
@@ -1343,6 +1344,15 @@ static void ipoib_cm_stale_task(struct work_struct *work)<br>
int ret;<br>
<br>
spin_lock_irq(&priv->lock);<br>
+ /* wait for the CQ drain, and clean up stale connections */<br>
+ while (!list_empty(&priv->cm.rx_error_list)) {<br>
+ /* List is sorted by LRU, start from tail,<br>
+ * stop when we see a recently used entry */<br>
+ p = list_entry(priv->cm.rx_error_list.prev, typeof(*p), list);<br>
+ if (time_before_eq(jiffies, p->jiffies + IPOIB_CM_RX_DRAIN))<br>
+ break;<br>
+ list_move(&p->list, &priv->cm.rx_reap_list);<br>
+ }<br>
while (!list_empty(&priv->cm.passive_ids)) {<br>
/* List is sorted by LRU, start from tail,<br>
* stop when we see a recently used entry */<br>
<br>
<i>(See attached file: stale_connection_cleanup.patch)</i><br>
<br>
<br>
Thanks<br>
Shirley</body></html>