]> git.openfabrics.org - ~ardavis/dapl.git/commitdiff
r3069: Updates from SourceForge DAPL: size EP IOV correctly
authorJames Lentini <jlentini@netapp.com>
Thu, 11 Aug 2005 19:46:39 +0000 (19:46 +0000)
committerJames Lentini <jlentini@netapp.com>
Thu, 11 Aug 2005 19:46:39 +0000 (19:46 +0000)
Signed-off-by: James Lentini <jlentini@netapp.com>
dapl/common/dapl_ep_modify.c
dapl/common/dapl_ep_util.c

index 515c89293d32d07810623827497b83dada164d53..f2628af7aa9a33bb529541446e693a3578dc4a90 100644 (file)
@@ -172,14 +172,27 @@ dapl_ep_modify (
     recv_cb_allocated = DAT_TRUE;
 
     alloc_ep.send_iov_num = ep_attr1.max_request_iov;
-    alloc_ep.send_iov = dapl_os_alloc (ep_attr1.max_request_iov
+
+    /*
+     * Ensure that send_iov_num is big enough for all types
+     * of send requests.
+     */
+    if (ep_attr1.max_rdma_read_iov > alloc_ep.send_iov_num)
+    {
+        alloc_ep.send_iov_num = ep_attr1.max_rdma_read_iov;
+    }
+    if (ep_attr1.max_rdma_write_iov > alloc_ep.send_iov_num)
+    {
+        alloc_ep.send_iov_num = ep_attr1.max_rdma_write_iov;
+    }
+    alloc_ep.send_iov = dapl_os_alloc (alloc_ep.send_iov_num
                                        * sizeof (ib_data_segment_t));
-    if ( alloc_ep.recv_iov == NULL )
+    if ( alloc_ep.send_iov == NULL )
     {
        dat_status = DAT_ERROR (DAT_INSUFFICIENT_RESOURCES, DAT_RESOURCE_MEMORY);
        goto bail;
     }
-    recv_iov_allocated = DAT_TRUE;
+    rqst_iov_allocated = DAT_TRUE;
 
     alloc_ep.recv_iov_num = ep_attr1.max_recv_iov;
     alloc_ep.recv_iov = dapl_os_alloc (ep_attr1.max_recv_iov
@@ -734,6 +747,32 @@ dapli_ep_modify_validate_parameters (
        }
     }
 
+    if ( ep_param_mask & DAT_EP_FIELD_EP_ATTR_MAX_RDMA_READ_IOV )
+    {
+       if ( ep_attr_request.max_rdma_read_iov > ep_attr_limit.max_rdma_read_iov)
+       {
+           dat_status = DAT_ERROR (DAT_INVALID_PARAMETER, DAT_INVALID_ARG3);
+           goto bail;
+       }
+       else
+       {
+           ep_attr.max_rdma_read_iov = ep_attr_request.max_rdma_read_iov;
+       }
+    }
+
+    if ( ep_param_mask & DAT_EP_FIELD_EP_ATTR_MAX_RDMA_WRITE_IOV )
+    {
+       if ( ep_attr_request.max_rdma_write_iov > ep_attr_limit.max_rdma_write_iov)
+       {
+           dat_status = DAT_ERROR (DAT_INVALID_PARAMETER, DAT_INVALID_ARG3);
+           goto bail;
+       }
+       else
+       {
+           ep_attr.max_rdma_write_iov = ep_attr_request.max_rdma_write_iov;
+       }
+    }
+
     *ia_ptr = ia;
     *ep_ptr = ep;
     *ep_attr_ptr = ep_attr;
index d2feb9202cf2422e7a87538fff5e7ba5b54c4f8b..e019d522791e5765f83135f0d42dfe1238d759bb 100644 (file)
@@ -156,6 +156,19 @@ dapl_ep_alloc (
     ep_ptr->recv_iov_num = ep_ptr->param.ep_attr.max_recv_iov;
     ep_ptr->send_iov_num = ep_ptr->param.ep_attr.max_request_iov;
 
+    /*
+     * Ensure that send_iov_num is big enough for all types
+     * of send requests.
+     */
+    if (ep_ptr->param.ep_attr.max_rdma_read_iov > ep_ptr->send_iov_num)
+    {
+        ep_ptr->send_iov_num = ep_ptr->param.ep_attr.max_rdma_read_iov;
+    }
+    if (ep_ptr->param.ep_attr.max_rdma_write_iov > ep_ptr->send_iov_num)
+    {
+        ep_ptr->send_iov_num = ep_ptr->param.ep_attr.max_rdma_write_iov;
+    }
+
     ep_ptr->recv_iov = dapl_os_alloc (
        ep_ptr->recv_iov_num * sizeof (ib_data_segment_t));