Lines Matching defs:newxprt
565 struct svcxprt_rdma *newxprt;
569 newxprt = rdma_create_xprt(listen_xprt->sc_xprt.xpt_server, 0);
570 if (!newxprt) {
574 newxprt->sc_cm_id = new_cma_id;
575 new_cma_id->context = newxprt;
576 dprintk("svcrdma: Creating newxprt=%p, cm_id=%p, listenxprt=%p\n",
577 newxprt, newxprt->sc_cm_id, listen_xprt);
580 newxprt->sc_ord = client_ird;
583 sa = (struct sockaddr *)&newxprt->sc_cm_id->route.addr.dst_addr;
584 svc_xprt_set_remote(&newxprt->sc_xprt, sa, svc_addr_len(sa));
585 sa = (struct sockaddr *)&newxprt->sc_cm_id->route.addr.src_addr;
586 svc_xprt_set_local(&newxprt->sc_xprt, sa, svc_addr_len(sa));
593 list_add_tail(&newxprt->sc_accept_q, &listen_xprt->sc_accept_q);
845 struct svcxprt_rdma *newxprt = NULL;
859 newxprt = list_entry(listen_rdma->sc_accept_q.next,
861 list_del_init(&newxprt->sc_accept_q);
866 if (!newxprt)
869 dprintk("svcrdma: newxprt from accept queue = %p, cm_id=%p\n",
870 newxprt, newxprt->sc_cm_id);
872 ret = ib_query_device(newxprt->sc_cm_id->device, &devattr);
875 "device %p, rc=%d\n", newxprt->sc_cm_id->device, ret);
881 newxprt->sc_max_sge = min((size_t)devattr.max_sge,
883 newxprt->sc_max_requests = min((size_t)devattr.max_qp_wr,
885 newxprt->sc_sq_depth = RPCRDMA_SQ_DEPTH_MULT * newxprt->sc_max_requests;
891 newxprt->sc_ord = min_t(size_t, devattr.max_qp_rd_atom, newxprt->sc_ord);
892 newxprt->sc_ord = min_t(size_t, svcrdma_ord, newxprt->sc_ord);
894 newxprt->sc_pd = ib_alloc_pd(newxprt->sc_cm_id->device);
895 if (IS_ERR(newxprt->sc_pd)) {
899 newxprt->sc_sq_cq = ib_create_cq(newxprt->sc_cm_id->device,
902 newxprt,
903 newxprt->sc_sq_depth,
905 if (IS_ERR(newxprt->sc_sq_cq)) {
909 newxprt->sc_rq_cq = ib_create_cq(newxprt->sc_cm_id->device,
912 newxprt,
913 newxprt->sc_max_requests,
915 if (IS_ERR(newxprt->sc_rq_cq)) {
922 qp_attr.qp_context = &newxprt->sc_xprt;
923 qp_attr.cap.max_send_wr = newxprt->sc_sq_depth;
924 qp_attr.cap.max_recv_wr = newxprt->sc_max_requests;
925 qp_attr.cap.max_send_sge = newxprt->sc_max_sge;
926 qp_attr.cap.max_recv_sge = newxprt->sc_max_sge;
929 qp_attr.send_cq = newxprt->sc_sq_cq;
930 qp_attr.recv_cq = newxprt->sc_rq_cq;
931 dprintk("svcrdma: newxprt->sc_cm_id=%p, newxprt->sc_pd=%p\n"
937 newxprt->sc_cm_id, newxprt->sc_pd,
938 newxprt->sc_cm_id->device, newxprt->sc_pd->device,
944 ret = rdma_create_qp(newxprt->sc_cm_id, newxprt->sc_pd, &qp_attr);
949 newxprt->sc_qp = newxprt->sc_cm_id->qp;
974 newxprt->sc_frmr_pg_list_len =
976 newxprt->sc_dev_caps |= SVCRDMA_DEVCAP_FAST_REG;
982 switch (rdma_node_get_transport(newxprt->sc_cm_id->device->node_type)) {
984 newxprt->sc_dev_caps |= SVCRDMA_DEVCAP_READ_W_INV;
985 if (!(newxprt->sc_dev_caps & SVCRDMA_DEVCAP_FAST_REG)) {
997 if (!(newxprt->sc_dev_caps & SVCRDMA_DEVCAP_FAST_REG)) {
1014 newxprt->sc_phys_mr =
1015 ib_get_dma_mr(newxprt->sc_pd, dma_mr_acc);
1016 if (IS_ERR(newxprt->sc_phys_mr)) {
1021 newxprt->sc_dma_lkey = newxprt->sc_phys_mr->lkey;
1023 newxprt->sc_dma_lkey =
1024 newxprt->sc_cm_id->device->local_dma_lkey;
1027 for (i = 0; i < newxprt->sc_max_requests; i++) {
1028 ret = svc_rdma_post_recv(newxprt);
1036 newxprt->sc_cm_id->event_handler = rdma_cma_handler;
1042 ib_req_notify_cq(newxprt->sc_sq_cq, IB_CQ_NEXT_COMP);
1043 ib_req_notify_cq(newxprt->sc_rq_cq, IB_CQ_NEXT_COMP);
1046 set_bit(RDMAXPRT_CONN_PENDING, &newxprt->sc_flags);
1049 conn_param.initiator_depth = newxprt->sc_ord;
1050 ret = rdma_accept(newxprt->sc_cm_id, &conn_param);
1067 newxprt,
1068 &((struct sockaddr_in *)&newxprt->sc_cm_id->
1070 ntohs(((struct sockaddr_in *)&newxprt->sc_cm_id->
1072 &((struct sockaddr_in *)&newxprt->sc_cm_id->
1074 ntohs(((struct sockaddr_in *)&newxprt->sc_cm_id->
1076 newxprt->sc_max_sge,
1077 newxprt->sc_sq_depth,
1078 newxprt->sc_max_requests,
1079 newxprt->sc_ord);
1081 return &newxprt->sc_xprt;
1086 svc_xprt_get(&newxprt->sc_xprt);
1087 if (newxprt->sc_qp && !IS_ERR(newxprt->sc_qp))
1088 ib_destroy_qp(newxprt->sc_qp);
1089 rdma_destroy_id(newxprt->sc_cm_id);
1091 svc_xprt_put(&newxprt->sc_xprt);