[MTHCA] cleaning in MR verb
authorleonidk <leonidk@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Mon, 15 May 2006 16:32:42 +0000 (16:32 +0000)
committerleonidk <leonidk@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Mon, 15 May 2006 16:32:42 +0000 (16:32 +0000)
git-svn-id: svn://openib.tc.cornell.edu/gen1/trunk@348 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86

hw/mthca/kernel/hca_memory.c
hw/mthca/kernel/mt_uverbsmem.c

index 1775cba..fe3b5ca 100644 (file)
@@ -57,7 +57,6 @@ mlnx_register_mr (
        ib_api_status_t         status;\r
        int err;\r
        struct ib_mr *mr_p;\r
-       struct mthca_mr *mro_p;\r
        struct ib_pd *ib_pd_p = (struct ib_pd *)h_pd;\r
        PREP_IBDEV_FOR_PRINT(ib_pd_p->device)\r
 \r
@@ -86,35 +85,6 @@ mlnx_register_mr (
                goto err_invalid_access; \r
        }               \r
 \r
-#ifdef WIN_TO_BE_REMOVED\r
-       // lock buffer for user\r
-       if (um_call) {\r
-               err = iobuf_register(\r
-                       (UINT_PTR)p_mr_create->vaddr,\r
-                       p_mr_create->length,\r
-                       um_call,\r
-                       (int)p_mr_create->access_ctrl,\r
-                       &iobuf );\r
-               if (err) {\r
-                       HCA_PRINT(TRACE_LEVEL_ERROR ,HCA_DBG_MEMORY,\r
-                               ("iobuf_register failed(%d)\n",err));\r
-                       status = errno_to_iberr(err);\r
-                       goto err_lock;\r
-               }\r
-       }\r
-       \r
-       // prepare parameters\r
-       RtlZeroMemory(&region, sizeof(region));\r
-       RtlZeroMemory(&umv_buf, sizeof(umv_buf));\r
-       region.user_base = (u64)p_mr_create->vaddr;\r
-       region.virt_base = (u64)p_mr_create->vaddr;\r
-       region.page_size = PAGE_SIZE;\r
-       region.length = p_mr_create->length;\r
-       region.offset = p_mr_create->vaddr & (PAGE_SIZE - 1);\r
-       //TODO: end filling region (add list of chunks)\r
-       //TODO: fill umv_buf\r
-#endif \r
-\r
        // register mr \r
        mr_p = ibv_reg_mr(ib_pd_p, map_qp_ibal_acl(p_mr_create->access_ctrl), \r
                p_mr_create->vaddr, p_mr_create->length, \r
@@ -128,21 +98,12 @@ mlnx_register_mr (
        }\r
 \r
        // results\r
-       mro_p = (struct mthca_mr *)mr_p;\r
-#ifdef WIN_TO_BE_REMOVED\r
-       mro_p->iobuf = iobuf;\r
-#endif\r
        *p_lkey = mr_p->lkey;\r
        *p_rkey = cl_hton32( mr_p->rkey );\r
        if (ph_mr)      *ph_mr = (ib_mr_handle_t)mr_p;\r
        status = IB_SUCCESS;\r
 \r
 err_reg_mr:\r
-#ifdef WIN_TO_BE_REMOVED\r
-       if (um_call) \r
-               iobuf_deregister(&iobuf );\r
-err_lock:\r
-#endif \r
 err_invalid_access:    \r
 err_invalid_parm:\r
 err_unsupported:\r
@@ -317,15 +278,6 @@ mlnx_deregister_mr (
                        goto err_unsupported;\r
        } \r
 \r
-#ifdef WIN_TO_BE_REMOVED       \r
-       // unlock user buffer\r
-       {\r
-               struct mthca_mr *mro_p = (struct mthca_mr *)h_mr;\r
-               if (mro_p->ibmr.uobject) \r
-                       iobuf_deregister( &mro_p->iobuf );\r
-       }\r
-#endif \r
-\r
        // deregister   \r
        err = ibv_dereg_mr((struct ib_mr *)h_mr);\r
        if (err) {\r
index 6dce471..8ca9649 100644 (file)
@@ -88,7 +88,7 @@ int ibv_umem_get(struct ib_device *dev, struct ib_umem *mem,
                chunk = kzalloc(sizeof *chunk + sizeof (struct scatterlist) *
                                IB_UMEM_MAX_PAGE_CHUNK, GFP_KERNEL);
                if (!chunk) 
-                       goto err_kmalloc;
+                       goto out;
                list_add_tail(&chunk->list, &mem->chunk_list);
 
                /* fill the chunk */