ibtl_chan.c revision f07a6d2ab62592f08fb2856d7426d06ea26d999b
299N/A * The contents of this file are subject to the terms of the 299N/A * Common Development and Distribution License (the "License"). 299N/A * You may not use this file except in compliance with the License. 299N/A * See the License for the specific language governing permissions 299N/A * and limitations under the License. 299N/A * When distributing Covered Code, include this CDDL HEADER in each 299N/A * If applicable, add the following below this CDDL HEADER, with the 299N/A * fields enclosed by brackets "[]" replaced with your own identifying 299N/A * information: Portions Copyright [yyyy] [name of copyright owner] 299N/A * Copyright 2009 Sun Microsystems, Inc. All rights reserved. 299N/A * Use is subject to license terms. 299N/A * This file contains Transport API functions related to Channel Functions 299N/A * and internal Protection Domain and Address Handle Verbs functions. 299N/A * flags Channel allocate flags. 299N/A * args A pointer to an ibt_rc_chan_alloc_args_t struct that 299N/A * specifies required channel attributes. 299N/A * rc_chan_p The returned RC Channel handle. 299N/A * sizes NULL or a pointer to ibt_chan_sizes_s struct where 299N/A * Allocates a RC communication channels that satisfy the specified "NULL SRQ Handle specified.");
* Check if this request is to clone the channel, or to allocate a "Clone Channel info not available.");
"Clone Channel's & requested HCA Handle mismatch");
* Query the source channel, to obtained the attributes * so that the new channel share the same attributes. "Failed to query the source channel: %d",
retval);
/* Setup QP alloc attributes. */ /* Setup QP alloc attributes. */ "Invalid port_num %d, range is (1 to %d)",
* We allocate the Channel initially with the default PKey, * and later client can update this when the channel is opened * with the pkey returned from a path record lookup. /* Allocate Channel and Initialize the channel. */ "Failed to allocate QP: %d",
retval);
/* Initialize RC Channel by transitioning it to INIT State. */ "Failed to Initialize QP: %d",
retval);
/* Free the QP as we failed to initialize it. */ * rc_chan A previously allocated channel handle. * chan_attrs A pointer to an ibt_rc_chan_query_args_t struct where * Channel's current attributes are returned. * chan_attrs A pointer to an ibt_rc_chan_query_args_t struct where * Channel's current attributes are returned. * Query an RC channel's attributes. /* Query the channel (QP) */ * rc_chan A previously allocated channel handle. * flags Specifies which attributes in ibt_rc_chan_modify_attr_t * attrs Attributes to be modified. * actual_sz On return contains the new send and receive queue sizes. * Modifies an RC channel's attributes, as specified by a * ibt_cep_modify_flags_t parameter to those specified in the * ibt_rc_chan_modify_attr_t structure. /* Current channel state must be either SQD or RTS. */ /* give it one more shot if the old current state was stale */ * flags Channel allocate flags. * args A pointer to an ibt_ud_chan_alloc_args_t struct that * specifies required channel attributes. * ud_chan_p The returned UD Channel handle. * sizes NULL or a pointer to ibt_chan_sizes_s struct where * Allocate UD channels that satisfy the specified channel attributes. "NULL SRQ Handle specified.");
* Check if this request is to clone the channel, or to allocate a "Clone Channel info not available.");
"Clone Channel and HCA Handle mismatch");
"Failed to Query the source channel: %d",
retval);
/* Setup QP alloc attributes. */ /* Setup QP alloc attributes. */ /* Validate input hca_port_num and pkey_ix values. */ "ibt_index2pkey failed, status: %d",
retval);
/* Allocate Channel and Initialize the channel. */ "Failed to allocate QP: %d",
retval);
/* Initialize UD Channel by transitioning it to RTS State. */ "Failed to Initialize QP: %d",
retval);
/* Free the QP as we failed to initialize it. */ * ud_chan A previously allocated UD channel handle. * chan_attrs Channel's current attributes. * Query a UD channel's attributes. /* Query the channel (QP) */ * ud_chan A previously allocated UD channel handle. * flags Specifies which attributes in ibt_ud_chan_modify_attr_t * attrs Attributes to be modified. * actual_sz On return contains the new send and receive queue sizes. * Modifies an UD channel's attributes, as specified by a * ibt_cep_modify_flags_t parameter to those specified in the * ibt_ud_chan_modify_attr_t structure. "Invalid Modify Flags: %x",
flags);
/* give it one more shot if the old current state was stale */ * ud_chan An UD channel handle which is in SQError state. * IBT_CHAN_SRV_TYPE_INVALID * Recover an UD Channel which has transitioned to SQ Error state. The * ibt_recover_ud_channel() transitions the channel from SQ Error state * to Ready-To-Send channel state. * If a work request posted to a UD channel's send queue completes with * an error (see ibt_wc_status_t), the channel gets transitioned to SQ * Error state. In order to reuse this channel, ibt_recover_ud_channel() * can be used to recover the channel to a usable (Ready-to-Send) state. /* Set the channel state to RTS, to activate the send processing. */ "ibt_modify_qp failed on qp %p: status = %d",
* chan The opaque channel handle returned in a previous call * to ibt_alloc_ud_channel() or ibt_alloc_rc_channel(). * Flush the specified channel. Outstanding work requests are flushed * so that the client can do the associated clean up. After that, the * client will usually deregister the previously registered memory, * then free the channel by calling ibt_free_channel(). This function * applies to UD channels, or to RC channels that have not successfully "ibt_flush_qp failed on QP %p: %d",
chan,
retval);
* chan The opaque channel handle returned in a previous * call to ibt_alloc_{ud,rc}_channel(). * Releases the resources associated with the specified channel. * It is well assumed that channel has been closed before this. * ud_dest_p Address to store the returned UD destination handle. * Allocate a UD destination handle. The returned UD destination handle * has no useful contents, but is usable after calling ibt_modify_ud_dest, * ibt_modify_reply_ud_dest, or ibt_open_ud_dest. "Address Handle Allocation failed: %d",
retval);
* ud_dest A previously allocated UD destination handle. * dest_attrs UD destination's current attributes. * Query a UD destination's attributes. /* Query Address Handle */ "Failed to Query Address Handle: %d",
retval);
/* Update the return struct. */ * ud_dest A previously allocated UD destination handle * as returned by ibt_alloc_ud_dest(). * qkey QKey of the destination. * dest_qpn QPN of the destination. * adds_vect NULL or Address Vector for the destination. * Modify a previously allocated UD destination handle from the * arguments supplied by the caller. "ibt_modify_ah() failed: status = %d",
retval);
* ud_dest The opaque destination handle returned in a previous * call to ibt_alloc_ud_dest() or ibt_alloc_mcg_dest(). * Releases the resources associated with the specified destination "Address Handle free failed: %d",
retval);
* ibt_modify_reply_ud_dest * ud_dest A previously allocated UD reply destination handle * as returned by ibt_alloc_ud_dest(). * qkey Qkey. 0 means "not specified", so use the Q_Key * recv_buf Pointer to the first data buffer associated with the * Modify a previously allocated UD destination handle, so that it * can be used to reply to the sender of the datagram contained in the * specified work request completion. If the qkey is not supplied (0), * then use the qkey in the QP (we just set qkey to a privileged QKEY). "type of channel (%d) is not UD",
"ibt_alloc_ah() failed: status = %d",
retval);
* ibt_is_privileged_ud_dest * ud_dest A previously allocated destination handle. * Determine if a UD destination Handle is a privileged handle. * ibt_update_channel_qkey * ud_chan The UD channel handle, that is to be used to * communicate with the specified destination. * ud_dest A UD destination handle returned from * ibt_update_channel_qkey() sets the Q_Key in the specified channel context * to the Q_Key in the specified destination handle. This function can be used * to enable sends to a privileged destination. All posted send work requests * that contain a privileged destination handle now use the Q_Key in the * ibt_update_channel_qkey() can also be used to enable the caller to receive * from the specified remote destination on the specified channel. "type of channel (%d) is not UD",
* chan A previously allocated channel handle. * clnt_private The client private data. * Set the client private data. * chan A previously allocated channel handle. * A pointer to the client private data. * Get a pointer to client private data. * ibt_channel_to_hca_guid * hca_guid Returned HCA GUID on which the specified Channel is * allocated. Valid if it is non-NULL on return. * A helper function to retrieve HCA GUID for the specified Channel. * Protection Domain Verbs Functions. * hca_hdl The IBT HCA handle, the device on which we need * to create the requested Protection Domain. * flags IBT_PD_NO_FLAGS, IBT_PD_USER_MAP or IBT_PD_DEFER_ALLOC * pd IBT Protection Domain Handle. * Allocate a Protection Domain. /* re-direct the call to CI's call */ /* Update the PDs Resource Count per HCA Device. */ * hca_hdl The IBT HCA handle, the device on which we need * to free the requested Protection Domain. * pd IBT Protection Domain Handle. /* re-direct the call to CI's call */ /* Update the PDs Resource Count per HCA Device. */ * Address Handle Verbs Functions. * hca_hdl The IBT HCA Handle. * pd The IBT Protection Domain to associate with this handle. * adds_vectp Points to an ibt_adds_vect_t struct. * Allocate and returns an Address Handle. /* XXX - if av_send_grh, need to compute av_sgid_ix from av_sgid */ /* re-direct the call to CI's call */ "ibc_alloc_ah failed: status = %d",
retval);
/* Update the AHs Resource Count per HCA Device. */ * hca_hdl The IBT HCA Handle. /* re-direct the call to CI's call */ /* Update the AHs Resource Count per HCA Device. */ * hca_hdl The IBT HCA Handle. * pd The Protection Domain Handle with which this * Address Handle is associated. * adds_vectp Points to an ibt_adds_vect_t struct. * Obtain the address vector information for the specified address handle. /* re-direct the call to CI's call */ * hca_hdl The IBT HCA Handle. * adds_vectp Points to an ibt_adds_vect_t struct. The new address * vector information is specified is returned in this * Modify the address vector information for the specified Address Handle. /* XXX - if av_send_grh, need to compute av_sgid_ix from av_sgid */ /* re-direct the call to CI's call */