dapl_tavor_ibtf_dto.c revision 9e39c5ba00a55fa05777cc94b148296af305e135
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#include "dapl.h"
#include "dapl_adapter_util.h"
#include "dapl_lmr_util.h"
#include "dapl_rmr_util.h"
#include "dapl_cookie.h"
#include "dapl_tavor_ibtf_impl.h"
/*
*
*
* MODULE: dapl_tavor_ibtf_dto.c
*
* PURPOSE: Utility routines for data transfer operations
*
*/
/*
* dapls_ib_post_recv
*
* Provider specific Post RECV function
*/
{
int retval;
int i;
total_len = 0;
"qp_handle == NULL\n");
return (DAT_INVALID_PARAMETER);
}
/* allocate scatter-gather list on the heap if its large */
if (num_segments > DAPL_MAX_IOV) {
"dapls_ib_post_recv: pr_sgl alloc failed");
return (DAT_INSUFFICIENT_RESOURCES);
}
} else {
pr_sgl = pr_sgl_arr;
}
for (i = 0; i < num_segments; i++) {
"i(%d) va(%p), lmrctxt(0x%x), len(%llu)\n", i,
}
"dapls_ib_post_recv: dto_cookie(%p), num_seg(%d), "
}
if (num_segments > 0) {
} else {
}
/* This flag is used to control notification of completions */
} else {
/*
* The evd waiter will use threshold to control wakeups
* Hence the event notification will be done via arming the
* CQ so we do not need special notification generation
* hence set suppression to true
*/
}
if (retval != 0) {
"dapls_ib_post_recv: post_recv failed %s\n",
}
/* free the pr_sgl if we had allocated it */
if (num_segments > DAPL_MAX_IOV) {
}
return (retval);
}
/*
* dapls_ib_post_recv_one
*
* Provider specific Post RECV function
*/
{
int retval;
"qp_handle == NULL\n");
return (DAT_INVALID_PARAMETER);
}
"va(%p), lmrctxt(0x%x), len(%llu)\n",
"dapls_ib_post_recv_one: dto_cookie(%p), num_seg(1), "
"size(%d) hkey(%016llx)\n", cookie,
}
/* This flag is used to control notification of completions */
} else {
/*
* The evd waiter will use threshold to control wakeups
* Hence the event notification will be done via arming the
* CQ so we do not need special notification generation
* hence set suppression to true
*/
}
if (retval != 0) {
"dapls_ib_post_recv_one: post_recv failed %s\n",
}
return (retval);
}
/*
* dapls_ib_srq_post_recv
*
* Provider specific SRQ Post RECV function
*/
{
int retval;
int i;
total_len = 0;
"srq_handle == NULL\n");
return (DAT_INVALID_PARAMETER);
}
/* allocate scatter-gather list on the heap if its large */
if (num_segments > DAPL_MAX_IOV) {
"dapls_ib_post_srq: pr_sgl alloc failed");
return (DAT_INSUFFICIENT_RESOURCES);
}
} else {
pr_sgl = pr_sgl_arr;
}
for (i = 0; i < num_segments; i++) {
"i(%d) va(%p), lmrctxt(0x%x), len(%u)\n", i,
}
"dapls_ib_post_srq: dto_cookie(%p), num_seg(%d), "
}
if (num_segments > 0) {
} else {
}
if (retval != 0) {
"dapls_ib_post_srq: post_recv failed %s\n",
}
/* free the pr_sgl if we had allocated it */
if (num_segments > DAPL_MAX_IOV) {
}
return (retval);
}
/*
* dapls_ib_post_send
*
* Provider specific Post SEND function
*/
{
int retval;
int i;
total_len = 0;
"qp_handle == NULL\n");
return (DAT_INVALID_PARAMETER);
}
/* allocate scatter-gather list on the heap if its large */
if (num_segments > DAPL_MAX_IOV) {
"dapls_ib_post_send: pr_sgl alloc failed");
return (DAT_INSUFFICIENT_RESOURCES);
}
} else {
ps_sgl = ps_sgl_arr;
}
for (i = 0; i < num_segments; i++) {
"i(%d), va(0x%llx), lmrctxt(0x%x), len(%u)\n",
}
"dapls_ib_post_send: op_type(%d), cookie(%p) "
"num_seg(%d) size(%d) hkey(%016llx)\n", op_type,
}
/* Translate dapl flags */
completion_flags) ? IBT_WR_SEND_FENCE : 0;
/* suppress completions */
completion_flags) ? 0 : IBT_WR_SEND_SIGNAL;
/* Solicited wait flag is valid only for post_send */
completion_flags) ? IBT_WR_SEND_SOLICIT : 0;
}
if (num_segments > 0) {
if (remote_iov == NULL) {
/* free the ps_sgl if we had allocated it */
if (num_segments > DAPL_MAX_IOV) {
num_segments*sizeof (ibt_wr_ds_t));
}
"dapls_ib_post_send: "
"remote_iov == NULL\n");
return (DAT_INVALID_PARAMETER);
}
/* free the ps_sgl if we had allocated it */
if (num_segments > DAPL_MAX_IOV) {
num_segments*sizeof (ibt_wr_ds_t));
}
"dapls_ib_post_send: "
"remote_iov length(%llu != %llu)\n",
return (DAT_LENGTH_ERROR);
}
"dapls_ib_post_send: remote_iov taddr(0x%llx), "
}
} else {
}
/* This flag is used to control notification of completions */
} else {
/*
* The evd waiter will use threshold to control wakeups
* Hence the event notification will be done via arming the
* CQ so we do not need special notification generation
* hence set suppression to true
*/
}
if (retval != 0) {
"dapls_ib_post_send: post_send failed %d\n", retval);
}
/* free the pr_sgl if we had allocated it */
if (num_segments > DAPL_MAX_IOV) {
}
return (retval);
}
/*
* dapls_ib_post_send_one
*
* Provider specific Post SEND function - special case for the common case of
* sgl num_segments == 1 and completion_flags == DAT_COMPLETION_DEFAULT_FLAG.
*/
{
int retval;
"qp_handle == NULL\n");
return (DAT_INVALID_PARAMETER);
}
"i(%d), va(0x%llx), lmrctxt(0x%x), len(%u)\n",
"dapls_ib_post_send_one: op_type(%d), cookie(%p) "
"num_seg(%d) size(%d) hkey(%016llx)\n", op_type,
/* suppress completions */
if (remote_iov == NULL) {
/* free the ps_sgl if we had allocated it */
"dapls_ib_post_send_one: "
"remote_iov == NULL\n");
return (DAT_INVALID_PARAMETER);
}
"dapls_ib_post_send_one: "
"remote_iov length(%llu != %llu)\n",
return (DAT_LENGTH_ERROR);
}
"dapls_ib_post_send_one: remote_iov taddr(0x%llx), "
}
/* This flag is used to control notification of completions */
} else {
/*
* The evd waiter will use threshold to control wakeups
* Hence the event notification will be done via arming the
* CQ so we do not need special notification generation
* hence set suppression to true
*/
}
if (retval != 0) {
"dapls_ib_post_send_one: post_send failed %d\n", retval);
}
return (retval);
}