aboutsummaryrefslogtreecommitdiffstats
path: root/net/rxrpc
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2024-12-04 07:47:03 +0000
committerJakub Kicinski <kuba@kernel.org>2024-12-09 13:48:32 -0800
commit372d12d191cb80720319e224d401fd82c602e9e4 (patch)
tree5a44b71678f022c0591dd304b461aeb9080cecb7 /net/rxrpc
parent547a9acd4c5e95190c6c93a6d8628c5b8b74a4d6 (diff)
downloadlinux-372d12d191cb80720319e224d401fd82c602e9e4.tar.gz
rxrpc: Add a reason indicator to the tx_data tracepoint
Add an indicator to the rxrpc_tx_data tracepoint to indicate what triggered the transmission of a particular packet. At this point, it's only normal transmission and retransmission, plus the tracepoint is also used to record loss injection, but in a future patch, TLP-induced (re-)transmission will also be a thing. Signed-off-by: David Howells <dhowells@redhat.com> cc: Marc Dionne <marc.dionne@auristor.com> cc: linux-afs@lists.infradead.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net/rxrpc')
-rw-r--r--net/rxrpc/ar-internal.h1
-rw-r--r--net/rxrpc/call_event.c12
-rw-r--r--net/rxrpc/output.c6
3 files changed, 12 insertions, 7 deletions
diff --git a/net/rxrpc/ar-internal.h b/net/rxrpc/ar-internal.h
index aa240b4b4bec36..139575032ae2ba 100644
--- a/net/rxrpc/ar-internal.h
+++ b/net/rxrpc/ar-internal.h
@@ -883,6 +883,7 @@ struct rxrpc_send_data_req {
rxrpc_seq_t seq; /* Sequence of first data */
int n; /* Number of DATA packets to glue into jumbo */
bool did_send; /* T if did actually send */
+ int /* enum rxrpc_txdata_trace */ trace;
};
#include <trace/events/rxrpc.h>
diff --git a/net/rxrpc/call_event.c b/net/rxrpc/call_event.c
index 39772459426ba6..99d9502564cc9f 100644
--- a/net/rxrpc/call_event.c
+++ b/net/rxrpc/call_event.c
@@ -101,6 +101,7 @@ void rxrpc_resend(struct rxrpc_call *call, rxrpc_serial_t ack_serial, bool ping_
{
struct rxrpc_send_data_req req = {
.now = ktime_get_real(),
+ .trace = rxrpc_txdata_retransmit,
};
struct rxrpc_txqueue *tq = call->tx_queue;
ktime_t lowest_xmit_ts = KTIME_MAX;
@@ -269,7 +270,8 @@ static unsigned int rxrpc_tx_window_space(struct rxrpc_call *call)
/*
* Transmit some as-yet untransmitted data.
*/
-static void rxrpc_transmit_fresh_data(struct rxrpc_call *call)
+static void rxrpc_transmit_fresh_data(struct rxrpc_call *call,
+ enum rxrpc_txdata_trace trace)
{
int space = rxrpc_tx_window_space(call);
@@ -284,6 +286,7 @@ static void rxrpc_transmit_fresh_data(struct rxrpc_call *call)
.now = ktime_get_real(),
.seq = call->tx_transmitted + 1,
.n = 0,
+ .trace = trace,
};
struct rxrpc_txqueue *tq;
struct rxrpc_txbuf *txb;
@@ -332,7 +335,8 @@ static void rxrpc_transmit_fresh_data(struct rxrpc_call *call)
}
}
-static void rxrpc_transmit_some_data(struct rxrpc_call *call)
+static void rxrpc_transmit_some_data(struct rxrpc_call *call,
+ enum rxrpc_txdata_trace trace)
{
switch (__rxrpc_call_state(call)) {
case RXRPC_CALL_SERVER_ACK_REQUEST:
@@ -349,7 +353,7 @@ static void rxrpc_transmit_some_data(struct rxrpc_call *call)
rxrpc_inc_stat(call->rxnet, stat_tx_data_underflow);
return;
}
- rxrpc_transmit_fresh_data(call);
+ rxrpc_transmit_fresh_data(call, trace);
break;
default:
return;
@@ -463,7 +467,7 @@ bool rxrpc_input_call_event(struct rxrpc_call *call)
resend = true;
}
- rxrpc_transmit_some_data(call);
+ rxrpc_transmit_some_data(call, rxrpc_txdata_new_data);
now = ktime_get_real();
t = ktime_sub(call->keepalive_at, now);
diff --git a/net/rxrpc/output.c b/net/rxrpc/output.c
index a7de8a02f41998..2633f955d1d0e7 100644
--- a/net/rxrpc/output.c
+++ b/net/rxrpc/output.c
@@ -511,7 +511,7 @@ dont_set_request_ack:
len += sizeof(*jumbo);
}
- trace_rxrpc_tx_data(call, txb->seq, txb->serial, txb->flags | flags, false);
+ trace_rxrpc_tx_data(call, txb->seq, txb->serial, flags, req->trace);
kv->iov_len = len;
return len;
}
@@ -655,8 +655,8 @@ void rxrpc_send_data_packet(struct rxrpc_call *call, struct rxrpc_send_data_req
if ((lose++ & 7) == 7) {
ret = 0;
- trace_rxrpc_tx_data(call, txb->seq, txb->serial,
- txb->flags, true);
+ trace_rxrpc_tx_data(call, txb->seq, txb->serial, txb->flags,
+ rxrpc_txdata_inject_loss);
conn->peer->last_tx_at = ktime_get_seconds();
goto done;
}