Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

rxrpc: call->acks_hard_ack is now the same call->tx_bottom, so remove it

Now that packets are removed from the Tx queue in the rotation function
rather than being cleaned up later, call->acks_hard_ack now advances in
step with call->tx_bottom, so remove it.

Some of the places call->acks_hard_ack is used in the rxrpc tracepoints are
replaced by call->acks_first_seq instead as that's the peer's reported idea
of the hard-ACK point.

Signed-off-by: David Howells <dhowells@redhat.com>
cc: Marc Dionne <marc.dionne@auristor.com>
cc: linux-afs@lists.infradead.org
Link: https://patch.msgid.link/20241204074710.990092-20-dhowells@redhat.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

David Howells and committed by
Jakub Kicinski
692c4caa b341a026

+26 -28
+10 -10
include/trace/events/rxrpc.h
··· 892 892 TP_STRUCT__entry( 893 893 __field(unsigned int, call) 894 894 __field(enum rxrpc_txqueue_trace, why) 895 - __field(rxrpc_seq_t, acks_hard_ack) 896 895 __field(rxrpc_seq_t, tx_bottom) 896 + __field(rxrpc_seq_t, acks_first_seq) 897 897 __field(rxrpc_seq_t, tx_top) 898 898 __field(rxrpc_seq_t, send_top) 899 899 __field(int, tx_winsize) ··· 902 902 TP_fast_assign( 903 903 __entry->call = call->debug_id; 904 904 __entry->why = why; 905 - __entry->acks_hard_ack = call->acks_hard_ack; 906 905 __entry->tx_bottom = call->tx_bottom; 906 + __entry->acks_first_seq = call->acks_first_seq; 907 907 __entry->tx_top = call->tx_top; 908 908 __entry->send_top = call->send_top; 909 909 __entry->tx_winsize = call->tx_winsize; ··· 913 913 __entry->call, 914 914 __print_symbolic(__entry->why, rxrpc_txqueue_traces), 915 915 __entry->tx_bottom, 916 - __entry->acks_hard_ack, 917 - __entry->tx_top - __entry->tx_bottom, 918 - __entry->tx_top - __entry->acks_hard_ack, 916 + __entry->acks_first_seq, 917 + __entry->acks_first_seq - __entry->tx_bottom, 918 + __entry->tx_top - __entry->acks_first_seq, 919 919 __entry->send_top - __entry->tx_top, 920 920 __entry->tx_winsize) 921 921 ); ··· 945 945 __entry->cong_cwnd = call->cong_cwnd; 946 946 __entry->cong_extra = call->cong_extra; 947 947 __entry->prepared = send_top - call->tx_bottom; 948 - __entry->in_flight = call->tx_top - call->acks_hard_ack; 948 + __entry->in_flight = call->tx_top - call->tx_bottom; 949 949 __entry->pmtud_jumbo = call->peer->pmtud_jumbo; 950 950 ), 951 951 ··· 1707 1707 TP_fast_assign( 1708 1708 __entry->call = call->debug_id; 1709 1709 __entry->change = change; 1710 - __entry->hard_ack = call->acks_hard_ack; 1710 + __entry->hard_ack = call->acks_first_seq; 1711 1711 __entry->top = call->tx_top; 1712 1712 __entry->lowest_nak = call->acks_lowest_nak; 1713 1713 __entry->ack_serial = ack_serial; ··· 1754 1754 __entry->mode = call->cong_mode; 1755 1755 __entry->cwnd = call->cong_cwnd; 1756 1756 __entry->extra = call->cong_extra; 1757 - __entry->hard_ack = call->acks_hard_ack; 1757 + __entry->hard_ack = call->acks_first_seq; 1758 1758 __entry->prepared = call->send_top - call->tx_bottom; 1759 1759 __entry->since_last_tx = ktime_sub(now, call->tx_last_sent); 1760 1760 __entry->has_data = call->tx_bottom != call->tx_top; ··· 1855 1855 TP_fast_assign( 1856 1856 struct rxrpc_skb_priv *sp = ack ? rxrpc_skb(ack) : NULL; 1857 1857 __entry->call = call->debug_id; 1858 - __entry->seq = call->acks_hard_ack; 1858 + __entry->seq = call->acks_first_seq; 1859 1859 __entry->transmitted = call->tx_transmitted; 1860 1860 __entry->ack_serial = sp ? sp->hdr.serial : 0; 1861 1861 ), ··· 1944 1944 __entry->call_id = call->call_id; 1945 1945 __entry->call_serial = call->rx_serial; 1946 1946 __entry->conn_serial = call->conn->hi_serial; 1947 - __entry->tx_seq = call->acks_hard_ack; 1947 + __entry->tx_seq = call->acks_first_seq; 1948 1948 __entry->rx_seq = call->rx_highest_seq; 1949 1949 ), 1950 1950
-1
net/rxrpc/ar-internal.h
··· 759 759 ktime_t acks_latest_ts; /* Timestamp of latest ACK received */ 760 760 rxrpc_seq_t acks_first_seq; /* first sequence number received */ 761 761 rxrpc_seq_t acks_prev_seq; /* Highest previousPacket received */ 762 - rxrpc_seq_t acks_hard_ack; /* Latest hard-ack point */ 763 762 rxrpc_seq_t acks_lowest_nak; /* Lowest NACK in the buffer (or ==tx_hard_ack) */ 764 763 rxrpc_serial_t acks_highest_serial; /* Highest serial number ACK'd */ 765 764 };
+2 -2
net/rxrpc/call_event.c
··· 109 109 bool unacked = false, did_send = false; 110 110 unsigned int qix; 111 111 112 - _enter("{%d,%d}", call->acks_hard_ack, call->tx_top); 112 + _enter("{%d,%d}", call->tx_bottom, call->tx_top); 113 113 114 114 if (call->tx_bottom == call->tx_top) 115 115 goto no_resend; ··· 267 267 static unsigned int rxrpc_tx_window_space(struct rxrpc_call *call) 268 268 { 269 269 int winsize = umin(call->tx_winsize, call->cong_cwnd + call->cong_extra); 270 - int in_flight = call->tx_top - call->acks_hard_ack; 270 + int in_flight = call->tx_top - call->tx_bottom; 271 271 272 272 return max(winsize - in_flight, 0); 273 273 }
+8 -9
net/rxrpc/input.c
··· 40 40 bool resend = false; 41 41 42 42 summary->flight_size = 43 - (call->tx_top - call->acks_hard_ack) - summary->nr_acks; 43 + (call->tx_top - call->tx_bottom) - summary->nr_acks; 44 44 45 45 if (test_and_clear_bit(RXRPC_CALL_RETRANS_TIMEOUT, &call->flags)) { 46 46 summary->retrans_timeo = true; ··· 175 175 * state. 176 176 */ 177 177 if (test_bit(RXRPC_CALL_TX_LAST, &call->flags) || 178 - summary->nr_acks != call->tx_top - call->acks_hard_ack) { 178 + summary->nr_acks != call->tx_top - call->tx_bottom) { 179 179 call->cong_extra++; 180 180 wake_up(&call->waitq); 181 181 } ··· 218 218 rxrpc_seq_t seq = call->tx_bottom + 1; 219 219 bool rot_last = false; 220 220 221 - _enter("%x,%x,%x", call->tx_bottom, call->acks_hard_ack, to); 221 + _enter("%x,%x", call->tx_bottom, to); 222 222 223 223 trace_rxrpc_tx_rotate(call, seq, to); 224 224 trace_rxrpc_tq(call, tq, seq, rxrpc_tq_rotate); ··· 246 246 tq->bufs[ix] = NULL; 247 247 248 248 WRITE_ONCE(call->tx_bottom, seq); 249 - WRITE_ONCE(call->acks_hard_ack, seq); 250 249 trace_rxrpc_txqueue(call, (rot_last ? 251 250 rxrpc_txqueue_rotate_last : 252 251 rxrpc_txqueue_rotate)); ··· 277 278 } 278 279 } 279 280 280 - _debug("%x,%x,%x,%d", to, call->acks_hard_ack, call->tx_top, rot_last); 281 + _debug("%x,%x,%x,%d", to, call->tx_bottom, call->tx_top, rot_last); 281 282 282 - if (call->acks_lowest_nak == call->acks_hard_ack) { 283 + if (call->acks_lowest_nak == call->tx_bottom) { 283 284 call->acks_lowest_nak = to; 284 285 } else if (after(to, call->acks_lowest_nak)) { 285 286 summary->new_low_nack = true; ··· 967 968 if (unlikely(summary.ack_reason == RXRPC_ACK_OUT_OF_SEQUENCE) && 968 969 first_soft_ack == 1 && 969 970 prev_pkt == 0 && 970 - call->acks_hard_ack == 0 && 971 + call->tx_bottom == 0 && 971 972 rxrpc_is_client_call(call)) { 972 973 rxrpc_set_call_completion(call, RXRPC_CALL_REMOTELY_ABORTED, 973 974 0, -ENETRESET); ··· 1032 1033 goto send_response; 1033 1034 } 1034 1035 1035 - if (before(hard_ack, call->acks_hard_ack) || 1036 + if (before(hard_ack, call->tx_bottom) || 1036 1037 after(hard_ack, call->tx_top)) 1037 1038 return rxrpc_proto_abort(call, 0, rxrpc_eproto_ackr_outside_window); 1038 1039 if (nr_acks > call->tx_top - hard_ack) 1039 1040 return rxrpc_proto_abort(call, 0, rxrpc_eproto_ackr_sack_overflow); 1040 1041 1041 - if (after(hard_ack, call->acks_hard_ack)) { 1042 + if (after(hard_ack, call->tx_bottom)) { 1042 1043 if (rxrpc_rotate_tx_window(call, hard_ack, &summary)) { 1043 1044 rxrpc_end_tx_phase(call, false, rxrpc_eproto_unexpected_ack); 1044 1045 goto send_response;
+3 -3
net/rxrpc/proc.c
··· 52 52 struct rxrpc_call *call; 53 53 struct rxrpc_net *rxnet = rxrpc_net(seq_file_net(seq)); 54 54 enum rxrpc_call_state state; 55 - rxrpc_seq_t acks_hard_ack; 55 + rxrpc_seq_t tx_bottom; 56 56 char lbuff[50], rbuff[50]; 57 57 long timeout = 0; 58 58 ··· 79 79 if (state != RXRPC_CALL_SERVER_PREALLOC) 80 80 timeout = ktime_ms_delta(READ_ONCE(call->expect_rx_by), ktime_get_real()); 81 81 82 - acks_hard_ack = READ_ONCE(call->acks_hard_ack); 82 + tx_bottom = READ_ONCE(call->tx_bottom); 83 83 seq_printf(seq, 84 84 "UDP %-47.47s %-47.47s %4x %08x %08x %s %3u" 85 85 " %-8.8s %08x %08x %08x %02x %08x %02x %08x %02x %06lx\n", ··· 93 93 rxrpc_call_states[state], 94 94 call->abort_code, 95 95 call->debug_id, 96 - acks_hard_ack, READ_ONCE(call->tx_top) - acks_hard_ack, 96 + tx_bottom, READ_ONCE(call->tx_top) - tx_bottom, 97 97 call->ackr_window, call->ackr_wtop - call->ackr_window, 98 98 call->rx_serial, 99 99 call->cong_cwnd,
+3 -3
net/rxrpc/sendmsg.c
··· 140 140 rtt = 2; 141 141 142 142 timeout = rtt; 143 - tx_start = READ_ONCE(call->acks_hard_ack); 143 + tx_start = READ_ONCE(call->tx_bottom); 144 144 145 145 for (;;) { 146 146 set_current_state(TASK_UNINTERRUPTIBLE); ··· 197 197 DECLARE_WAITQUEUE(myself, current); 198 198 int ret; 199 199 200 - _enter(",{%u,%u,%u,%u}", 201 - call->tx_bottom, call->acks_hard_ack, call->tx_top, call->tx_winsize); 200 + _enter(",{%u,%u,%u}", 201 + call->tx_bottom, call->tx_top, call->tx_winsize); 202 202 203 203 add_wait_queue(&call->waitq, &myself); 204 204