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: Display stats about jumbo packets transmitted and received

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: linux-afs@lists.infradead.org
Link: https://patch.msgid.link/20241204074710.990092-22-dhowells@redhat.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

David Howells and committed by
Jakub Kicinski
f003e403 203457e1

+37 -2
+2
net/rxrpc/ar-internal.h
··· 111 111 atomic_t stat_tx_ack_skip; 112 112 atomic_t stat_tx_acks[256]; 113 113 atomic_t stat_rx_acks[256]; 114 + atomic_t stat_tx_jumbo[10]; 115 + atomic_t stat_rx_jumbo[10]; 114 116 115 117 atomic_t stat_why_req_ack[8]; 116 118
+5 -1
net/rxrpc/input.c
··· 568 568 unsigned int offset = sizeof(struct rxrpc_wire_header); 569 569 unsigned int len = skb->len - offset; 570 570 bool notify = false; 571 - int ack_reason = 0; 571 + int ack_reason = 0, count = 1, stat_ix; 572 572 573 573 while (sp->hdr.flags & RXRPC_JUMBO_PACKET) { 574 574 if (len < RXRPC_JUMBO_SUBPKTLEN) ··· 597 597 sp->hdr.serial++; 598 598 offset += RXRPC_JUMBO_SUBPKTLEN; 599 599 len -= RXRPC_JUMBO_SUBPKTLEN; 600 + count++; 600 601 } 601 602 602 603 sp->offset = offset; 603 604 sp->len = len; 604 605 rxrpc_input_data_one(call, skb, &notify, &ack_serial, &ack_reason); 606 + 607 + stat_ix = umin(count, ARRAY_SIZE(call->rxnet->stat_rx_jumbo)) - 1; 608 + atomic_inc(&call->rxnet->stat_rx_jumbo[stat_ix]); 605 609 606 610 if (ack_reason > 0) { 607 611 rxrpc_send_ACK(call, ack_reason, ack_serial,
+4 -1
net/rxrpc/output.c
··· 552 552 rxrpc_seq_t seq = req->seq; 553 553 size_t len; 554 554 bool new_call = test_bit(RXRPC_CALL_BEGAN_RX_TIMER, &call->flags); 555 - int ret; 555 + int ret, stat_ix; 556 556 557 557 _enter("%x,%x-%x", tq->qbase, seq, seq + req->n - 1); 558 + 559 + stat_ix = umin(req->n, ARRAY_SIZE(call->rxnet->stat_tx_jumbo)) - 1; 560 + atomic_inc(&call->rxnet->stat_tx_jumbo[stat_ix]); 558 561 559 562 len = rxrpc_prepare_data_packet(call, req); 560 563 txb = tq->bufs[seq & RXRPC_TXQ_MASK];
+26
net/rxrpc/proc.c
··· 530 530 atomic_read(&rxnet->stat_why_req_ack[rxrpc_reqack_slow_start]), 531 531 atomic_read(&rxnet->stat_why_req_ack[rxrpc_reqack_small_txwin])); 532 532 seq_printf(seq, 533 + "Jumbo-Tx : %u,%u,%u,%u,%u,%u,%u,%u,%u,%u\n", 534 + atomic_read(&rxnet->stat_tx_jumbo[0]), 535 + atomic_read(&rxnet->stat_tx_jumbo[1]), 536 + atomic_read(&rxnet->stat_tx_jumbo[2]), 537 + atomic_read(&rxnet->stat_tx_jumbo[3]), 538 + atomic_read(&rxnet->stat_tx_jumbo[4]), 539 + atomic_read(&rxnet->stat_tx_jumbo[5]), 540 + atomic_read(&rxnet->stat_tx_jumbo[6]), 541 + atomic_read(&rxnet->stat_tx_jumbo[7]), 542 + atomic_read(&rxnet->stat_tx_jumbo[8]), 543 + atomic_read(&rxnet->stat_tx_jumbo[9])); 544 + seq_printf(seq, 545 + "Jumbo-Rx : %u,%u,%u,%u,%u,%u,%u,%u,%u,%u\n", 546 + atomic_read(&rxnet->stat_rx_jumbo[0]), 547 + atomic_read(&rxnet->stat_rx_jumbo[1]), 548 + atomic_read(&rxnet->stat_rx_jumbo[2]), 549 + atomic_read(&rxnet->stat_rx_jumbo[3]), 550 + atomic_read(&rxnet->stat_rx_jumbo[4]), 551 + atomic_read(&rxnet->stat_rx_jumbo[5]), 552 + atomic_read(&rxnet->stat_rx_jumbo[6]), 553 + atomic_read(&rxnet->stat_rx_jumbo[7]), 554 + atomic_read(&rxnet->stat_rx_jumbo[8]), 555 + atomic_read(&rxnet->stat_rx_jumbo[9])); 556 + seq_printf(seq, 533 557 "Buffers : txb=%u rxb=%u\n", 534 558 atomic_read(&rxrpc_nr_txbuf), 535 559 atomic_read(&rxrpc_n_rx_skbs)); ··· 590 566 atomic_set(&rxnet->stat_tx_ack_skip, 0); 591 567 memset(&rxnet->stat_tx_acks, 0, sizeof(rxnet->stat_tx_acks)); 592 568 memset(&rxnet->stat_rx_acks, 0, sizeof(rxnet->stat_rx_acks)); 569 + memset(&rxnet->stat_tx_jumbo, 0, sizeof(rxnet->stat_tx_jumbo)); 570 + memset(&rxnet->stat_rx_jumbo, 0, sizeof(rxnet->stat_rx_jumbo)); 593 571 594 572 memset(&rxnet->stat_why_req_ack, 0, sizeof(rxnet->stat_why_req_ack)); 595 573