[ofa-general] [PATCH 2/7][v1.2] dapl: remove unused iov buffer allocation on the endpoint

Davis, Arlin R arlin.r.davis at intel.com
Fri Jun 20 11:43:26 PDT 2008


provider's manage iov space on stack during posting.

Signed-off by: Arlin Davis ardavis at ichips.intel.com
---
 dapl/common/dapl_ep_modify.c |   82
------------------------------------------
 dapl/common/dapl_ep_util.c   |   46 -----------------------
 dapl/include/dapl.h          |    5 ---
 3 files changed, 0 insertions(+), 133 deletions(-)

diff --git a/dapl/common/dapl_ep_modify.c b/dapl/common/dapl_ep_modify.c
index f2628af..74e3331 100644
--- a/dapl/common/dapl_ep_modify.c
+++ b/dapl/common/dapl_ep_modify.c
@@ -95,15 +95,11 @@ dapl_ep_modify (
     DAT_BOOLEAN				qp_allocated =
DAT_FALSE;
     DAT_BOOLEAN				rqst_cb_allocated =
DAT_FALSE;
     DAT_BOOLEAN				recv_cb_allocated =
DAT_FALSE;
-    DAT_BOOLEAN				rqst_iov_allocated =
DAT_FALSE;
-    DAT_BOOLEAN				recv_iov_allocated =
DAT_FALSE;
 
     /* Flag indicating we've used (assigned to QP) a new one of these.
*/
     DAT_BOOLEAN				qp_used = DAT_FALSE;
     DAT_BOOLEAN				rqst_cb_used =
DAT_FALSE;
     DAT_BOOLEAN				recv_cb_used =
DAT_FALSE;
-    DAT_BOOLEAN				rqst_iov_used =
DAT_FALSE;
-    DAT_BOOLEAN				recv_iov_used =
DAT_FALSE;
 
     dat_status = dapli_ep_modify_validate_parameters ( ep_handle,
     						      ep_param_mask,
@@ -171,39 +167,6 @@ dapl_ep_modify (
     }
     recv_cb_allocated = DAT_TRUE;
 
-    alloc_ep.send_iov_num = 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.send_iov == NULL )
-    {
-	dat_status = DAT_ERROR (DAT_INSUFFICIENT_RESOURCES,
DAT_RESOURCE_MEMORY);
-	goto bail;
-    }
-    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
-					* sizeof (ib_data_segment_t));
-    if ( alloc_ep.recv_iov == NULL )
-    {
-	dat_status = DAT_ERROR (DAT_INSUFFICIENT_RESOURCES,
DAT_RESOURCE_MEMORY);
-	goto bail;
-    }
-    recv_iov_allocated = DAT_TRUE;
-
     dat_status = dapls_ib_qp_alloc ( ia, &alloc_ep, ep1 );
     if ( dat_status != DAT_SUCCESS )
     {
@@ -281,20 +244,6 @@ dapl_ep_modify (
 	rqst_cb_used = DAT_TRUE;
     }
 
-    if ( ep_param_mask & DAT_EP_FIELD_EP_ATTR_MAX_RECV_IOV
-	 && new_ep.recv_iov_num != ep2->recv_iov_num )
-    {
-	new_ep.recv_iov = alloc_ep.recv_iov;
-	recv_iov_used = DAT_TRUE;
-    }
-
-    if ( ep_param_mask & DAT_EP_FIELD_EP_ATTR_MAX_REQUEST_IOV
-	 && new_ep.send_iov_num != ep2->send_iov_num )
-    {
-	new_ep.send_iov = alloc_ep.send_iov;
-	recv_iov_used = DAT_TRUE;
-    }
-
     /*
      * We need to change the QP only if there already was a QP
      * (leave things the way you found them!) and one of the
@@ -439,37 +388,6 @@ bail:
 	}
     }
 
-    if ( rqst_iov_allocated )
-    {
-	if ( dat_status != DAT_SUCCESS || !rqst_iov_used )
-	{
-	    dapl_os_free ( alloc_ep.send_iov,
-			   (alloc_ep.send_iov_num
-			    * sizeof (ib_data_segment_t)));
-	}
-	else
-	{
-	    dapl_os_free ( copy_of_old_ep.send_iov,
-			   (copy_of_old_ep.send_iov_num
-			    * sizeof (ib_data_segment_t)));
-	}
-    }
-
-    if ( recv_iov_allocated )
-    {
-	if ( dat_status != DAT_SUCCESS || !recv_iov_used )
-	{
-	    dapl_os_free ( alloc_ep.recv_iov,
-			   (alloc_ep.recv_iov_num
-			    * sizeof (ib_data_segment_t)));
-	}
-	else
-	{
-	    dapl_os_free ( copy_of_old_ep.recv_iov,
-			   (copy_of_old_ep.recv_iov_num
-			    * sizeof (ib_data_segment_t)));
-	}
-    }
     return dat_status;
 }
 
diff --git a/dapl/common/dapl_ep_util.c b/dapl/common/dapl_ep_util.c
index 2bad346..4dd722e 100644
--- a/dapl/common/dapl_ep_util.c
+++ b/dapl/common/dapl_ep_util.c
@@ -151,42 +151,6 @@ dapl_ep_alloc (
 	goto bail;
     }
 
-    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));
-
-    if ( NULL == ep_ptr->recv_iov )
-    {
-	dapl_ep_dealloc (ep_ptr);
-	ep_ptr = NULL;
-	goto bail;
-    }
-
-    ep_ptr->send_iov = dapl_os_alloc (
-	ep_ptr->send_iov_num * sizeof (ib_data_segment_t));
-
-    if ( NULL == ep_ptr->send_iov )
-    {
-	dapl_ep_dealloc (ep_ptr);
-	ep_ptr = NULL;
-	goto bail;
-    }
-
     dapls_io_trc_alloc (ep_ptr);
 
 bail:
@@ -220,16 +184,6 @@ dapl_ep_dealloc (
     dapls_cb_free ( &ep_ptr->req_buffer );
     dapls_cb_free ( &ep_ptr->recv_buffer );
 
-    if ( NULL != ep_ptr->recv_iov )
-    {
-	dapl_os_free (ep_ptr->recv_iov, ep_ptr->recv_iov_num * sizeof
(ib_data_segment_t));
-    }
-
-    if ( NULL != ep_ptr->send_iov )
-    {
-	dapl_os_free (ep_ptr->send_iov, ep_ptr->send_iov_num * sizeof
(ib_data_segment_t));
-    }
-
     if ( NULL != ep_ptr->cxn_timer )
     {
 	dapl_os_free ( ep_ptr->cxn_timer, sizeof ( DAPL_OS_TIMER ) );
diff --git a/dapl/include/dapl.h b/dapl/include/dapl.h
index 45e1e8a..80c9ff3 100644
--- a/dapl/include/dapl.h
+++ b/dapl/include/dapl.h
@@ -448,11 +448,6 @@ struct dapl_ep
     DAPL_COOKIE_BUFFER		req_buffer;
     DAPL_COOKIE_BUFFER		recv_buffer;
 
-    ib_data_segment_t 		*recv_iov;
-    DAT_COUNT			recv_iov_num;
-
-    ib_data_segment_t 		*send_iov;
-    DAT_COUNT			send_iov_num;
 #ifdef DAPL_DBG_IO_TRC
     int			ibt_dumped;
     struct io_buf_track *ibt_base;
-- 
1.5.2.5




More information about the general mailing list