@@ -397,18 +397,22 @@ static struct svc_xprt *svc_rdma_accept(struct svc_xprt *xprt)
397397 dev = newxprt -> sc_cm_id -> device ;
398398 newxprt -> sc_port_num = newxprt -> sc_cm_id -> port_num ;
399399
400- /* Qualify the transport resource defaults with the
401- * capabilities of this particular device */
400+ newxprt -> sc_max_req_size = svcrdma_max_req_size ;
401+ newxprt -> sc_max_requests = svcrdma_max_requests ;
402+ newxprt -> sc_max_bc_requests = svcrdma_max_bc_requests ;
403+ newxprt -> sc_recv_batch = RPCRDMA_MAX_RECV_BATCH ;
404+ newxprt -> sc_fc_credits = cpu_to_be32 (newxprt -> sc_max_requests );
405+
406+ /* Qualify the transport's resource defaults with the
407+ * capabilities of this particular device.
408+ */
409+
402410 /* Transport header, head iovec, tail iovec */
403411 newxprt -> sc_max_send_sges = 3 ;
404412 /* Add one SGE per page list entry */
405413 newxprt -> sc_max_send_sges += (svcrdma_max_req_size / PAGE_SIZE ) + 1 ;
406414 if (newxprt -> sc_max_send_sges > dev -> attrs .max_send_sge )
407415 newxprt -> sc_max_send_sges = dev -> attrs .max_send_sge ;
408- newxprt -> sc_max_req_size = svcrdma_max_req_size ;
409- newxprt -> sc_max_requests = svcrdma_max_requests ;
410- newxprt -> sc_max_bc_requests = svcrdma_max_bc_requests ;
411- newxprt -> sc_recv_batch = RPCRDMA_MAX_RECV_BATCH ;
412416 rq_depth = newxprt -> sc_max_requests + newxprt -> sc_max_bc_requests +
413417 newxprt -> sc_recv_batch ;
414418 if (rq_depth > dev -> attrs .max_qp_wr ) {
@@ -417,7 +421,6 @@ static struct svc_xprt *svc_rdma_accept(struct svc_xprt *xprt)
417421 newxprt -> sc_max_requests = rq_depth - 2 ;
418422 newxprt -> sc_max_bc_requests = 2 ;
419423 }
420- newxprt -> sc_fc_credits = cpu_to_be32 (newxprt -> sc_max_requests );
421424 ctxts = rdma_rw_mr_factor (dev , newxprt -> sc_port_num , RPCSVC_MAXPAGES );
422425 ctxts *= newxprt -> sc_max_requests ;
423426 newxprt -> sc_sq_depth = rq_depth + ctxts ;
0 commit comments