/*
* 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
*/
/*
*/
#ifndef _SYS_IB_IBTL_IBTI_H
#define _SYS_IB_IBTL_IBTI_H
/*
* ibti.h
*
* This file contains the IBTI prototypes and associated data structures.
* It is the only header file that should be included by IBTI clients.
*/
#ifdef __cplusplus
extern "C" {
#endif
/*
* Allocate channel flags.
*/
typedef enum ibt_chan_alloc_flags_e {
IBT_ACHAN_NO_FLAGS = 0,
/* UD variants for FC support */
/*
* Allocate RC channel ibt_alloc_rc_channel() argument.
*/
typedef struct ibt_rc_chan_alloc_args_s {
/*
* RC channel query attributes structure.
*/
typedef struct ibt_rc_chan_query_attr_s {
/*
* RC Channel Modify Attributes definition.
*
* It is only possible to modify a channel that has previously been
* opened. The channel must either be in operational state (IBT_STATE_RTS)
* or paused (IBT_STATE_SQD). If channel is in paused state, then a modify
* operation will unpause the channel.
*
* See the ibt_modify_rc_channel() for details of the required corresponding
* modify flags.
* Not specified attributes should be set to "NULL" or "0".
*/
typedef struct ibt_rc_chan_modify_attr_s {
/* RDMA RD's & Atomics */
/* outstanding. */
/* handling incoming RDMA rds */
/* and Atomics. */
/*
* UD remote destination query attributes
*/
typedef struct ibt_ud_dest_query_attr_s {
/*
* Allocate UD channel ibt_alloc_ud_channel() arguments; see below at
* ibt_alloc_ud_channel() for a description of what's required and optional.
*/
typedef struct ibt_ud_chan_alloc_args_s {
/*
* UD channel query attributes.
*/
typedef struct ibt_ud_chan_query_attr_s {
/*
* UD Channel Modify Attributes definition.
*
* It is only possible to modify a channel that is either in the operational
* state (IBT_STATE_RTS) or paused (IBT_STATE_SQD). If channel is in paused
* state, then a modify operation will unpause the channel.
*
* See the ibt_modify_ud_channel() for details of the required corresponding
* modify flags.
*/
typedef struct ibt_ud_chan_modify_attr_s {
/*
* FUNCTION PROTOTYPES
*/
/*
* CONNECTION ESTABLISHMENT/TEAR DOWN FUNCTIONS.
*/
/*
* ibt_alloc_rc_channel
* Allocates a RC communication channels that satisfy the specified
* channel attributes.
*/
/*
* ibt_flush_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(). RC channels
* that have been successfully opened will fail this call, as they
* need to instead be handled by ibt_close_rc_channel().
*/
/*
* ibt_free_channel
* Releases the resources associated with the specified channel
*/
/*
* ibt_query_rc_channel
* Query an RC channel's attributes. Should only be called on an
* opened RC channel. If called on a channel before it is opened,
* some channel attributes may change when the channel is opened.
*/
/*
* ibt_modify_rc_channel()
* Modifies a previous opened operational or paused RC channel's
* attributes.
*
* NOTE:
* It is only possible to modify a channel that has previously been opened.
* The channel must either be in operational state (IBT_STATE_RTS) or
* paused (IBT_STATE_SQD). If channel is in paused state, then a modify
* operation will will unpause the channel.
*/
/*
* ibt_alloc_ud_channel
* Allocate UD channels that satisfy the specified channel attributes.
*/
/*
* ibt_alloc_ud_channel_range
* Allocate a range of UD channels that have consecutive QPNs for RSS.
*/
/*
* ibt_query_ud_channel
* Query a UD channel's attributes.
*/
/*
* ibt_modify_ud_channel()
* 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.
*
* NOTE:
* It is only possible to modify a channel that is either in the
* operational state (IBT_STATE_RTS) or paused (IBT_STATE_SQD). If
* channel is in paused state, then a modify operation will unpause the
* channel.
*/
/*
* ibt_recover_ud_channel()
* 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.
*/
/*
* ibt_alloc_ud_dest
* Allocate a UD destination handle. This allocates local resources
* that will need subsequent modification/initialization before use
* (in send work requests). Functions that can be used to do this are
* ibt_modify_ud_dest (data supplied by caller), ibt_modify_reply_ud_dest
* (data supplied from a successfully completed receive work request),
* and ibt_request_ud_dest (data retrieved using SIDR protocol).
*/
/*
* ibt_modify_ud_dest
* Modify a previously allocated UD destination handle from the
* argument data. After the ud_dest has already been made usable,
* the adds_vect argument to this function is optional (NULL).
*/
/*
* ibt_modify_reply_ud_dest
* 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.
*/
/*
* ibt_request_ud_dest
* Modify a previously allocated UD destination handle based on the
* data retrieved by making an SIDR request.
*/
/*
* ibt_free_ud_dest
* Releases the resources associated with the specified UD destination
* handle.
*/
/*
* ibt_query_ud_dest
* Query a UD destination's attributes.
*/
/*
* ibt_is_privileged_ud_dest
* Determine if a UD destination Handle is a privileged handle.
*/
/*
* ibt_update_channel_qkey
*
* ibt_update_channel_qkey() set's the Qkey in the specified channel context
* to the Qkey 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 Qkey in the
* channel context.
*
* ibt_update_channel_qkey() can also be used to enable the caller to receive
* from the specified remote destination on the specified channel.
*
*/
/*
* ibt_set_chan_private()
* ibt_get_chan_private()
* Applicable for both RC and UD channels.
*/
/*
* ibt_channel_to_hca_guid()
*
* A helper function to retrieve HCA GUID for the specified Channel.
*/
#ifdef __cplusplus
}
#endif
#endif /* _SYS_IB_IBTL_IBTI_H */