Lines Matching defs:res

78  * Given in res: port_num, max_outs_sq, max_outs_rq
80 VAPI_ret_t osmt_mtl_get_qp_resources(IN OUT osmt_mtl_mad_res_t * res)
90 VAPI_query_hca_port_prop(res->hca_hndl, res->port_num,
93 res->slid = hca_port_info.lid;
96 ret = VAPI_alloc_pd(res->hca_hndl, &(res->pd_hndl));
101 VAPI_create_cq(res->hca_hndl, res->max_outs_sq + 1,
102 &(res->sq_cq_hndl), &act_num);
105 VAPI_create_cq(res->hca_hndl, res->max_outs_rq + 1,
106 &(res->rq_cq_hndl), &act_num);
110 /* ret= EVAPI_set_comp_eventh(res->hca_hndl,res->rq_cq_hndl, */
111 /* EVAPI_POLL_CQ_UNBLOCK_HANDLER,NULL,&(res->rq_cq_eventh)); */
113 /* ret= EVAPI_set_comp_eventh(res->hca_hndl,res->sq_cq_hndl, */
114 /* EVAPI_POLL_CQ_UNBLOCK_HANDLER,NULL,&(res->sq_cq_eventh)); */
118 qp_init_attr.cap.max_oust_wr_sq = res->max_outs_sq + 1;
119 qp_init_attr.cap.max_oust_wr_rq = res->max_outs_rq + 1;
123 qp_init_attr.pd_hndl = res->pd_hndl;
125 qp_init_attr.rq_cq_hndl = res->rq_cq_hndl;
127 qp_init_attr.sq_cq_hndl = res->sq_cq_hndl;
132 VAPI_create_qp(res->hca_hndl, &qp_init_attr, &(res->qp_hndl),
135 res->qp_id.qp_num = qp_prop.qp_num;
140 VAPI_ret_t osmt_mtl_qp_init(osmt_mtl_mad_res_t * res)
157 qp_attr.port = res->port_num;
159 qp_attr.qkey = res->qkey;
164 VAPI_modify_qp(res->hca_hndl, res->qp_hndl, &qp_attr, &qp_attr_mask,
172 VAPI_ret_t osmt_mtl_qp_2_rtr_rts(osmt_mtl_mad_res_t * res)
191 VAPI_modify_qp(res->hca_hndl, res->qp_hndl, &qp_attr, &qp_attr_mask,
206 VAPI_modify_qp(res->hca_hndl, res->qp_hndl, &qp_attr, &qp_attr_mask,
213 VAPI_ret_t osmt_mtl_mad_create_mr(osmt_mtl_mad_res_t * res)
220 res->buf_size =
221 (MAD_SIZE + GRH_LEN) * (res->max_outs_sq + res->max_outs_rq + 1);
224 res->buf_ptr = VMALLOC(res->buf_size);
226 if (res->buf_ptr == ((VAPI_virt_addr_t) NULL)) {
234 mr_in.pd_hndl = res->pd_hndl;
236 mr_in.size = res->buf_size;
237 ASSERT_VOIDP2UINTN(res->buf_ptr);
238 mr_in.start = (VAPI_virt_addr_t) (uintn_t) (res->buf_ptr);
241 ret = VAPI_register_mr(res->hca_hndl, &mr_in, &(res->mr_hndl), &mr_out);
244 res->l_key = mr_out.l_key;
249 VAPI_ret_t osmt_mtl_init_opened_hca(osmt_mtl_mad_res_t * res)
253 res->pd_hndl = VAPI_INVAL_HNDL;
254 res->rq_cq_hndl = VAPI_INVAL_HNDL;
255 res->sq_cq_hndl = VAPI_INVAL_HNDL;
256 res->sq_cq_eventh = VAPI_INVAL_HNDL;
257 res->rq_cq_eventh = VAPI_INVAL_HNDL;
258 res->qp_hndl = VAPI_INVAL_HNDL;
259 res->mr_hndl = VAPI_INVAL_HNDL;
265 ret = osmt_mtl_get_qp_resources(res);
274 ret = osmt_mtl_qp_init(res);
283 ret = osmt_mtl_mad_create_mr(res);
289 ret = osmt_mtl_qp_2_rtr_rts(res);
297 VAPI_ret_t osmt_mtl_mad_cleanup(osmt_mtl_mad_res_t * res)
299 if (res->qp_hndl != VAPI_INVAL_HNDL) {
300 VAPI_destroy_qp(res->hca_hndl, res->qp_hndl);
302 if (res->sq_cq_eventh != VAPI_INVAL_HNDL) {
303 EVAPI_clear_comp_eventh(res->hca_hndl, res->sq_cq_eventh);
305 if (res->rq_cq_eventh != VAPI_INVAL_HNDL) {
306 EVAPI_clear_comp_eventh(res->hca_hndl, res->rq_cq_eventh);
308 if (res->rq_cq_hndl != VAPI_INVAL_HNDL) {
309 VAPI_destroy_cq(res->hca_hndl, res->rq_cq_hndl);
311 if (res->sq_cq_hndl != VAPI_INVAL_HNDL) {
312 VAPI_destroy_cq(res->hca_hndl, res->sq_cq_hndl);
314 if (res->mr_hndl != VAPI_INVAL_HNDL) {
315 VAPI_deregister_mr(res->hca_hndl, res->mr_hndl);
317 if (res->pd_hndl != VAPI_INVAL_HNDL) {
318 VAPI_dealloc_pd(res->hca_hndl, res->pd_hndl);
322 if (res->hca_hndl != VAPI_INVAL_HNDL) {
323 VAPI_close_hca(res->hca_hndl); /* TBD: HCA_open/close should be done on a system wide basis */
329 VAPI_ret_t osmt_mtl_create_av(osmt_mtl_mad_res_t * res, int16_t dlid,
336 av.port = res->port_num;
343 ret = VAPI_create_addr_hndl(res->hca_hndl, res->pd_hndl, &av, avh_p);
352 VAPI_ret_t osmt_mtl_mad_send(osmt_mtl_mad_res_t * res, VAPI_wr_id_t id,
375 sg_entry.lkey = res->l_key;
377 ret = VAPI_post_sr(res->hca_hndl, res->qp_hndl, &sr);
387 int osmt_mtl_mad_post_recv_bufs(osmt_mtl_mad_res_t * res, void *buf_array,
401 sg_entry.lkey = res->l_key;
409 ret = VAPI_post_rr(res->hca_hndl, res->qp_hndl, &rr);