Lines Matching +full:rpc +full:- +full:if
1 // SPDX-License-Identifier: GPL-2.0-only
5 * Estimate RPC request round trip time.
7 * Based on packet round-trip and variance estimator algorithms described
12 * This RTT estimator is used only for RPC over datagram protocols.
30 * rpc_init_rtt - Initialize an RPC RTT estimator context
40 rt->timeo = timeo; in rpc_init_rtt()
42 if (timeo > RPC_RTO_INIT) in rpc_init_rtt()
43 init = (timeo - RPC_RTO_INIT) << 3; in rpc_init_rtt()
45 rt->srtt[i] = init; in rpc_init_rtt()
46 rt->sdrtt[i] = RPC_RTO_INIT; in rpc_init_rtt()
47 rt->ntimeouts[i] = 0; in rpc_init_rtt()
53 * rpc_update_rtt - Update an RPC RTT estimator context
65 if (timer-- == 0) in rpc_update_rtt()
69 if (m < 0) in rpc_update_rtt()
72 if (m == 0) in rpc_update_rtt()
75 srtt = (long *)&rt->srtt[timer]; in rpc_update_rtt()
76 m -= *srtt >> 3; in rpc_update_rtt()
79 if (m < 0) in rpc_update_rtt()
80 m = -m; in rpc_update_rtt()
82 sdrtt = (long *)&rt->sdrtt[timer]; in rpc_update_rtt()
83 m -= *sdrtt >> 2; in rpc_update_rtt()
87 if (*sdrtt < RPC_RTO_MIN) in rpc_update_rtt()
93 * rpc_calc_rto - Provide an estimated timeout value
97 * Estimate RTO for an NFS RPC sent via an unreliable datagram. Use
98 * the mean and mean deviation of RTT for the appropriate type of RPC
103 * stale. Also, since many of these RPCs are non-idempotent, a
107 * read, write, commit - A+4D
108 * other - timeo
114 if (timer-- == 0) in rpc_calc_rto()
115 return rt->timeo; in rpc_calc_rto()
117 res = ((rt->srtt[timer] + 7) >> 3) + rt->sdrtt[timer]; in rpc_calc_rto()
118 if (res > RPC_RTO_MAX) in rpc_calc_rto()