Lines Matching refs:ep

148 	struct rpcrdma_ep *ep = context;  in rpcrdma_qp_async_error_upcall()  local
153 if (ep->rep_connected == 1) { in rpcrdma_qp_async_error_upcall()
154 ep->rep_connected = -EIO; in rpcrdma_qp_async_error_upcall()
155 rpcrdma_conn_func(ep); in rpcrdma_qp_async_error_upcall()
156 wake_up_all(&ep->rep_connect_wait); in rpcrdma_qp_async_error_upcall()
163 struct rpcrdma_ep *ep = context; in rpcrdma_cq_async_error_upcall() local
168 if (ep->rep_connected == 1) { in rpcrdma_cq_async_error_upcall()
169 ep->rep_connected = -EIO; in rpcrdma_cq_async_error_upcall()
170 rpcrdma_conn_func(ep); in rpcrdma_cq_async_error_upcall()
171 wake_up_all(&ep->rep_connect_wait); in rpcrdma_cq_async_error_upcall()
222 rpcrdma_sendcq_poll(struct ib_cq *cq, struct rpcrdma_ep *ep) in rpcrdma_sendcq_poll() argument
229 wcs = ep->rep_send_wcs; in rpcrdma_sendcq_poll()
253 struct rpcrdma_ep *ep = (struct rpcrdma_ep *)cq_context; in rpcrdma_sendcq_upcall() local
256 rc = rpcrdma_sendcq_poll(cq, ep); in rpcrdma_sendcq_upcall()
273 rpcrdma_sendcq_poll(cq, ep); in rpcrdma_sendcq_upcall()
311 rpcrdma_recvcq_poll(struct ib_cq *cq, struct rpcrdma_ep *ep) in rpcrdma_recvcq_poll() argument
320 wcs = ep->rep_recv_wcs; in rpcrdma_recvcq_poll()
352 struct rpcrdma_ep *ep = (struct rpcrdma_ep *)cq_context; in rpcrdma_recvcq_upcall() local
355 rc = rpcrdma_recvcq_poll(cq, ep); in rpcrdma_recvcq_upcall()
372 rpcrdma_recvcq_poll(cq, ep); in rpcrdma_recvcq_upcall()
376 rpcrdma_flush_cqs(struct rpcrdma_ep *ep) in rpcrdma_flush_cqs() argument
381 while (ib_poll_cq(ep->rep_attr.recv_cq, 1, &wc) > 0) in rpcrdma_flush_cqs()
385 while (ib_poll_cq(ep->rep_attr.send_cq, 1, &wc) > 0) in rpcrdma_flush_cqs()
419 struct rpcrdma_ep *ep = &xprt->rx_ep; in rpcrdma_conn_upcall() local
421 struct sockaddr *sap = (struct sockaddr *)&ep->rep_remote_addr; in rpcrdma_conn_upcall()
436 __func__, ep); in rpcrdma_conn_upcall()
442 __func__, ep); in rpcrdma_conn_upcall()
472 ep->rep_connected = connstate; in rpcrdma_conn_upcall()
473 rpcrdma_conn_func(ep); in rpcrdma_conn_upcall()
474 wake_up_all(&ep->rep_connect_wait); in rpcrdma_conn_upcall()
478 __func__, sap, rpc_get_port(sap), ep, in rpcrdma_conn_upcall()
486 int tird = ep->rep_remote_cma.responder_resources; in rpcrdma_conn_upcall()
722 rpcrdma_ep_create(struct rpcrdma_ep *ep, struct rpcrdma_ia *ia, in rpcrdma_ep_create() argument
733 ep->rep_attr.event_handler = rpcrdma_qp_async_error_upcall; in rpcrdma_ep_create()
734 ep->rep_attr.qp_context = ep; in rpcrdma_ep_create()
735 ep->rep_attr.srq = NULL; in rpcrdma_ep_create()
736 ep->rep_attr.cap.max_send_wr = cdata->max_requests; in rpcrdma_ep_create()
737 rc = ia->ri_ops->ro_open(ia, ep, cdata); in rpcrdma_ep_create()
740 ep->rep_attr.cap.max_recv_wr = cdata->max_requests; in rpcrdma_ep_create()
741 ep->rep_attr.cap.max_send_sge = (cdata->padding ? 4 : 2); in rpcrdma_ep_create()
742 ep->rep_attr.cap.max_recv_sge = 1; in rpcrdma_ep_create()
743 ep->rep_attr.cap.max_inline_data = 0; in rpcrdma_ep_create()
744 ep->rep_attr.sq_sig_type = IB_SIGNAL_REQ_WR; in rpcrdma_ep_create()
745 ep->rep_attr.qp_type = IB_QPT_RC; in rpcrdma_ep_create()
746 ep->rep_attr.port_num = ~0; in rpcrdma_ep_create()
749 ep->rep_padbuf = rpcrdma_alloc_regbuf(ia, cdata->padding, in rpcrdma_ep_create()
751 if (IS_ERR(ep->rep_padbuf)) in rpcrdma_ep_create()
752 return PTR_ERR(ep->rep_padbuf); in rpcrdma_ep_create()
754 ep->rep_padbuf = NULL; in rpcrdma_ep_create()
759 ep->rep_attr.cap.max_send_wr, in rpcrdma_ep_create()
760 ep->rep_attr.cap.max_recv_wr, in rpcrdma_ep_create()
761 ep->rep_attr.cap.max_send_sge, in rpcrdma_ep_create()
762 ep->rep_attr.cap.max_recv_sge); in rpcrdma_ep_create()
765 ep->rep_cqinit = ep->rep_attr.cap.max_send_wr/2 - 1; in rpcrdma_ep_create()
766 if (ep->rep_cqinit > RPCRDMA_MAX_UNSIGNALED_SENDS) in rpcrdma_ep_create()
767 ep->rep_cqinit = RPCRDMA_MAX_UNSIGNALED_SENDS; in rpcrdma_ep_create()
768 else if (ep->rep_cqinit <= 2) in rpcrdma_ep_create()
769 ep->rep_cqinit = 0; in rpcrdma_ep_create()
770 INIT_CQCOUNT(ep); in rpcrdma_ep_create()
771 init_waitqueue_head(&ep->rep_connect_wait); in rpcrdma_ep_create()
772 INIT_DELAYED_WORK(&ep->rep_connect_worker, rpcrdma_connect_worker); in rpcrdma_ep_create()
775 rpcrdma_cq_async_error_upcall, ep, in rpcrdma_ep_create()
776 ep->rep_attr.cap.max_send_wr + 1, 0); in rpcrdma_ep_create()
792 rpcrdma_cq_async_error_upcall, ep, in rpcrdma_ep_create()
793 ep->rep_attr.cap.max_recv_wr + 1, 0); in rpcrdma_ep_create()
809 ep->rep_attr.send_cq = sendcq; in rpcrdma_ep_create()
810 ep->rep_attr.recv_cq = recvcq; in rpcrdma_ep_create()
815 ep->rep_remote_cma.private_data = NULL; in rpcrdma_ep_create()
816 ep->rep_remote_cma.private_data_len = 0; in rpcrdma_ep_create()
819 ep->rep_remote_cma.initiator_depth = 0; in rpcrdma_ep_create()
821 ep->rep_remote_cma.responder_resources = 32; in rpcrdma_ep_create()
823 ep->rep_remote_cma.responder_resources = in rpcrdma_ep_create()
826 ep->rep_remote_cma.retry_count = 7; in rpcrdma_ep_create()
827 ep->rep_remote_cma.flow_control = 0; in rpcrdma_ep_create()
828 ep->rep_remote_cma.rnr_retry_count = 0; in rpcrdma_ep_create()
838 rpcrdma_free_regbuf(ia, ep->rep_padbuf); in rpcrdma_ep_create()
850 rpcrdma_ep_destroy(struct rpcrdma_ep *ep, struct rpcrdma_ia *ia) in rpcrdma_ep_destroy() argument
855 __func__, ep->rep_connected); in rpcrdma_ep_destroy()
857 cancel_delayed_work_sync(&ep->rep_connect_worker); in rpcrdma_ep_destroy()
860 rpcrdma_ep_disconnect(ep, ia); in rpcrdma_ep_destroy()
865 rpcrdma_free_regbuf(ia, ep->rep_padbuf); in rpcrdma_ep_destroy()
867 rpcrdma_clean_cq(ep->rep_attr.recv_cq); in rpcrdma_ep_destroy()
868 rc = ib_destroy_cq(ep->rep_attr.recv_cq); in rpcrdma_ep_destroy()
873 rpcrdma_clean_cq(ep->rep_attr.send_cq); in rpcrdma_ep_destroy()
874 rc = ib_destroy_cq(ep->rep_attr.send_cq); in rpcrdma_ep_destroy()
884 rpcrdma_ep_connect(struct rpcrdma_ep *ep, struct rpcrdma_ia *ia) in rpcrdma_ep_connect() argument
890 if (ep->rep_connected != 0) { in rpcrdma_ep_connect()
895 rpcrdma_ep_disconnect(ep, ia); in rpcrdma_ep_connect()
896 rpcrdma_flush_cqs(ep); in rpcrdma_ep_connect()
922 rc = rdma_create_qp(id, ia->ri_pd, &ep->rep_attr); in rpcrdma_ep_connect()
940 rc = rdma_create_qp(ia->ri_id, ia->ri_pd, &ep->rep_attr); in rpcrdma_ep_connect()
949 ep->rep_connected = 0; in rpcrdma_ep_connect()
951 rc = rdma_connect(ia->ri_id, &ep->rep_remote_cma); in rpcrdma_ep_connect()
958 wait_event_interruptible(ep->rep_connect_wait, ep->rep_connected != 0); in rpcrdma_ep_connect()
966 if (ep->rep_connected == -ECONNREFUSED && in rpcrdma_ep_connect()
971 if (ep->rep_connected <= 0) { in rpcrdma_ep_connect()
975 (ep->rep_remote_cma.responder_resources == 0 || in rpcrdma_ep_connect()
976 ep->rep_remote_cma.initiator_depth != in rpcrdma_ep_connect()
977 ep->rep_remote_cma.responder_resources)) { in rpcrdma_ep_connect()
978 if (ep->rep_remote_cma.responder_resources == 0) in rpcrdma_ep_connect()
979 ep->rep_remote_cma.responder_resources = 1; in rpcrdma_ep_connect()
980 ep->rep_remote_cma.initiator_depth = in rpcrdma_ep_connect()
981 ep->rep_remote_cma.responder_resources; in rpcrdma_ep_connect()
984 rc = ep->rep_connected; in rpcrdma_ep_connect()
991 ep->rep_connected = rc; in rpcrdma_ep_connect()
1005 rpcrdma_ep_disconnect(struct rpcrdma_ep *ep, struct rpcrdma_ia *ia) in rpcrdma_ep_disconnect() argument
1009 rpcrdma_flush_cqs(ep); in rpcrdma_ep_disconnect()
1013 wait_event_interruptible(ep->rep_connect_wait, in rpcrdma_ep_disconnect()
1014 ep->rep_connected != 1); in rpcrdma_ep_disconnect()
1016 (ep->rep_connected == 1) ? "still " : "dis"); in rpcrdma_ep_disconnect()
1019 ep->rep_connected = rc; in rpcrdma_ep_disconnect()
1578 struct rpcrdma_ep *ep, in rpcrdma_ep_post() argument
1586 rc = rpcrdma_ep_post_recv(ia, ep, rep); in rpcrdma_ep_post()
1608 if (DECR_CQCOUNT(ep) > 0) in rpcrdma_ep_post()
1611 INIT_CQCOUNT(ep); in rpcrdma_ep_post()
1628 struct rpcrdma_ep *ep, in rpcrdma_ep_post_recv() argument