Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
[sfrench/cifs-2.6.git] / net / rxrpc / peer_event.c
index 923b263c401b34ff8bd3ff46c24c3847fbe4ffec..b1449d971883613b026df3d65912a7b3dd0b4885 100644 (file)
@@ -295,52 +295,6 @@ static void rxrpc_distribute_error(struct rxrpc_peer *peer, int error,
        }
 }
 
-/*
- * Add RTT information to cache.  This is called in softirq mode and has
- * exclusive access to the peer RTT data.
- */
-void rxrpc_peer_add_rtt(struct rxrpc_call *call, enum rxrpc_rtt_rx_trace why,
-                       rxrpc_serial_t send_serial, rxrpc_serial_t resp_serial,
-                       ktime_t send_time, ktime_t resp_time)
-{
-       struct rxrpc_peer *peer = call->peer;
-       s64 rtt;
-       u64 sum = peer->rtt_sum, avg;
-       u8 cursor = peer->rtt_cursor, usage = peer->rtt_usage;
-
-       rtt = ktime_to_ns(ktime_sub(resp_time, send_time));
-       if (rtt < 0)
-               return;
-
-       spin_lock(&peer->rtt_input_lock);
-
-       /* Replace the oldest datum in the RTT buffer */
-       sum -= peer->rtt_cache[cursor];
-       sum += rtt;
-       peer->rtt_cache[cursor] = rtt;
-       peer->rtt_cursor = (cursor + 1) & (RXRPC_RTT_CACHE_SIZE - 1);
-       peer->rtt_sum = sum;
-       if (usage < RXRPC_RTT_CACHE_SIZE) {
-               usage++;
-               peer->rtt_usage = usage;
-       }
-
-       spin_unlock(&peer->rtt_input_lock);
-
-       /* Now recalculate the average */
-       if (usage == RXRPC_RTT_CACHE_SIZE) {
-               avg = sum / RXRPC_RTT_CACHE_SIZE;
-       } else {
-               avg = sum;
-               do_div(avg, usage);
-       }
-
-       /* Don't need to update this under lock */
-       peer->rtt = avg;
-       trace_rxrpc_rtt_rx(call, why, send_serial, resp_serial, rtt,
-                          usage, avg);
-}
-
 /*
  * Perform keep-alive pings.
  */