Programatically force a map-unmap without a post.

From: root <root@opahsx121.cornelisnetworks.com>


---
 lnet/klnds/o2iblnd/o2iblnd_cb.c |   13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/lnet/klnds/o2iblnd/o2iblnd_cb.c b/lnet/klnds/o2iblnd/o2iblnd_cb.c
index 15e757d999..6b19b7ba77 100644
--- a/lnet/klnds/o2iblnd/o2iblnd_cb.c
+++ b/lnet/klnds/o2iblnd/o2iblnd_cb.c
@@ -610,6 +610,10 @@ kiblnd_fmr_map_tx(struct kib_net *net, struct kib_tx *tx,
 #endif
 
 	fps = net->ibn_fmr_ps[cpt];
+{
+static unsigned int tx_count;
+
+again:
 	rc = kiblnd_fmr_pool_map(fps, tx, rd, nob, 0, &tx->tx_fmr);
 	if (rc != 0) {
 		CERROR("Can't map %u bytes (%u/%u)s: %d\n", nob,
@@ -617,6 +621,15 @@ kiblnd_fmr_map_tx(struct kib_net *net, struct kib_tx *tx,
 		return rc;
 	}
 
+	if (tx_count++ == 100) {
+		printk("%s: forcing map-unmap on mr 0x%lx\n",
+			__func__,
+			(unsigned long)tx->tx_fmr.fmr_frd->frd_mr);
+		// the status argument is not used for FRWR
+		kiblnd_fmr_pool_unmap(&tx->tx_fmr, 0);
+		goto again;
+	}
+}
 	/*
 	 * If rd is not tx_rd, it's going to get sent to a peer_ni, who will
 	 * need the rkey
