aboutsummaryrefslogtreecommitdiffstats
path: root/net/sunrpc/xprtrdma/transport.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/sunrpc/xprtrdma/transport.c')
-rw-r--r--net/sunrpc/xprtrdma/transport.c31
1 files changed, 14 insertions, 17 deletions
diff --git a/net/sunrpc/xprtrdma/transport.c b/net/sunrpc/xprtrdma/transport.c
index 187257b1d880..a85e866a77f7 100644
--- a/net/sunrpc/xprtrdma/transport.c
+++ b/net/sunrpc/xprtrdma/transport.c
@@ -305,7 +305,6 @@ xprt_setup_rdma(struct xprt_create *args)
305 /* 60 second timeout, no retries */ 305 /* 60 second timeout, no retries */
306 xprt->timeout = &xprt_rdma_default_timeout; 306 xprt->timeout = &xprt_rdma_default_timeout;
307 xprt->bind_timeout = (60U * HZ); 307 xprt->bind_timeout = (60U * HZ);
308 xprt->connect_timeout = (60U * HZ);
309 xprt->reestablish_timeout = (5U * HZ); 308 xprt->reestablish_timeout = (5U * HZ);
310 xprt->idle_timeout = (5U * 60 * HZ); 309 xprt->idle_timeout = (5U * 60 * HZ);
311 310
@@ -449,21 +448,19 @@ xprt_rdma_connect(struct rpc_task *task)
449 struct rpc_xprt *xprt = (struct rpc_xprt *)task->tk_xprt; 448 struct rpc_xprt *xprt = (struct rpc_xprt *)task->tk_xprt;
450 struct rpcrdma_xprt *r_xprt = rpcx_to_rdmax(xprt); 449 struct rpcrdma_xprt *r_xprt = rpcx_to_rdmax(xprt);
451 450
452 if (!xprt_test_and_set_connecting(xprt)) { 451 if (r_xprt->rx_ep.rep_connected != 0) {
453 if (r_xprt->rx_ep.rep_connected != 0) { 452 /* Reconnect */
454 /* Reconnect */ 453 schedule_delayed_work(&r_xprt->rdma_connect,
455 schedule_delayed_work(&r_xprt->rdma_connect, 454 xprt->reestablish_timeout);
456 xprt->reestablish_timeout); 455 xprt->reestablish_timeout <<= 1;
457 xprt->reestablish_timeout <<= 1; 456 if (xprt->reestablish_timeout > (30 * HZ))
458 if (xprt->reestablish_timeout > (30 * HZ)) 457 xprt->reestablish_timeout = (30 * HZ);
459 xprt->reestablish_timeout = (30 * HZ); 458 else if (xprt->reestablish_timeout < (5 * HZ))
460 else if (xprt->reestablish_timeout < (5 * HZ)) 459 xprt->reestablish_timeout = (5 * HZ);
461 xprt->reestablish_timeout = (5 * HZ); 460 } else {
462 } else { 461 schedule_delayed_work(&r_xprt->rdma_connect, 0);
463 schedule_delayed_work(&r_xprt->rdma_connect, 0); 462 if (!RPC_IS_ASYNC(task))
464 if (!RPC_IS_ASYNC(task)) 463 flush_scheduled_work();
465 flush_scheduled_work();
466 }
467 } 464 }
468} 465}
469 466
@@ -677,7 +674,7 @@ xprt_rdma_send_request(struct rpc_task *task)
677 if (rpcrdma_ep_post(&r_xprt->rx_ia, &r_xprt->rx_ep, req)) 674 if (rpcrdma_ep_post(&r_xprt->rx_ia, &r_xprt->rx_ep, req))
678 goto drop_connection; 675 goto drop_connection;
679 676
680 task->tk_bytes_sent += rqst->rq_snd_buf.len; 677 rqst->rq_xmit_bytes_sent += rqst->rq_snd_buf.len;
681 rqst->rq_bytes_sent = 0; 678 rqst->rq_bytes_sent = 0;
682 return 0; 679 return 0;
683 680