sol_cma.h revision c0dd49bdd68c0d758a67d56f07826f3b45cfc664
/*
* 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
*/
/*
*/
#ifdef __cplusplus
extern "C" {
#endif
#if !defined(offsetof)
#endif
#define IS_VALID_SOCKADDR(sockaddrp) \
/*
* Global structure which contains information about all
* CMIDs, which have called rdma_listen().
*/
typedef struct sol_cma_glbl_listen_s {
void *cma_listen_clnt_hdl;
void *cma_listen_svc_hdl;
/* State of the RDMA-CM ID */
typedef enum {
typedef struct listen_info_s {
/* For Root CMIDs, pointer to global listen info */
/*
* For EP CMIDs, pointer to ib_device and root CMID
* for HCA DR
*/
struct ib_device *listen_ep_device;
/*
* Count & list of EPs for this listen_info.
* This is 0, if listen_is_root is 0.
*/
/* Transport Specific */
union {
/* For Root CMID */
/* For Endpoint CMID */
} un_listen;
typedef enum {
SOL_CMA_XPORT_NONE = 0,
typedef enum {
SOL_CMA_CONNECT_NONE = 0,
/*
* CMID_DESTROYED - Flag to indicate rdma_destroy_id has been
* called for this CMID
*
* EVENT_PROGRESS - RDMACM Event for this CMID been passed to
* the sol_ofs client.
*
* API_PROGRESS - rdma_resolve_addr() / rdma_resolve_route() /
* rdma_listen() is in progress.
*/
#define SOL_CMA_CALLER_CMID_DESTROYED 0x01
#define SOL_CMA_CALLER_EVENT_PROGRESS 0x02
#define SOL_CMA_CALLER_API_PROGRESS 0x04
typedef enum {
REQ_CMID_NONE = 0,
typedef struct {
struct rdma_cm_id chan_rdma_cm;
/*
* Below are all CMA Channel specific fields required in Solaris,
* apart from rdma_cm_id.
*/
/* AVL Tree for REQs and EST CMIDs */
/*
* chan_req_cnt -
* REQ CMIDs created not yet notified to client
* chan_total_req_cnt -
* REQ CMIDs created not destroy_id(0 not called.
*/
/*
* Transport type for the rdma_id, IB or IWARP. This is set to
* NONE, when the transport type is not yet determined.
*/
/*
* Passed from sol_ofs consumer, using the rdma_map_id2clnthdl
* and rdma_map_id2qphdl
*/
void *chan_ib_client_hdl;
void *chan_iw_client_hdl;
void *chan_qp_hdl;
/* Data for root / endpoint CM ID. */
/* Ptr to the root CMID for Endpoint & Req CMID */
struct rdma_cm_id *listen_root;
struct rdma_conn_param chan_param;
/* Session ID for completion */
void *chan_session_id;
union {
} un_xport; /* Transport specific fields */
void ibcma_append_listen_list(struct rdma_cm_id *);
#ifdef IWARP_SUPPORT
void iwcma_append_listen_list(struct rdma_cm_id *);
#endif
int, struct rdma_conn_param *, struct rdma_ud_param *);
static inline int
{
struct sockaddr_in *in_addr;
struct sockaddr_in6 *in6_addr;
}
return (0);
}
static inline struct rdma_cm_id *
{
struct rdma_cm_id *newid;
return (newid);
}
sizeof (struct rdma_addr));
int num_paths;
sizeof (struct ib_sa_path_rec), KM_SLEEP);
num_paths * sizeof (struct ib_sa_path_rec));
}
if (CHAN_LISTEN_ROOT(src_chanp))
else
return (newid);
}
static inline struct rdma_cm_id *
{
struct rdma_cm_id *req_idp;
return (req_idp);
}
static inline struct rdma_cm_id *
{
struct rdma_cm_id *acpt_idp;
return (acpt_idp);
}
#ifdef __cplusplus
}
#endif
#endif /* _SYS_IB_CLIENTS_OF_SOL_OFS_SOL_CMA_H */