From: David Howells <dhowells@redhat.com>
To: netdev@vger.kernel.org
Cc: David Howells <dhowells@redhat.com>,
Marc Dionne <marc.dionne@auristor.com>,
Yunsheng Lin <linyunsheng@huawei.com>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
linux-afs@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: [PATCH net-next v2 35/39] rxrpc: Add a reason indicator to the tx_data tracepoint
Date: Wed, 4 Dec 2024 07:47:03 +0000 [thread overview]
Message-ID: <20241204074710.990092-36-dhowells@redhat.com> (raw)
In-Reply-To: <20241204074710.990092-1-dhowells@redhat.com>
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: "David S. Miller" <davem@davemloft.net>
cc: Eric Dumazet <edumazet@google.com>
cc: Jakub Kicinski <kuba@kernel.org>
cc: Paolo Abeni <pabeni@redhat.com>
cc: linux-afs@lists.infradead.org
cc: netdev@vger.kernel.org
---
include/trace/events/rxrpc.h | 21 ++++++++++++++-------
net/rxrpc/ar-internal.h | 1 +
net/rxrpc/call_event.c | 12 ++++++++----
net/rxrpc/output.c | 6 +++---
4 files changed, 26 insertions(+), 14 deletions(-)
diff --git a/include/trace/events/rxrpc.h b/include/trace/events/rxrpc.h
index 326a4c257aea..d79623fff746 100644
--- a/include/trace/events/rxrpc.h
+++ b/include/trace/events/rxrpc.h
@@ -302,6 +302,11 @@
EM(rxrpc_txqueue_rotate_last, "RLS") \
E_(rxrpc_txqueue_wait, "WAI")
+#define rxrpc_txdata_traces \
+ EM(rxrpc_txdata_inject_loss, " *INJ-LOSS*") \
+ EM(rxrpc_txdata_new_data, " ") \
+ E_(rxrpc_txdata_retransmit, " *RETRANS*")
+
#define rxrpc_receive_traces \
EM(rxrpc_receive_end, "END") \
EM(rxrpc_receive_front, "FRN") \
@@ -534,6 +539,7 @@ enum rxrpc_timer_trace { rxrpc_timer_traces } __mode(byte);
enum rxrpc_tq_trace { rxrpc_tq_traces } __mode(byte);
enum rxrpc_tx_point { rxrpc_tx_points } __mode(byte);
enum rxrpc_txbuf_trace { rxrpc_txbuf_traces } __mode(byte);
+enum rxrpc_txdata_trace { rxrpc_txdata_traces } __mode(byte);
enum rxrpc_txqueue_trace { rxrpc_txqueue_traces } __mode(byte);
#endif /* end __RXRPC_DECLARE_TRACE_ENUMS_ONCE_ONLY */
@@ -572,6 +578,7 @@ rxrpc_timer_traces;
rxrpc_tq_traces;
rxrpc_tx_points;
rxrpc_txbuf_traces;
+rxrpc_txdata_traces;
rxrpc_txqueue_traces;
/*
@@ -1222,9 +1229,10 @@ TRACE_EVENT(rxrpc_tx_packet,
TRACE_EVENT(rxrpc_tx_data,
TP_PROTO(struct rxrpc_call *call, rxrpc_seq_t seq,
- rxrpc_serial_t serial, unsigned int flags, bool lose),
+ rxrpc_serial_t serial, unsigned int flags,
+ enum rxrpc_txdata_trace trace),
- TP_ARGS(call, seq, serial, flags, lose),
+ TP_ARGS(call, seq, serial, flags, trace),
TP_STRUCT__entry(
__field(unsigned int, call)
@@ -1233,7 +1241,7 @@ TRACE_EVENT(rxrpc_tx_data,
__field(u32, cid)
__field(u32, call_id)
__field(u16, flags)
- __field(bool, lose)
+ __field(enum rxrpc_txdata_trace, trace)
),
TP_fast_assign(
@@ -1243,18 +1251,17 @@ TRACE_EVENT(rxrpc_tx_data,
__entry->seq = seq;
__entry->serial = serial;
__entry->flags = flags;
- __entry->lose = lose;
+ __entry->trace = trace;
),
- TP_printk("c=%08x DATA %08x:%08x %08x q=%08x fl=%02x%s%s",
+ TP_printk("c=%08x DATA %08x:%08x %08x q=%08x fl=%02x%s",
__entry->call,
__entry->cid,
__entry->call_id,
__entry->serial,
__entry->seq,
__entry->flags & RXRPC_TXBUF_WIRE_FLAGS,
- __entry->flags & RXRPC_TXBUF_RESENT ? " *RETRANS*" : "",
- __entry->lose ? " *LOSE*" : "")
+ __print_symbolic(__entry->trace, rxrpc_txdata_traces))
);
TRACE_EVENT(rxrpc_tx_ack,
diff --git a/net/rxrpc/ar-internal.h b/net/rxrpc/ar-internal.h
index aa240b4b4bec..139575032ae2 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 39772459426b..99d9502564cc 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 a7de8a02f419..2633f955d1d0 100644
--- a/net/rxrpc/output.c
+++ b/net/rxrpc/output.c
@@ -511,7 +511,7 @@ static size_t rxrpc_prepare_data_subpacket(struct rxrpc_call *call,
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;
}
next prev parent reply other threads:[~2024-12-04 7:49 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-04 7:46 [PATCH net-next v2 00/39] rxrpc: Implement jumbo DATA transmission and RACK-TLP David Howells
2024-12-04 7:46 ` [PATCH net-next v2 01/39] ktime: Add us_to_ktime() David Howells
2024-12-04 7:46 ` [PATCH net-next v2 02/39] rxrpc: Fix handling of received connection abort David Howells
2024-12-04 7:46 ` [PATCH net-next v2 03/39] rxrpc: Use umin() and umax() rather than min_t()/max_t() where possible David Howells
2024-12-04 7:46 ` [PATCH net-next v2 04/39] rxrpc: Clean up Tx header flags generation handling David Howells
2024-12-04 7:46 ` [PATCH net-next v2 05/39] rxrpc: Don't set the MORE-PACKETS rxrpc wire header flag David Howells
2024-12-04 7:46 ` [PATCH net-next v2 06/39] rxrpc: Show stats counter for received reason-0 ACKs David Howells
2024-12-04 7:46 ` [PATCH net-next v2 07/39] rxrpc: Request an ACK on impending Tx stall David Howells
2024-12-04 7:46 ` [PATCH net-next v2 08/39] rxrpc: Use a large kvec[] in rxrpc_local rather than every rxrpc_txbuf David Howells
2024-12-04 7:46 ` [PATCH net-next v2 09/39] rxrpc: Implement path-MTU probing using padded PING ACKs (RFC8899) David Howells
2024-12-04 7:46 ` [PATCH net-next v2 10/39] rxrpc: Separate the packet length from the data length in rxrpc_txbuf David Howells
2024-12-04 7:46 ` [PATCH net-next v2 11/39] rxrpc: Prepare to be able to send jumbo DATA packets David Howells
2024-12-04 7:46 ` [PATCH net-next v2 12/39] rxrpc: Add a tracepoint to show variables pertinent to jumbo packet size David Howells
2024-12-04 7:46 ` [PATCH net-next v2 13/39] rxrpc: Fix CPU time starvation in I/O thread David Howells
2024-12-04 7:46 ` [PATCH net-next v2 14/39] rxrpc: Fix injection of packet loss David Howells
2024-12-04 7:46 ` [PATCH net-next v2 15/39] rxrpc: Only set DF=1 on initial DATA transmission David Howells
2024-12-04 7:46 ` [PATCH net-next v2 16/39] rxrpc: Timestamp DATA packets before transmitting them David Howells
2024-12-04 7:46 ` [PATCH net-next v2 17/39] rxrpc: Don't need barrier for ->tx_bottom and ->acks_hard_ack David Howells
2024-12-04 7:46 ` [PATCH net-next v2 18/39] rxrpc: Implement progressive transmission queue struct David Howells
2024-12-04 7:46 ` [PATCH net-next v2 19/39] rxrpc: call->acks_hard_ack is now the same call->tx_bottom, so remove it David Howells
2024-12-04 7:46 ` [PATCH net-next v2 20/39] rxrpc: Replace call->acks_first_seq with tracking of the hard ACK point David Howells
2024-12-04 7:46 ` [PATCH net-next v2 21/39] rxrpc: Display stats about jumbo packets transmitted and received David Howells
2024-12-04 7:46 ` [PATCH net-next v2 22/39] rxrpc: Adjust names and types of congestion-related fields David Howells
2024-12-04 7:46 ` [PATCH net-next v2 23/39] rxrpc: Use the new rxrpc_tx_queue struct to more efficiently process ACKs David Howells
2024-12-04 7:46 ` [PATCH net-next v2 24/39] rxrpc: Store the DATA serial in the txqueue and use this in RTT calc David Howells
2024-12-04 7:46 ` [PATCH net-next v2 25/39] rxrpc: Don't use received skbuff timestamps David Howells
2024-12-04 7:46 ` [PATCH net-next v2 26/39] rxrpc: Generate rtt_min David Howells
2024-12-04 7:46 ` [PATCH net-next v2 27/39] rxrpc: Adjust the rxrpc_rtt_rx tracepoint David Howells
2024-12-04 7:46 ` [PATCH net-next v2 28/39] rxrpc: Display userStatus in rxrpc_rx_ack trace David Howells
2024-12-04 7:46 ` [PATCH net-next v2 29/39] rxrpc: Fix the calculation and use of RTO David Howells
2024-12-04 7:46 ` [PATCH net-next v2 30/39] rxrpc: Fix initial resend timeout David Howells
2024-12-04 7:46 ` [PATCH net-next v2 31/39] rxrpc: Send jumbo DATA packets David Howells
2024-12-04 7:47 ` [PATCH net-next v2 32/39] rxrpc: Don't allocate a txbuf for an ACK transmission David Howells
2024-12-04 7:47 ` [PATCH net-next v2 33/39] rxrpc: Use irq-disabling spinlocks between app and I/O thread David Howells
2024-12-04 7:47 ` [PATCH net-next v2 34/39] rxrpc: Tidy up the ACK parsing a bit David Howells
2024-12-04 7:47 ` David Howells [this message]
2024-12-04 7:47 ` [PATCH net-next v2 36/39] rxrpc: Add a reason indicator to the tx_ack tracepoint David Howells
2024-12-04 7:47 ` [PATCH net-next v2 37/39] rxrpc: Manage RTT per-call rather than per-peer David Howells
2024-12-04 7:47 ` [PATCH net-next v2 38/39] rxrpc: Fix request for an ACK when cwnd is minimum David Howells
2024-12-04 7:47 ` [PATCH net-next v2 39/39] rxrpc: Implement RACK/TLP to deal with transmission stalls [RFC8985] David Howells
2024-12-09 22:10 ` [PATCH net-next v2 00/39] rxrpc: Implement jumbo DATA transmission and RACK-TLP patchwork-bot+netdevbpf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241204074710.990092-36-dhowells@redhat.com \
--to=dhowells@redhat.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=linux-afs@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linyunsheng@huawei.com \
--cc=marc.dionne@auristor.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox