staging: lustre: o2iblnd: Fix FastReg map/unmap for MLX5
authorDoug Oucharek <dougso@me.com>
Wed, 2 May 2018 03:49:18 +0000 (23:49 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 7 May 2018 01:44:47 +0000 (18:44 -0700)
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>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-9472
Reviewed-on: https://review.whamcloud.com/27015
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>
Signed-off-by: Doug Oucharek <dougso@me.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c
drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c

index 959e119384df283162fd1ecd2195f9bf7a472625..cace9ba6f4745cde7ef79e2989a19bfd24197c3f 100644 (file)
@@ -1702,7 +1702,7 @@ int kiblnd_fmr_pool_map(struct kib_fmr_poolset *fps, struct kib_tx *tx,
                                return 0;
                        }
                        spin_unlock(&fps->fps_lock);
-                       rc = -EBUSY;
+                       rc = -EAGAIN;
                }
 
                spin_lock(&fps->fps_lock);
index b4a182d87ae7c937057867a3c42d038739a0880e..f2454810d15dbfc682808e7fc0c3a165dbeb8bf3 100644 (file)
@@ -48,7 +48,7 @@ static int kiblnd_init_rdma(struct kib_conn *conn, struct kib_tx *tx, int type,
                            __u64 dstcookie);
 static void kiblnd_queue_tx_locked(struct kib_tx *tx, struct kib_conn *conn);
 static void kiblnd_queue_tx(struct kib_tx *tx, struct kib_conn *conn);
-static void kiblnd_unmap_tx(struct lnet_ni *ni, struct kib_tx *tx);
+static void kiblnd_unmap_tx(struct kib_tx *tx);
 static void kiblnd_check_sends_locked(struct kib_conn *conn);
 
 static void
@@ -66,7 +66,7 @@ kiblnd_tx_done(struct lnet_ni *ni, struct kib_tx *tx)
        LASSERT(!tx->tx_waiting);             /* mustn't be awaiting peer response */
        LASSERT(tx->tx_pool);
 
-       kiblnd_unmap_tx(ni, tx);
+       kiblnd_unmap_tx(tx);
 
        /* tx may have up to 2 lnet msgs to finalise */
        lntmsg[0] = tx->tx_lntmsg[0]; tx->tx_lntmsg[0] = NULL;
@@ -591,13 +591,9 @@ kiblnd_fmr_map_tx(struct kib_net *net, struct kib_tx *tx, struct kib_rdma_desc *
        return 0;
 }
 
-static void kiblnd_unmap_tx(struct lnet_ni *ni, struct kib_tx *tx)
+static void kiblnd_unmap_tx(struct kib_tx *tx)
 {
-       struct kib_net *net = ni->ni_data;
-
-       LASSERT(net);
-
-       if (net->ibn_fmr_ps)
+       if (tx->fmr.fmr_pfmr || tx->fmr.fmr_frd)
                kiblnd_fmr_pool_unmap(&tx->fmr, tx->tx_status);
 
        if (tx->tx_nfrags) {