aboutsummaryrefslogtreecommitdiffstats
path: root/net/sunrpc/xprtsock.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/sunrpc/xprtsock.c')
-rw-r--r--net/sunrpc/xprtsock.c40
1 files changed, 3 insertions, 37 deletions
diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c
index 9847c30b5001..02fc7f04dd17 100644
--- a/net/sunrpc/xprtsock.c
+++ b/net/sunrpc/xprtsock.c
@@ -138,20 +138,6 @@ static ctl_table sunrpc_table[] = {
138#endif 138#endif
139 139
140/* 140/*
141 * Time out for an RPC UDP socket connect. UDP socket connects are
142 * synchronous, but we set a timeout anyway in case of resource
143 * exhaustion on the local host.
144 */
145#define XS_UDP_CONN_TO (5U * HZ)
146
147/*
148 * Wait duration for an RPC TCP connection to be established. Solaris
149 * NFS over TCP uses 60 seconds, for example, which is in line with how
150 * long a server takes to reboot.
151 */
152#define XS_TCP_CONN_TO (60U * HZ)
153
154/*
155 * Wait duration for a reply from the RPC portmapper. 141 * Wait duration for a reply from the RPC portmapper.
156 */ 142 */
157#define XS_BIND_TO (60U * HZ) 143#define XS_BIND_TO (60U * HZ)
@@ -542,7 +528,7 @@ static int xs_udp_send_request(struct rpc_task *task)
542 xdr->len - req->rq_bytes_sent, status); 528 xdr->len - req->rq_bytes_sent, status);
543 529
544 if (status >= 0) { 530 if (status >= 0) {
545 task->tk_bytes_sent += status; 531 req->rq_xmit_bytes_sent += status;
546 if (status >= req->rq_slen) 532 if (status >= req->rq_slen)
547 return 0; 533 return 0;
548 /* Still some bytes left; set up for a retry later. */ 534 /* Still some bytes left; set up for a retry later. */
@@ -638,7 +624,7 @@ static int xs_tcp_send_request(struct rpc_task *task)
638 /* If we've sent the entire packet, immediately 624 /* If we've sent the entire packet, immediately
639 * reset the count of bytes sent. */ 625 * reset the count of bytes sent. */
640 req->rq_bytes_sent += status; 626 req->rq_bytes_sent += status;
641 task->tk_bytes_sent += status; 627 req->rq_xmit_bytes_sent += status;
642 if (likely(req->rq_bytes_sent >= req->rq_slen)) { 628 if (likely(req->rq_bytes_sent >= req->rq_slen)) {
643 req->rq_bytes_sent = 0; 629 req->rq_bytes_sent = 0;
644 return 0; 630 return 0;
@@ -858,7 +844,6 @@ static void xs_udp_data_ready(struct sock *sk, int len)
858 dst_confirm(skb_dst(skb)); 844 dst_confirm(skb_dst(skb));
859 845
860 xprt_adjust_cwnd(task, copied); 846 xprt_adjust_cwnd(task, copied);
861 xprt_update_rtt(task);
862 xprt_complete_rqst(task, copied); 847 xprt_complete_rqst(task, copied);
863 848
864 out_unlock: 849 out_unlock:
@@ -2016,9 +2001,6 @@ static void xs_connect(struct rpc_task *task)
2016 struct rpc_xprt *xprt = task->tk_xprt; 2001 struct rpc_xprt *xprt = task->tk_xprt;
2017 struct sock_xprt *transport = container_of(xprt, struct sock_xprt, xprt); 2002 struct sock_xprt *transport = container_of(xprt, struct sock_xprt, xprt);
2018 2003
2019 if (xprt_test_and_set_connecting(xprt))
2020 return;
2021
2022 if (transport->sock != NULL && !RPC_IS_SOFTCONN(task)) { 2004 if (transport->sock != NULL && !RPC_IS_SOFTCONN(task)) {
2023 dprintk("RPC: xs_connect delayed xprt %p for %lu " 2005 dprintk("RPC: xs_connect delayed xprt %p for %lu "
2024 "seconds\n", 2006 "seconds\n",
@@ -2038,16 +2020,6 @@ static void xs_connect(struct rpc_task *task)
2038 } 2020 }
2039} 2021}
2040 2022
2041static void xs_tcp_connect(struct rpc_task *task)
2042{
2043 struct rpc_xprt *xprt = task->tk_xprt;
2044
2045 /* Exit if we need to wait for socket shutdown to complete */
2046 if (test_bit(XPRT_CLOSING, &xprt->state))
2047 return;
2048 xs_connect(task);
2049}
2050
2051/** 2023/**
2052 * xs_udp_print_stats - display UDP socket-specifc stats 2024 * xs_udp_print_stats - display UDP socket-specifc stats
2053 * @xprt: rpc_xprt struct containing statistics 2025 * @xprt: rpc_xprt struct containing statistics
@@ -2246,7 +2218,7 @@ static struct rpc_xprt_ops xs_tcp_ops = {
2246 .release_xprt = xs_tcp_release_xprt, 2218 .release_xprt = xs_tcp_release_xprt,
2247 .rpcbind = rpcb_getport_async, 2219 .rpcbind = rpcb_getport_async,
2248 .set_port = xs_set_port, 2220 .set_port = xs_set_port,
2249 .connect = xs_tcp_connect, 2221 .connect = xs_connect,
2250 .buf_alloc = rpc_malloc, 2222 .buf_alloc = rpc_malloc,
2251 .buf_free = rpc_free, 2223 .buf_free = rpc_free,
2252 .send_request = xs_tcp_send_request, 2224 .send_request = xs_tcp_send_request,
@@ -2337,7 +2309,6 @@ static struct rpc_xprt *xs_setup_udp(struct xprt_create *args)
2337 xprt->max_payload = (1U << 16) - (MAX_HEADER << 3); 2309 xprt->max_payload = (1U << 16) - (MAX_HEADER << 3);
2338 2310
2339 xprt->bind_timeout = XS_BIND_TO; 2311 xprt->bind_timeout = XS_BIND_TO;
2340 xprt->connect_timeout = XS_UDP_CONN_TO;
2341 xprt->reestablish_timeout = XS_UDP_REEST_TO; 2312 xprt->reestablish_timeout = XS_UDP_REEST_TO;
2342 xprt->idle_timeout = XS_IDLE_DISC_TO; 2313 xprt->idle_timeout = XS_IDLE_DISC_TO;
2343 2314
@@ -2412,7 +2383,6 @@ static struct rpc_xprt *xs_setup_tcp(struct xprt_create *args)
2412 xprt->max_payload = RPC_MAX_FRAGMENT_SIZE; 2383 xprt->max_payload = RPC_MAX_FRAGMENT_SIZE;
2413 2384
2414 xprt->bind_timeout = XS_BIND_TO; 2385 xprt->bind_timeout = XS_BIND_TO;
2415 xprt->connect_timeout = XS_TCP_CONN_TO;
2416 xprt->reestablish_timeout = XS_TCP_INIT_REEST_TO; 2386 xprt->reestablish_timeout = XS_TCP_INIT_REEST_TO;
2417 xprt->idle_timeout = XS_IDLE_DISC_TO; 2387 xprt->idle_timeout = XS_IDLE_DISC_TO;
2418 2388
@@ -2472,9 +2442,6 @@ static struct rpc_xprt *xs_setup_bc_tcp(struct xprt_create *args)
2472 struct sock_xprt *transport; 2442 struct sock_xprt *transport;
2473 struct svc_sock *bc_sock; 2443 struct svc_sock *bc_sock;
2474 2444
2475 if (!args->bc_xprt)
2476 ERR_PTR(-EINVAL);
2477
2478 xprt = xs_setup_xprt(args, xprt_tcp_slot_table_entries); 2445 xprt = xs_setup_xprt(args, xprt_tcp_slot_table_entries);
2479 if (IS_ERR(xprt)) 2446 if (IS_ERR(xprt))
2480 return xprt; 2447 return xprt;
@@ -2488,7 +2455,6 @@ static struct rpc_xprt *xs_setup_bc_tcp(struct xprt_create *args)
2488 /* backchannel */ 2455 /* backchannel */
2489 xprt_set_bound(xprt); 2456 xprt_set_bound(xprt);
2490 xprt->bind_timeout = 0; 2457 xprt->bind_timeout = 0;
2491 xprt->connect_timeout = 0;
2492 xprt->reestablish_timeout = 0; 2458 xprt->reestablish_timeout = 0;
2493 xprt->idle_timeout = 0; 2459 xprt->idle_timeout = 0;
2494 2460