Skip to content

Commit 7903d44

Browse files
dhowellskuba-moo
authored andcommitted
rxrpc: Don't use received skbuff timestamps
Don't use received skbuff timestamps, but rather set a timestamp when an ack is processed so that the time taken to get to rxrpc_input_ack() is included in the RTT. The timestamp of the latest ACK received is tracked in call->acks_latest_ts. Signed-off-by: David Howells <[email protected]> cc: Marc Dionne <[email protected]> cc: [email protected] Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent dcdff0d commit 7903d44

File tree

2 files changed

+10
-12
lines changed

2 files changed

+10
-12
lines changed

net/rxrpc/input.c

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1037,14 +1037,6 @@ static void rxrpc_input_ack(struct rxrpc_call *call, struct sk_buff *skb)
10371037
rxrpc_inc_stat(call->rxnet, stat_rx_acks[summary.ack_reason]);
10381038
prefetch(call->tx_queue);
10391039

1040-
if (summary.acked_serial != 0) {
1041-
if (summary.ack_reason == RXRPC_ACK_PING_RESPONSE)
1042-
rxrpc_complete_rtt_probe(call, skb->tstamp, summary.acked_serial,
1043-
ack_serial, rxrpc_rtt_rx_ping_response);
1044-
else
1045-
summary.rtt_sample_avail = true;
1046-
}
1047-
10481040
/* If we get an EXCEEDS_WINDOW ACK from the server, it probably
10491041
* indicates that the client address changed due to NAT. The server
10501042
* lost the call because it switched to a different peer.
@@ -1087,7 +1079,7 @@ static void rxrpc_input_ack(struct rxrpc_call *call, struct sk_buff *skb)
10871079
if (nr_acks > 0)
10881080
skb_condense(skb);
10891081

1090-
call->acks_latest_ts = skb->tstamp;
1082+
call->acks_latest_ts = ktime_get_real();
10911083
call->acks_hard_ack = hard_ack;
10921084
call->acks_prev_seq = prev_pkt;
10931085

@@ -1108,6 +1100,15 @@ static void rxrpc_input_ack(struct rxrpc_call *call, struct sk_buff *skb)
11081100
if (hard_ack + 1 == 0)
11091101
return rxrpc_proto_abort(call, 0, rxrpc_eproto_ackr_zero);
11101102

1103+
if (summary.acked_serial != 0) {
1104+
if (summary.ack_reason == RXRPC_ACK_PING_RESPONSE)
1105+
rxrpc_complete_rtt_probe(call, call->acks_latest_ts,
1106+
summary.acked_serial, ack_serial,
1107+
rxrpc_rtt_rx_ping_response);
1108+
else
1109+
summary.rtt_sample_avail = true;
1110+
}
1111+
11111112
/* Ignore ACKs unless we are or have just been transmitting. */
11121113
switch (__rxrpc_call_state(call)) {
11131114
case RXRPC_CALL_CLIENT_SEND_REQUEST:

net/rxrpc/local_object.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -215,9 +215,6 @@ static int rxrpc_open_socket(struct rxrpc_local *local, struct net *net)
215215

216216
/* we want to set the don't fragment bit */
217217
rxrpc_local_dont_fragment(local, true);
218-
219-
/* We want receive timestamps. */
220-
sock_enable_timestamps(usk);
221218
break;
222219

223220
default:

0 commit comments

Comments
 (0)