Whamcloud - gitweb
LU-6245 libcfs: remove sysctl module handling
[fs/lustre-release.git] / lnet / klnds / o2iblnd / o2iblnd.c
index e458797..b6396d2 100644 (file)
@@ -1517,14 +1517,22 @@ static int kiblnd_alloc_freg_pool(kib_fmr_poolset_t *fps, kib_fmr_pool_t *fpo)
                        rc = PTR_ERR(frd->frd_frpl);
                        CERROR("Failed to allocate ib_fast_reg_page_list: %d\n",
                                rc);
+                       frd->frd_frpl = NULL;
                        goto out_middle;
                }
 
+#ifdef HAVE_IB_ALLOC_FAST_REG_MR
                frd->frd_mr = ib_alloc_fast_reg_mr(fpo->fpo_hdev->ibh_pd,
                                                   LNET_MAX_PAYLOAD/PAGE_SIZE);
+#else
+               frd->frd_mr = ib_alloc_mr(fpo->fpo_hdev->ibh_pd,
+                                         IB_MR_TYPE_MEM_REG,
+                                         LNET_MAX_PAYLOAD/PAGE_SIZE);
+#endif
                if (IS_ERR(frd->frd_mr)) {
                        rc = PTR_ERR(frd->frd_mr);
                        CERROR("Failed to allocate ib_fast_reg_mr: %d\n", rc);
+                       frd->frd_mr = NULL;
                        goto out_middle;
                }
 
@@ -3162,7 +3170,6 @@ static lnd_t the_o2iblnd = {
 static void __exit ko2iblnd_exit(void)
 {
        lnet_unregister_lnd(&the_o2iblnd);
-       kiblnd_tunables_fini();
 }
 
 static int __init ko2iblnd_init(void)