Lines Matching refs:ep
103 struct rpcrdma_ep *ep = context; in rpcrdma_qp_async_error_upcall() local
108 if (ep->rep_connected == 1) { in rpcrdma_qp_async_error_upcall()
109 ep->rep_connected = -EIO; in rpcrdma_qp_async_error_upcall()
110 rpcrdma_conn_func(ep); in rpcrdma_qp_async_error_upcall()
111 wake_up_all(&ep->rep_connect_wait); in rpcrdma_qp_async_error_upcall()
118 struct rpcrdma_ep *ep = context; in rpcrdma_cq_async_error_upcall() local
123 if (ep->rep_connected == 1) { in rpcrdma_cq_async_error_upcall()
124 ep->rep_connected = -EIO; in rpcrdma_cq_async_error_upcall()
125 rpcrdma_conn_func(ep); in rpcrdma_cq_async_error_upcall()
126 wake_up_all(&ep->rep_connect_wait); in rpcrdma_cq_async_error_upcall()
265 rpcrdma_flush_cqs(struct rpcrdma_ep *ep) in rpcrdma_flush_cqs() argument
269 while (ib_poll_cq(ep->rep_attr.recv_cq, 1, &wc) > 0) in rpcrdma_flush_cqs()
271 while (ib_poll_cq(ep->rep_attr.send_cq, 1, &wc) > 0) in rpcrdma_flush_cqs()
280 struct rpcrdma_ep *ep = &xprt->rx_ep; in rpcrdma_conn_upcall() local
282 struct sockaddr *sap = (struct sockaddr *)&ep->rep_remote_addr; in rpcrdma_conn_upcall()
297 __func__, ep); in rpcrdma_conn_upcall()
303 __func__, ep); in rpcrdma_conn_upcall()
333 ep->rep_connected = connstate; in rpcrdma_conn_upcall()
334 rpcrdma_conn_func(ep); in rpcrdma_conn_upcall()
335 wake_up_all(&ep->rep_connect_wait); in rpcrdma_conn_upcall()
339 __func__, sap, rpc_get_port(sap), ep, in rpcrdma_conn_upcall()
347 int tird = ep->rep_remote_cma.responder_resources; in rpcrdma_conn_upcall()
566 rpcrdma_ep_create(struct rpcrdma_ep *ep, struct rpcrdma_ia *ia, in rpcrdma_ep_create() argument
592 ep->rep_attr.event_handler = rpcrdma_qp_async_error_upcall; in rpcrdma_ep_create()
593 ep->rep_attr.qp_context = ep; in rpcrdma_ep_create()
594 ep->rep_attr.srq = NULL; in rpcrdma_ep_create()
595 ep->rep_attr.cap.max_send_wr = cdata->max_requests; in rpcrdma_ep_create()
596 ep->rep_attr.cap.max_send_wr += RPCRDMA_BACKWARD_WRS; in rpcrdma_ep_create()
597 rc = ia->ri_ops->ro_open(ia, ep, cdata); in rpcrdma_ep_create()
600 ep->rep_attr.cap.max_recv_wr = cdata->max_requests; in rpcrdma_ep_create()
601 ep->rep_attr.cap.max_recv_wr += RPCRDMA_BACKWARD_WRS; in rpcrdma_ep_create()
602 ep->rep_attr.cap.max_send_sge = RPCRDMA_MAX_IOVS; in rpcrdma_ep_create()
603 ep->rep_attr.cap.max_recv_sge = 1; in rpcrdma_ep_create()
604 ep->rep_attr.cap.max_inline_data = 0; in rpcrdma_ep_create()
605 ep->rep_attr.sq_sig_type = IB_SIGNAL_REQ_WR; in rpcrdma_ep_create()
606 ep->rep_attr.qp_type = IB_QPT_RC; in rpcrdma_ep_create()
607 ep->rep_attr.port_num = ~0; in rpcrdma_ep_create()
612 ep->rep_attr.cap.max_send_wr, in rpcrdma_ep_create()
613 ep->rep_attr.cap.max_recv_wr, in rpcrdma_ep_create()
614 ep->rep_attr.cap.max_send_sge, in rpcrdma_ep_create()
615 ep->rep_attr.cap.max_recv_sge); in rpcrdma_ep_create()
618 ep->rep_cqinit = ep->rep_attr.cap.max_send_wr/2 - 1; in rpcrdma_ep_create()
619 if (ep->rep_cqinit > RPCRDMA_MAX_UNSIGNALED_SENDS) in rpcrdma_ep_create()
620 ep->rep_cqinit = RPCRDMA_MAX_UNSIGNALED_SENDS; in rpcrdma_ep_create()
621 else if (ep->rep_cqinit <= 2) in rpcrdma_ep_create()
622 ep->rep_cqinit = 0; in rpcrdma_ep_create()
623 INIT_CQCOUNT(ep); in rpcrdma_ep_create()
624 init_waitqueue_head(&ep->rep_connect_wait); in rpcrdma_ep_create()
625 INIT_DELAYED_WORK(&ep->rep_connect_worker, rpcrdma_connect_worker); in rpcrdma_ep_create()
627 cq_attr.cqe = ep->rep_attr.cap.max_send_wr + 1; in rpcrdma_ep_create()
644 cq_attr.cqe = ep->rep_attr.cap.max_recv_wr + 1; in rpcrdma_ep_create()
662 ep->rep_attr.send_cq = sendcq; in rpcrdma_ep_create()
663 ep->rep_attr.recv_cq = recvcq; in rpcrdma_ep_create()
668 ep->rep_remote_cma.private_data = NULL; in rpcrdma_ep_create()
669 ep->rep_remote_cma.private_data_len = 0; in rpcrdma_ep_create()
672 ep->rep_remote_cma.initiator_depth = 0; in rpcrdma_ep_create()
674 ep->rep_remote_cma.responder_resources = 32; in rpcrdma_ep_create()
676 ep->rep_remote_cma.responder_resources = in rpcrdma_ep_create()
679 ep->rep_remote_cma.retry_count = 7; in rpcrdma_ep_create()
680 ep->rep_remote_cma.flow_control = 0; in rpcrdma_ep_create()
681 ep->rep_remote_cma.rnr_retry_count = 0; in rpcrdma_ep_create()
704 rpcrdma_ep_destroy(struct rpcrdma_ep *ep, struct rpcrdma_ia *ia) in rpcrdma_ep_destroy() argument
709 __func__, ep->rep_connected); in rpcrdma_ep_destroy()
711 cancel_delayed_work_sync(&ep->rep_connect_worker); in rpcrdma_ep_destroy()
714 rpcrdma_ep_disconnect(ep, ia); in rpcrdma_ep_destroy()
716 rpcrdma_clean_cq(ep->rep_attr.recv_cq); in rpcrdma_ep_destroy()
717 rpcrdma_clean_cq(ep->rep_attr.send_cq); in rpcrdma_ep_destroy()
724 rc = ib_destroy_cq(ep->rep_attr.recv_cq); in rpcrdma_ep_destroy()
729 rc = ib_destroy_cq(ep->rep_attr.send_cq); in rpcrdma_ep_destroy()
745 rpcrdma_ep_connect(struct rpcrdma_ep *ep, struct rpcrdma_ia *ia) in rpcrdma_ep_connect() argument
751 if (ep->rep_connected != 0) { in rpcrdma_ep_connect()
756 rpcrdma_ep_disconnect(ep, ia); in rpcrdma_ep_connect()
757 rpcrdma_flush_cqs(ep); in rpcrdma_ep_connect()
781 rc = rdma_create_qp(id, ia->ri_pd, &ep->rep_attr); in rpcrdma_ep_connect()
799 rc = rdma_create_qp(ia->ri_id, ia->ri_pd, &ep->rep_attr); in rpcrdma_ep_connect()
808 ep->rep_connected = 0; in rpcrdma_ep_connect()
810 rc = rdma_connect(ia->ri_id, &ep->rep_remote_cma); in rpcrdma_ep_connect()
817 wait_event_interruptible(ep->rep_connect_wait, ep->rep_connected != 0); in rpcrdma_ep_connect()
825 if (ep->rep_connected == -ECONNREFUSED && in rpcrdma_ep_connect()
830 if (ep->rep_connected <= 0) { in rpcrdma_ep_connect()
834 (ep->rep_remote_cma.responder_resources == 0 || in rpcrdma_ep_connect()
835 ep->rep_remote_cma.initiator_depth != in rpcrdma_ep_connect()
836 ep->rep_remote_cma.responder_resources)) { in rpcrdma_ep_connect()
837 if (ep->rep_remote_cma.responder_resources == 0) in rpcrdma_ep_connect()
838 ep->rep_remote_cma.responder_resources = 1; in rpcrdma_ep_connect()
839 ep->rep_remote_cma.initiator_depth = in rpcrdma_ep_connect()
840 ep->rep_remote_cma.responder_resources; in rpcrdma_ep_connect()
843 rc = ep->rep_connected; in rpcrdma_ep_connect()
864 ep->rep_connected = rc; in rpcrdma_ep_connect()
878 rpcrdma_ep_disconnect(struct rpcrdma_ep *ep, struct rpcrdma_ia *ia) in rpcrdma_ep_disconnect() argument
882 rpcrdma_flush_cqs(ep); in rpcrdma_ep_disconnect()
886 wait_event_interruptible(ep->rep_connect_wait, in rpcrdma_ep_disconnect()
887 ep->rep_connected != 1); in rpcrdma_ep_disconnect()
889 (ep->rep_connected == 1) ? "still " : "dis"); in rpcrdma_ep_disconnect()
892 ep->rep_connected = rc; in rpcrdma_ep_disconnect()
1254 struct rpcrdma_ep *ep, in rpcrdma_ep_post() argument
1264 rc = rpcrdma_ep_post_recv(ia, ep, rep); in rpcrdma_ep_post()
1282 if (DECR_CQCOUNT(ep) > 0) in rpcrdma_ep_post()
1285 INIT_CQCOUNT(ep); in rpcrdma_ep_post()
1302 struct rpcrdma_ep *ep, in rpcrdma_ep_post_recv() argument
1338 struct rpcrdma_ep *ep = &r_xprt->rx_ep; in rpcrdma_ep_post_extra_recv() local
1350 rc = rpcrdma_ep_post_recv(ia, ep, rep); in rpcrdma_ep_post_extra_recv()