ib.h revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (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 2005 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _IB_H
#define _IB_H
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* ib.h, rpcib plugin interface.
*/
#include <rpc/rpc_rdma.h>
#ifdef __cplusplus
extern "C" {
#endif
/*
* Tavor returns the next higher power of 2
* CQ entries than the requested size.
* For instance, if you request (2^12 - 1)
* CQ entries, Tavor returns 2^12 entries.
* 4K CQ entries suffice. Hence, 4096 - 1.
*/
#define DSEG_MAX 2
#define NFS_SEC_KEY1 0x8679
/* max no. of refresh attempts on IBT_CM_CONN_STALE error */
#define REFRESH_ATTEMPTS 3
/*
* Notification for RDMA_DONE is based on xid
*/
struct rdma_done_list {
struct rdma_done_list *next;
struct rdma_done_list *prev;
};
/*
* State of the plugin.
* ACCEPT = accepting new connections and requests
* NO_ACCEPT = not accepting new connection and requests
*/
#define ACCEPT 1
#define NO_ACCEPT 2
/*
* Send Wait states
*/
#define SEND_WAIT -1
/*
* Reply states
*/
#define REPLY_WAIT -1
typedef void * rib_pvoid;
typedef rib_pvoid RIB_SYNCMEM_HANDLE;
/*
* IB buffer pool management structure
*/
/*
* Buffer pool info
*/
typedef struct {
int rsize; /* size of each element */
int numelems; /* no. of elements allocated */
int buffree; /* no. of free elements */
} bufpool_t;
typedef struct {
/*
* ATS relsted defines and structures.
*/
#define ATS_AR_DATA_LEN 16
#define IBD_NAME "ibd"
#define N_IBD_INSTANCES 4
typedef struct rpcib_ats_s {
int ras_inst;
union {
struct sockaddr_in ras_sockaddr;
struct sockaddr_in6 ras_sockaddr6;
} ra_sin;
} rpcib_ats_t;
typedef struct rpcib_ibd_insts_s {
int rib_ibd_alloc;
int rib_ibd_cnt;
/*
* Service types supported by RPCIB
* For now only NFS is supported.
*/
#define NFS 1
#define NLM 2
/*
* Tracks consumer state (client or server).
*/
typedef enum {
} rib_mode_t;
/*
* CQ structure
*/
struct rib_cq_s {
};
/*
* RPCIB plugin state
*/
typedef struct rpcib_state {
int refcount;
queue_t *q; /* up queue for a serv_type */
void *private;
/*
* Each registered service's data structure.
* Each HCA has a list of these structures, which are the registered
* services on this HCA.
*/
typedef struct rib_service rib_service_t;
struct rib_service {
/*
* service name, i.e, <IP>::NFS or <IP>::NLM. Since
* each type of service can be registered with many
* IP addrs(srv_name) and is running on all ports
* for all HCAs.
*/
char *srv_name;
/*
* pointer to the next service registered on this
* particular HCA
*/
};
/*
* Connection lists
*/
typedef struct {
enum hca_state {
HCA_INITED, /* hca in up and running state */
HCA_DETACHED /* hca in detached state */
};
/*
* RPCIB per HCA structure
*/
struct rib_hca_s {
/*
* per HCA.
*/
/*
* List of services registered on all ports available
* on this HCA. Only one consumer of KRPC can register
* its services at one time or tear them down at one
* time.
*/
void *iblock; /* interrupt cookie */
};
/*
* Structure on wait state of a post send
*/
struct send_wid {
int cv_sig;
int nsbufs; /* # of send buffers posted */
};
/*
* Structure on reply descriptor for recv queue.
* Different from the above posting of a descriptor.
*/
struct reply {
};
struct svc_recv {
};
struct recv_wid {
};
/*
* Per QP data structure
*/
struct rib_qp_s {
int chan_flags;
/*
* Number of pre-posted rbufs
*/
/*
* RPC reply
*/
/*
* server only, RDMA_DONE
*/
struct rdma_done_list *rdlist;
caddr_t q; /* upstream queue */
};
/*
* Timeout for various calls
*/
#define CONN_WAIT_TIME 40
#ifdef __cplusplus
}
#endif
#endif /* !_IB_H */