Lines Matching full:con

182 	struct rtrs_srv_con *con = to_srv_con(wc->qp->qp_context);  in rtrs_srv_reg_mr_done()  local
183 struct rtrs_path *s = con->c.path; in rtrs_srv_reg_mr_done()
200 struct rtrs_path *s = id->con->c.path; in rdma_write_sg()
271 flags = (atomic_inc_return(&id->con->c.wr_cnt) % s->signal_interval) ? in rdma_write_sg()
323 err = ib_post_send(id->con->c.qp, &id->tx_wr.wr, NULL); in rdma_write_sg()
335 * @con: the connection to send back result
341 static int send_io_resp_imm(struct rtrs_srv_con *con, struct rtrs_srv_op *id, in send_io_resp_imm() argument
344 struct rtrs_path *s = con->c.path; in send_io_resp_imm()
399 flags = (atomic_inc_return(&con->c.wr_cnt) % s->signal_interval) ? in send_io_resp_imm()
441 err = ib_post_send(id->con->c.qp, wr, NULL); in send_io_resp_imm()
486 struct rtrs_srv_con *con; in rtrs_srv_resp_rdma() local
493 con = id->con; in rtrs_srv_resp_rdma()
494 s = con->c.path; in rtrs_srv_resp_rdma()
511 if (atomic_sub_return(1, &con->c.sq_wr_avail) < 0) { in rtrs_srv_resp_rdma()
514 con->c.cid); in rtrs_srv_resp_rdma()
515 atomic_add(1, &con->c.sq_wr_avail); in rtrs_srv_resp_rdma()
516 spin_lock(&con->rsp_wr_wait_lock); in rtrs_srv_resp_rdma()
517 list_add_tail(&id->wait_list, &con->rsp_wr_wait_list); in rtrs_srv_resp_rdma()
518 spin_unlock(&con->rsp_wr_wait_lock); in rtrs_srv_resp_rdma()
523 err = send_io_resp_imm(con, id, status); in rtrs_srv_resp_rdma()
678 struct rtrs_srv_con *con = container_of(c, typeof(*con), c); in rtrs_srv_hb_err_handler() local
679 struct rtrs_srv_path *srv_path = to_srv_path(con->c.path); in rtrs_srv_hb_err_handler()
681 rtrs_err(con->c.path, "HB err handler for path=%s\n", kobject_name(&srv_path->kobj)); in rtrs_srv_hb_err_handler()
706 struct rtrs_srv_con *con = to_srv_con(wc->qp->qp_context); in rtrs_srv_info_rsp_done() local
707 struct rtrs_path *s = con->c.path; in rtrs_srv_info_rsp_done()
793 static int process_info_req(struct rtrs_srv_con *con, in process_info_req() argument
796 struct rtrs_path *s = con->c.path; in process_info_req()
893 err = rtrs_iu_post_send(&con->c, tx_iu, tx_sz, reg_wr); in process_info_req()
907 struct rtrs_srv_con *con = to_srv_con(wc->qp->qp_context); in rtrs_srv_info_req_done() local
908 struct rtrs_path *s = con->c.path; in rtrs_srv_info_req_done()
914 WARN_ON(con->c.cid); in rtrs_srv_info_req_done()
937 err = process_info_req(con, msg); in rtrs_srv_info_req_done()
948 static int post_recv_info_req(struct rtrs_srv_con *con) in post_recv_info_req() argument
950 struct rtrs_path *s = con->c.path; in post_recv_info_req()
961 err = rtrs_iu_post_recv(&con->c, rx_iu); in post_recv_info_req()
971 static int post_recv_io(struct rtrs_srv_con *con, size_t q_size) in post_recv_io() argument
976 err = rtrs_post_recv_empty(&con->c, &io_comp_cqe); in post_recv_io()
1002 if (!srv_path->s.con[cid]) { in post_recv_path()
1007 err = post_recv_io(to_srv_con(srv_path->s.con[cid]), q_size); in post_recv_path()
1017 static void process_read(struct rtrs_srv_con *con, in process_read() argument
1021 struct rtrs_path *s = con->c.path; in process_read()
1045 id->con = con; in process_read()
1065 ret = send_io_resp_imm(con, id, ret); in process_read()
1075 static void process_write(struct rtrs_srv_con *con, in process_write() argument
1079 struct rtrs_path *s = con->c.path; in process_write()
1098 id->con = con; in process_write()
1117 ret = send_io_resp_imm(con, id, ret); in process_write()
1127 static void process_io_req(struct rtrs_srv_con *con, void *msg, in process_io_req() argument
1130 struct rtrs_path *s = con->c.path; in process_io_req()
1143 process_write(con, msg, id, off); in process_io_req()
1146 process_read(con, msg, id, off); in process_io_req()
1165 struct rtrs_srv_con *con = to_srv_con(wc->qp->qp_context); in rtrs_srv_inv_rkey_done() local
1166 struct rtrs_path *s = con->c.path; in rtrs_srv_inv_rkey_done()
1180 process_io_req(con, data, msg_id, off); in rtrs_srv_inv_rkey_done()
1183 static int rtrs_srv_inv_rkey(struct rtrs_srv_con *con, in rtrs_srv_inv_rkey() argument
1194 return ib_post_send(con->c.qp, &wr, NULL); in rtrs_srv_inv_rkey()
1197 static void rtrs_rdma_process_wr_wait_list(struct rtrs_srv_con *con) in rtrs_rdma_process_wr_wait_list() argument
1199 spin_lock(&con->rsp_wr_wait_lock); in rtrs_rdma_process_wr_wait_list()
1200 while (!list_empty(&con->rsp_wr_wait_list)) { in rtrs_rdma_process_wr_wait_list()
1204 id = list_entry(con->rsp_wr_wait_list.next, in rtrs_rdma_process_wr_wait_list()
1208 spin_unlock(&con->rsp_wr_wait_lock); in rtrs_rdma_process_wr_wait_list()
1210 spin_lock(&con->rsp_wr_wait_lock); in rtrs_rdma_process_wr_wait_list()
1213 list_add(&id->wait_list, &con->rsp_wr_wait_list); in rtrs_rdma_process_wr_wait_list()
1217 spin_unlock(&con->rsp_wr_wait_lock); in rtrs_rdma_process_wr_wait_list()
1222 struct rtrs_srv_con *con = to_srv_con(wc->qp->qp_context); in rtrs_srv_rdma_done() local
1223 struct rtrs_path *s = con->c.path; in rtrs_srv_rdma_done()
1249 err = rtrs_post_recv_empty(&con->c, &io_comp_cqe); in rtrs_srv_rdma_done()
1274 err = rtrs_srv_inv_rkey(con, mr); in rtrs_srv_rdma_done()
1283 process_io_req(con, data, msg_id, off); in rtrs_srv_rdma_done()
1286 WARN_ON(con->c.cid); in rtrs_srv_rdma_done()
1289 WARN_ON(con->c.cid); in rtrs_srv_rdma_done()
1301 atomic_add(s->signal_interval, &con->c.sq_wr_avail); in rtrs_srv_rdma_done()
1303 if (!list_empty_careful(&con->rsp_wr_wait_list)) in rtrs_srv_rdma_done()
1304 rtrs_rdma_process_wr_wait_list(con); in rtrs_srv_rdma_done()
1547 struct rtrs_srv_con *con; in rtrs_srv_close_work() local
1555 if (!srv_path->s.con[i]) in rtrs_srv_close_work()
1557 con = to_srv_con(srv_path->s.con[i]); in rtrs_srv_close_work()
1558 rdma_disconnect(con->c.cm_id); in rtrs_srv_close_work()
1559 ib_drain_qp(con->c.qp); in rtrs_srv_close_work()
1580 if (!srv_path->s.con[i]) in rtrs_srv_close_work()
1582 con = to_srv_con(srv_path->s.con[i]); in rtrs_srv_close_work()
1583 rtrs_cq_qp_destroy(&con->c); in rtrs_srv_close_work()
1584 rdma_destroy_id(con->c.cm_id); in rtrs_srv_close_work()
1585 kfree(con); in rtrs_srv_close_work()
1595 kfree(srv_path->s.con); in rtrs_srv_close_work()
1669 struct rtrs_srv_con *con; in create_con() local
1674 con = kzalloc(sizeof(*con), GFP_KERNEL); in create_con()
1675 if (!con) { in create_con()
1680 spin_lock_init(&con->rsp_wr_wait_lock); in create_con()
1681 INIT_LIST_HEAD(&con->rsp_wr_wait_list); in create_con()
1682 con->c.cm_id = cm_id; in create_con()
1683 con->c.path = &srv_path->s; in create_con()
1684 con->c.cid = cid; in create_con()
1685 atomic_set(&con->c.wr_cnt, 1); in create_con()
1688 if (con->c.cid == 0) { in create_con()
1712 atomic_set(&con->c.sq_wr_avail, max_send_wr); in create_con()
1716 err = rtrs_cq_qp_create(&srv_path->s, &con->c, 1, cq_vector, cq_num, in create_con()
1723 if (con->c.cid == 0) { in create_con()
1724 err = post_recv_info_req(con); in create_con()
1728 WARN_ON(srv_path->s.con[cid]); in create_con()
1729 srv_path->s.con[cid] = &con->c; in create_con()
1735 cm_id->context = &con->c; in create_con()
1740 rtrs_cq_qp_destroy(&con->c); in create_con()
1742 kfree(con); in create_con()
1788 srv_path->s.con = kcalloc(con_num, sizeof(*srv_path->s.con), in __alloc_path()
1790 if (!srv_path->s.con) in __alloc_path()
1835 kfree(srv_path->s.con); in __alloc_path()
1916 if (s->con[cid]) { in rtrs_rdma_connect()