2006-12-04 16:02:08 +03:00
/*
* Unix SMB / CIFS implementation .
* Wrap Infiniband calls .
*
* Copyright ( C ) Sven Oehme < oehmes @ de . ibm . com > 2006
*
* Major code contributions by Peter Somogyi < psomogyi @ gamax . hu >
*
* This program is free software ; you can redistribute it and / or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation ; either version 2 of the License , or
* ( at your option ) any later version .
*
* This program is distributed in the hope that it will be useful ,
* but WITHOUT ANY WARRANTY ; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the
* GNU General Public License for more details .
*
* You should have received a copy of the GNU General Public License
* along with this program ; if not , write to the Free Software
* Foundation , Inc . , 675 Mass Ave , Cambridge , MA 0213 9 , USA .
*/
2006-12-13 13:02:49 +03:00
struct ibw_opts {
2006-12-11 21:56:15 +03:00
int max_send_wr ;
int max_recv_wr ;
2006-12-13 13:02:49 +03:00
} ;
2006-12-04 16:02:08 +03:00
2006-12-13 13:02:49 +03:00
struct ibw_wr {
2006-12-12 21:09:16 +03:00
char * msg ; /* initialized in ibw_init_memory once per connection */
2006-12-11 21:56:15 +03:00
int wr_id ; /* position in wr_index list; also used as wr id */
2006-12-13 17:00:41 +03:00
struct ibw_wr * next , * prev ; /* in wr_list_avail or wr_list_used */
2006-12-13 13:02:49 +03:00
} ;
2006-12-11 21:56:15 +03:00
2006-12-13 13:02:49 +03:00
struct ibw_ctx_priv {
2006-12-04 16:02:08 +03:00
struct event_context * ectx ;
2006-12-13 13:02:49 +03:00
struct ibw_opts opts ;
2006-12-04 16:02:08 +03:00
2006-12-04 21:48:11 +03:00
struct rdma_cm_id * cm_id ; /* server cm id */
2006-12-04 16:02:08 +03:00
struct rdma_event_channel * cm_channel ;
struct fd_event * cm_channel_event ;
2006-12-06 20:49:46 +03:00
struct ibv_pd * pd ;
2006-12-12 21:09:16 +03:00
ibw_connstate_fn_t connstate_func ; /* see ibw_init */
ibw_receive_fn_t receive_func ; /* see ibw_init */
2006-12-11 21:56:15 +03:00
long pagesize ; /* sysconf result for memalign */
2006-12-12 21:09:16 +03:00
int qsize ; /* opts.max_send_wr + opts.max_recv_wr */
int max_msg_size ; /* see ibw_init */
2006-12-13 13:02:49 +03:00
} ;
2006-12-04 16:02:08 +03:00
2006-12-13 13:02:49 +03:00
struct ibw_conn_priv {
2006-12-12 21:09:16 +03:00
struct ibv_comp_channel * verbs_channel ;
struct fd_event * verbs_channel_event ;
2006-12-04 21:48:11 +03:00
struct rdma_cm_id * cm_id ; /* client's cm id */
2006-12-06 20:49:46 +03:00
int is_accepted ;
2006-12-04 16:02:08 +03:00
2006-12-11 21:56:15 +03:00
struct ibv_cq * cq ; /* qp is in cm_id */
struct ibv_mr * mr ;
2006-12-12 21:09:16 +03:00
char * buf ; /* fixed size (qsize * opts.max_msg_size) buffer for send/recv */
2006-12-13 13:02:49 +03:00
struct ibw_wr * wr_list_avail ;
struct ibw_wr * wr_list_used ;
struct ibw_wr * * wr_index ; /* array[0..(qsize-1)] of (ibw_wr *) */
} ;
2006-12-04 16:02:08 +03:00