Whamcloud - gitweb
LU-9472 lnd: Fix FastReg map/unmap for MLX5 15/27015/2
authorDoug Oucharek <doug.s.oucharek@intel.com>
Tue, 9 May 2017 18:07:37 +0000 (11:07 -0700)
committerOleg Drokin <oleg.drokin@intel.com>
Sat, 20 May 2017 18:44:01 +0000 (18:44 +0000)
The FastReg support in ko2iblnd was not unmapping pool items
causing the items to leak.  In addition, the mapping code
is not growing the pool like we do with FMR.

This patch makes sure we are unmapping FastReg pool elements
when we are done with them.  It also makes sure the pool
will grow when we depleat the pool.

Signed-off-by: Doug Oucharek <doug.s.oucharek@intel.com>
Change-Id: I4b4ba4de72941b38c4115a00a992cfd1e78e9e49
Reviewed-on: https://review.whamcloud.com/27015
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Andrew Perepechko <andrew.perepechko@seagate.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lnet/klnds/o2iblnd/o2iblnd.c
lnet/klnds/o2iblnd/o2iblnd_cb.c

index 3e49866..70ed74f 100644 (file)
@@ -1949,7 +1949,7 @@ again:
                                return 0;
                        }
                        spin_unlock(&fps->fps_lock);
-                       rc = -EBUSY;
+                       rc = -EAGAIN;
                }
 
                spin_lock(&fps->fps_lock);
index 31670ac..33bbb28 100644 (file)
@@ -596,14 +596,14 @@ kiblnd_fmr_map_tx(kib_net_t *net, kib_tx_t *tx, kib_rdma_desc_t *rd, __u32 nob)
 static void
 kiblnd_unmap_tx(kib_tx_t *tx)
 {
-       if (tx->fmr.fmr_pfmr != NULL)
+       if (tx->fmr.fmr_pfmr || tx->fmr.fmr_frd)
                kiblnd_fmr_pool_unmap(&tx->fmr, tx->tx_status);
 
-        if (tx->tx_nfrags != 0) {
-                kiblnd_dma_unmap_sg(tx->tx_pool->tpo_hdev->ibh_ibdev,
-                                    tx->tx_frags, tx->tx_nfrags, tx->tx_dmadir);
-                tx->tx_nfrags = 0;
-        }
+       if (tx->tx_nfrags != 0) {
+               kiblnd_dma_unmap_sg(tx->tx_pool->tpo_hdev->ibh_ibdev,
+                                   tx->tx_frags, tx->tx_nfrags, tx->tx_dmadir);
+               tx->tx_nfrags = 0;
+       }
 }
 
 static int