public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
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 21/39] rxrpc: Display stats about jumbo packets transmitted and received
Date: Wed,  4 Dec 2024 07:46:49 +0000	[thread overview]
Message-ID: <20241204074710.990092-22-dhowells@redhat.com> (raw)
In-Reply-To: <20241204074710.990092-1-dhowells@redhat.com>

In /proc/net/rxrpc/stats, display statistics about the numbers of different
sizes of jumbo packets transmitted and received, showing counts for 1
subpacket (ie. a non-jumbo packet), 2 subpackets, 3, ... to 8 and then 9+.

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
---
 net/rxrpc/ar-internal.h |  2 ++
 net/rxrpc/input.c       |  6 +++++-
 net/rxrpc/output.c      |  5 ++++-
 net/rxrpc/proc.c        | 26 ++++++++++++++++++++++++++
 4 files changed, 37 insertions(+), 2 deletions(-)

diff --git a/net/rxrpc/ar-internal.h b/net/rxrpc/ar-internal.h
index 3e57cef7385f..840293f913a3 100644
--- a/net/rxrpc/ar-internal.h
+++ b/net/rxrpc/ar-internal.h
@@ -111,6 +111,8 @@ struct rxrpc_net {
 	atomic_t		stat_tx_ack_skip;
 	atomic_t		stat_tx_acks[256];
 	atomic_t		stat_rx_acks[256];
+	atomic_t		stat_tx_jumbo[10];
+	atomic_t		stat_rx_jumbo[10];
 
 	atomic_t		stat_why_req_ack[8];
 
diff --git a/net/rxrpc/input.c b/net/rxrpc/input.c
index b89fd0dee324..8d7ab4b9d7d0 100644
--- a/net/rxrpc/input.c
+++ b/net/rxrpc/input.c
@@ -568,7 +568,7 @@ static bool rxrpc_input_split_jumbo(struct rxrpc_call *call, struct sk_buff *skb
 	unsigned int offset = sizeof(struct rxrpc_wire_header);
 	unsigned int len = skb->len - offset;
 	bool notify = false;
-	int ack_reason = 0;
+	int ack_reason = 0, count = 1, stat_ix;
 
 	while (sp->hdr.flags & RXRPC_JUMBO_PACKET) {
 		if (len < RXRPC_JUMBO_SUBPKTLEN)
@@ -597,12 +597,16 @@ static bool rxrpc_input_split_jumbo(struct rxrpc_call *call, struct sk_buff *skb
 		sp->hdr.serial++;
 		offset += RXRPC_JUMBO_SUBPKTLEN;
 		len -= RXRPC_JUMBO_SUBPKTLEN;
+		count++;
 	}
 
 	sp->offset = offset;
 	sp->len    = len;
 	rxrpc_input_data_one(call, skb, &notify, &ack_serial, &ack_reason);
 
+	stat_ix = umin(count, ARRAY_SIZE(call->rxnet->stat_rx_jumbo)) - 1;
+	atomic_inc(&call->rxnet->stat_rx_jumbo[stat_ix]);
+
 	if (ack_reason > 0) {
 		rxrpc_send_ACK(call, ack_reason, ack_serial,
 			       rxrpc_propose_ack_input_data);
diff --git a/net/rxrpc/output.c b/net/rxrpc/output.c
index c2044d593237..3886777d1bb6 100644
--- a/net/rxrpc/output.c
+++ b/net/rxrpc/output.c
@@ -552,10 +552,13 @@ void rxrpc_send_data_packet(struct rxrpc_call *call, struct rxrpc_send_data_req
 	rxrpc_seq_t seq = req->seq;
 	size_t len;
 	bool new_call = test_bit(RXRPC_CALL_BEGAN_RX_TIMER, &call->flags);
-	int ret;
+	int ret, stat_ix;
 
 	_enter("%x,%x-%x", tq->qbase, seq, seq + req->n - 1);
 
+	stat_ix = umin(req->n, ARRAY_SIZE(call->rxnet->stat_tx_jumbo)) - 1;
+	atomic_inc(&call->rxnet->stat_tx_jumbo[stat_ix]);
+
 	len = rxrpc_prepare_data_packet(call, req);
 	txb = tq->bufs[seq & RXRPC_TXQ_MASK];
 
diff --git a/net/rxrpc/proc.c b/net/rxrpc/proc.c
index a8325b8e33c2..5f974ec13d69 100644
--- a/net/rxrpc/proc.c
+++ b/net/rxrpc/proc.c
@@ -529,6 +529,30 @@ int rxrpc_stats_show(struct seq_file *seq, void *v)
 		   atomic_read(&rxnet->stat_why_req_ack[rxrpc_reqack_retrans]),
 		   atomic_read(&rxnet->stat_why_req_ack[rxrpc_reqack_slow_start]),
 		   atomic_read(&rxnet->stat_why_req_ack[rxrpc_reqack_small_txwin]));
+	seq_printf(seq,
+		   "Jumbo-Tx : %u,%u,%u,%u,%u,%u,%u,%u,%u,%u\n",
+		   atomic_read(&rxnet->stat_tx_jumbo[0]),
+		   atomic_read(&rxnet->stat_tx_jumbo[1]),
+		   atomic_read(&rxnet->stat_tx_jumbo[2]),
+		   atomic_read(&rxnet->stat_tx_jumbo[3]),
+		   atomic_read(&rxnet->stat_tx_jumbo[4]),
+		   atomic_read(&rxnet->stat_tx_jumbo[5]),
+		   atomic_read(&rxnet->stat_tx_jumbo[6]),
+		   atomic_read(&rxnet->stat_tx_jumbo[7]),
+		   atomic_read(&rxnet->stat_tx_jumbo[8]),
+		   atomic_read(&rxnet->stat_tx_jumbo[9]));
+	seq_printf(seq,
+		   "Jumbo-Rx : %u,%u,%u,%u,%u,%u,%u,%u,%u,%u\n",
+		   atomic_read(&rxnet->stat_rx_jumbo[0]),
+		   atomic_read(&rxnet->stat_rx_jumbo[1]),
+		   atomic_read(&rxnet->stat_rx_jumbo[2]),
+		   atomic_read(&rxnet->stat_rx_jumbo[3]),
+		   atomic_read(&rxnet->stat_rx_jumbo[4]),
+		   atomic_read(&rxnet->stat_rx_jumbo[5]),
+		   atomic_read(&rxnet->stat_rx_jumbo[6]),
+		   atomic_read(&rxnet->stat_rx_jumbo[7]),
+		   atomic_read(&rxnet->stat_rx_jumbo[8]),
+		   atomic_read(&rxnet->stat_rx_jumbo[9]));
 	seq_printf(seq,
 		   "Buffers  : txb=%u rxb=%u\n",
 		   atomic_read(&rxrpc_nr_txbuf),
@@ -566,6 +590,8 @@ int rxrpc_stats_clear(struct file *file, char *buf, size_t size)
 	atomic_set(&rxnet->stat_tx_ack_skip, 0);
 	memset(&rxnet->stat_tx_acks, 0, sizeof(rxnet->stat_tx_acks));
 	memset(&rxnet->stat_rx_acks, 0, sizeof(rxnet->stat_rx_acks));
+	memset(&rxnet->stat_tx_jumbo, 0, sizeof(rxnet->stat_tx_jumbo));
+	memset(&rxnet->stat_rx_jumbo, 0, sizeof(rxnet->stat_rx_jumbo));
 
 	memset(&rxnet->stat_why_req_ack, 0, sizeof(rxnet->stat_why_req_ack));
 


  parent reply	other threads:[~2024-12-04  7:48 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 ` David Howells [this message]
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 ` [PATCH net-next v2 35/39] rxrpc: Add a reason indicator to the tx_data tracepoint David Howells
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-22-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