ib.h revision 0a701b1ec2b55bddc48b62124df936152ff820f7
/*
* 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.
*/
/*
* Copyright (c) 2007, The Ohio State University. All rights reserved.
*
* Portions of this source code is developed by the team members of
* The Ohio State University's Network-Based Computing Laboratory (NBCL),
* headed by Professor Dhabaleswar K. (DK) Panda.
*
* Acknowledgements to contributions from developors:
* Ranjit Noronha: noronha@cse.ohio-state.edu
* Lei Chai : chail@cse.ohio-state.edu
* Weikuan Yu : yuw@cse.ohio-state.edu
*
*/
#ifndef _IB_H
#define _IB_H
/*
* 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
/* 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
/*
* 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 {
};
/*
* 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 */
caddr_t c;
int l1;
int l2;
};
/*
* 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 */