Lines Matching full:con
72 int rtrs_iu_post_recv(struct rtrs_con *con, struct rtrs_iu *iu) in rtrs_iu_post_recv() argument
74 struct rtrs_path *path = con->path; in rtrs_iu_post_recv()
83 rtrs_wrn(con->path, in rtrs_iu_post_recv()
93 return ib_post_recv(con->qp, &wr, NULL); in rtrs_iu_post_recv()
97 int rtrs_post_recv_empty(struct rtrs_con *con, struct ib_cqe *cqe) in rtrs_post_recv_empty() argument
105 return ib_post_recv(con->qp, &wr, NULL); in rtrs_post_recv_empty()
128 int rtrs_iu_post_send(struct rtrs_con *con, struct rtrs_iu *iu, size_t size, in rtrs_iu_post_send() argument
131 struct rtrs_path *path = con->path; in rtrs_iu_post_send()
150 return rtrs_post_send(con->qp, head, &wr, NULL); in rtrs_iu_post_send()
154 int rtrs_iu_post_rdma_write_imm(struct rtrs_con *con, struct rtrs_iu *iu, in rtrs_iu_post_rdma_write_imm() argument
183 return rtrs_post_send(con->qp, head, &wr.wr, tail); in rtrs_iu_post_rdma_write_imm()
187 static int rtrs_post_rdma_write_imm_empty(struct rtrs_con *con, in rtrs_post_rdma_write_imm_empty() argument
193 struct rtrs_path *path = con->path; in rtrs_post_rdma_write_imm_empty()
196 atomic_dec_if_positive(&con->sq_wr_avail); in rtrs_post_rdma_write_imm_empty()
197 sflags = (atomic_inc_return(&con->wr_cnt) % path->signal_interval) ? in rtrs_post_rdma_write_imm_empty()
207 return rtrs_post_send(con->qp, head, &wr.wr, NULL); in rtrs_post_rdma_write_imm_empty()
212 struct rtrs_con *con = ctx; in qp_event_handler() local
216 rtrs_info(con->path, "QP event %s (%d) received\n", in qp_event_handler()
218 rdma_notify(con->cm_id, IB_EVENT_COMM_EST); in qp_event_handler()
221 rtrs_info(con->path, "Unhandled QP event %s (%d) received\n", in qp_event_handler()
227 static bool is_pollqueue(struct rtrs_con *con) in is_pollqueue() argument
229 return con->cid >= con->path->irq_con_num; in is_pollqueue()
232 static int create_cq(struct rtrs_con *con, int cq_vector, int nr_cqe, in create_cq() argument
235 struct rdma_cm_id *cm_id = con->cm_id; in create_cq()
238 if (is_pollqueue(con)) in create_cq()
239 cq = ib_alloc_cq(cm_id->device, con, nr_cqe, cq_vector, in create_cq()
245 rtrs_err(con->path, "Creating completion queue failed, errno: %pe\n", in create_cq()
249 con->cq = cq; in create_cq()
250 con->nr_cqe = nr_cqe; in create_cq()
255 static int create_qp(struct rtrs_con *con, struct ib_pd *pd, in create_qp() argument
259 struct rdma_cm_id *cm_id = con->cm_id; in create_qp()
266 init_attr.qp_context = con; in create_qp()
270 init_attr.send_cq = con->cq; in create_qp()
271 init_attr.recv_cq = con->cq; in create_qp()
276 rtrs_err(con->path, "Creating QP failed, err: %d\n", ret); in create_qp()
279 con->qp = cm_id->qp; in create_qp()
284 static void destroy_cq(struct rtrs_con *con) in destroy_cq() argument
286 if (con->cq) { in destroy_cq()
287 if (is_pollqueue(con)) in destroy_cq()
288 ib_free_cq(con->cq); in destroy_cq()
290 ib_cq_pool_put(con->cq, con->nr_cqe); in destroy_cq()
292 con->cq = NULL; in destroy_cq()
295 int rtrs_cq_qp_create(struct rtrs_path *path, struct rtrs_con *con, in rtrs_cq_qp_create() argument
302 err = create_cq(con, cq_vector, nr_cqe, poll_ctx); in rtrs_cq_qp_create()
306 err = create_qp(con, path->dev->ib_pd, max_send_wr, max_recv_wr, in rtrs_cq_qp_create()
309 destroy_cq(con); in rtrs_cq_qp_create()
312 con->path = path; in rtrs_cq_qp_create()
318 void rtrs_cq_qp_destroy(struct rtrs_con *con) in rtrs_cq_qp_destroy() argument
320 if (con->qp) { in rtrs_cq_qp_destroy()
321 rdma_destroy_qp(con->cm_id); in rtrs_cq_qp_destroy()
322 con->qp = NULL; in rtrs_cq_qp_destroy()
324 destroy_cq(con); in rtrs_cq_qp_destroy()
336 struct rtrs_con *usr_con = path->con[0]; in rtrs_send_hb_ack()
359 usr_con = path->con[0]; in hb_work()
388 void (*err_handler)(struct rtrs_con *con), in rtrs_init_hb() argument