[openib-general] Re: [PATCH] uDAPL common code fix for default attribute settings
James Lentini
jlentini at netapp.com
Mon Aug 29 07:51:54 PDT 2005
On Thu, 25 Aug 2005, Arlin Davis wrote:
arlin> James,
arlin>
arlin> Please review this common code patch that fixes default
arlin> settings so they don't exceed device maximums.
arlin>
arlin> Thanks,
arlin>
arlin> -arlin
I've moved the check into dapli_ep_default_attrs() so all future
callers will also benefit from this.
Index: dapl/common/dapl_ep_util.c
===================================================================
--- dapl/common/dapl_ep_util.c (revision 3231)
+++ dapl/common/dapl_ep_util.c (working copy)
@@ -260,7 +260,9 @@ void
dapli_ep_default_attrs (
IN DAPL_EP *ep_ptr )
{
+ DAT_EP_ATTR ep_attr_limit;
DAT_EP_ATTR *ep_attr;
+ DAT_RETURN dat_status;
ep_attr = &ep_ptr->param.ep_attr;
/* Set up defaults */
@@ -295,7 +297,36 @@ dapli_ep_default_attrs (
* - provider_specific_params: 0
*/
- return;
+ dat_status = dapls_ib_query_hca (ep_ptr->header.owner_ia->hca_ptr,
+ NULL, &ep_attr_limit, NULL);
+ /* check against HCA maximums */
+ if (dat_status == DAT_SUCCESS)
+ {
+ ep_ptr->param.ep_attr.max_mtu_size =
+ DAPL_MIN(ep_ptr->param.ep_attr.max_mtu_size,
+ ep_attr_limit.max_mtu_size);
+ ep_ptr->param.ep_attr.max_rdma_size =
+ DAPL_MIN(ep_ptr->param.ep_attr.max_rdma_size,
+ ep_attr_limit.max_rdma_size);
+ ep_ptr->param.ep_attr.max_recv_dtos =
+ DAPL_MIN(ep_ptr->param.ep_attr.max_recv_dtos,
+ ep_attr_limit.max_recv_dtos);
+ ep_ptr->param.ep_attr.max_request_dtos =
+ DAPL_MIN(ep_ptr->param.ep_attr.max_request_dtos,
+ ep_attr_limit.max_request_dtos);
+ ep_ptr->param.ep_attr.max_recv_iov =
+ DAPL_MIN(ep_ptr->param.ep_attr.max_recv_iov,
+ ep_attr_limit.max_recv_iov);
+ ep_ptr->param.ep_attr.max_request_iov =
+ DAPL_MIN(ep_ptr->param.ep_attr.max_request_iov,
+ ep_attr_limit.max_request_iov);
+ ep_ptr->param.ep_attr.max_rdma_read_in =
+ DAPL_MIN(ep_ptr->param.ep_attr.max_rdma_read_in,
+ ep_attr_limit.max_rdma_read_in);
+ ep_ptr->param.ep_attr.max_rdma_read_out =
+ DAPL_MIN(ep_ptr->param.ep_attr.max_rdma_read_out,
+ ep_attr_limit.max_rdma_read_out);
+ }
}
More information about the general
mailing list