aboutsummaryrefslogtreecommitdiffstats
path: root/net/rxrpc/input.c
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2018-09-27 10:13:08 -0400
committerDavid Howells <dhowells@redhat.com>2018-09-28 05:32:03 -0400
commitb604dd9883f783a94020d772e4fe03160f455372 (patch)
tree4aea958be93cbd979e2325ac8a2126b836f13f9c /net/rxrpc/input.c
parentdc71db34e4f3c06b8277c8f3c2ff014610607a8c (diff)
rxrpc: Fix RTT gathering
Fix RTT information gathering in AF_RXRPC by the following means: (1) Enable Rx timestamping on the transport socket with SO_TIMESTAMPNS. (2) If the sk_buff doesn't have a timestamp set when rxrpc_data_ready() collects it, set it at that point. (3) Allow ACKs to be requested on the last packet of a client call, but not a service call. We need to be careful lest we undo: bf7d620abf22c321208a4da4f435e7af52551a21 Author: David Howells <dhowells@redhat.com> Date: Thu Oct 6 08:11:51 2016 +0100 rxrpc: Don't request an ACK on the last DATA packet of a call's Tx phase but that only really applies to service calls that we're handling, since the client side gets to send the final ACK (or not). (4) When about to transmit an ACK or DATA packet, record the Tx timestamp before only; don't update the timestamp afterwards. (5) Switch the ordering between recording the serial and recording the timestamp to always set the serial number first. The serial number shouldn't be seen referenced by an ACK packet until we've transmitted the packet bearing it - so in the Rx path, we don't need the timestamp until we've checked the serial number. Fixes: cf1a6474f807 ("rxrpc: Add per-peer RTT tracker") Signed-off-by: David Howells <dhowells@redhat.com>
Diffstat (limited to 'net/rxrpc/input.c')
-rw-r--r--net/rxrpc/input.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/net/rxrpc/input.c b/net/rxrpc/input.c
index ec299c627f77..7f9ed3a60b9a 100644
--- a/net/rxrpc/input.c
+++ b/net/rxrpc/input.c
@@ -622,13 +622,14 @@ static void rxrpc_input_requested_ack(struct rxrpc_call *call,
622 if (!skb) 622 if (!skb)
623 continue; 623 continue;
624 624
625 sent_at = skb->tstamp;
626 smp_rmb(); /* Read timestamp before serial. */
625 sp = rxrpc_skb(skb); 627 sp = rxrpc_skb(skb);
626 if (sp->hdr.serial != orig_serial) 628 if (sp->hdr.serial != orig_serial)
627 continue; 629 continue;
628 smp_rmb();
629 sent_at = skb->tstamp;
630 goto found; 630 goto found;
631 } 631 }
632
632 return; 633 return;
633 634
634found: 635found:
@@ -1143,6 +1144,9 @@ void rxrpc_data_ready(struct sock *udp_sk)
1143 return; 1144 return;
1144 } 1145 }
1145 1146
1147 if (skb->tstamp == 0)
1148 skb->tstamp = ktime_get_real();
1149
1146 rxrpc_new_skb(skb, rxrpc_skb_rx_received); 1150 rxrpc_new_skb(skb, rxrpc_skb_rx_received);
1147 1151
1148 _net("recv skb %p", skb); 1152 _net("recv skb %p", skb);