Skip to content

Commit 3798680

Browse files
dhowellsdavem330
authored andcommitted
rxrpc: Fix RTT determination to use any ACK as a source
Fix RTT determination to be able to use any type of ACK as the response from which RTT can be calculated provided its ack.serial is non-zero and matches the serial number of an outgoing DATA or ACK packet. This shouldn't be limited to REQUESTED-type ACKs as these can have other types substituted for them for things like duplicate or out-of-order packets. Fixes: 4700c4d ("rxrpc: Fix loss of RTT samples due to interposed ACK") Signed-off-by: David Howells <[email protected]> cc: Marc Dionne <[email protected]> cc: "David S. Miller" <[email protected]> cc: Eric Dumazet <[email protected]> cc: Jakub Kicinski <[email protected]> cc: Paolo Abeni <[email protected]> cc: [email protected] cc: [email protected] Signed-off-by: David S. Miller <[email protected]>
1 parent 75a50c4 commit 3798680

File tree

2 files changed

+17
-20
lines changed

2 files changed

+17
-20
lines changed

include/trace/events/rxrpc.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@
328328
E_(rxrpc_rtt_tx_ping, "PING")
329329

330330
#define rxrpc_rtt_rx_traces \
331-
EM(rxrpc_rtt_rx_cancel, "CNCL") \
331+
EM(rxrpc_rtt_rx_other_ack, "OACK") \
332332
EM(rxrpc_rtt_rx_obsolete, "OBSL") \
333333
EM(rxrpc_rtt_rx_lost, "LOST") \
334334
EM(rxrpc_rtt_rx_ping_response, "PONG") \

net/rxrpc/input.c

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -643,12 +643,8 @@ static void rxrpc_complete_rtt_probe(struct rxrpc_call *call,
643643
clear_bit(i + RXRPC_CALL_RTT_PEND_SHIFT, &call->rtt_avail);
644644
smp_mb(); /* Read data before setting avail bit */
645645
set_bit(i, &call->rtt_avail);
646-
if (type != rxrpc_rtt_rx_cancel)
647-
rxrpc_peer_add_rtt(call, type, i, acked_serial, ack_serial,
648-
sent_at, resp_time);
649-
else
650-
trace_rxrpc_rtt_rx(call, rxrpc_rtt_rx_cancel, i,
651-
orig_serial, acked_serial, 0, 0);
646+
rxrpc_peer_add_rtt(call, type, i, acked_serial, ack_serial,
647+
sent_at, resp_time);
652648
matched = true;
653649
}
654650

@@ -801,20 +797,21 @@ static void rxrpc_input_ack(struct rxrpc_call *call, struct sk_buff *skb)
801797
summary.ack_reason, nr_acks);
802798
rxrpc_inc_stat(call->rxnet, stat_rx_acks[ack.reason]);
803799

804-
switch (ack.reason) {
805-
case RXRPC_ACK_PING_RESPONSE:
806-
rxrpc_complete_rtt_probe(call, skb->tstamp, acked_serial, ack_serial,
807-
rxrpc_rtt_rx_ping_response);
808-
break;
809-
case RXRPC_ACK_REQUESTED:
810-
rxrpc_complete_rtt_probe(call, skb->tstamp, acked_serial, ack_serial,
811-
rxrpc_rtt_rx_requested_ack);
812-
break;
813-
default:
814-
if (acked_serial != 0)
800+
if (acked_serial != 0) {
801+
switch (ack.reason) {
802+
case RXRPC_ACK_PING_RESPONSE:
815803
rxrpc_complete_rtt_probe(call, skb->tstamp, acked_serial, ack_serial,
816-
rxrpc_rtt_rx_cancel);
817-
break;
804+
rxrpc_rtt_rx_ping_response);
805+
break;
806+
case RXRPC_ACK_REQUESTED:
807+
rxrpc_complete_rtt_probe(call, skb->tstamp, acked_serial, ack_serial,
808+
rxrpc_rtt_rx_requested_ack);
809+
break;
810+
default:
811+
rxrpc_complete_rtt_probe(call, skb->tstamp, acked_serial, ack_serial,
812+
rxrpc_rtt_rx_other_ack);
813+
break;
814+
}
818815
}
819816

820817
if (ack.reason == RXRPC_ACK_PING) {

0 commit comments

Comments
 (0)