diff options
author | Dilip Daya <dilip.daya@hp.com> | 2013-04-15 21:39:07 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-04-16 16:43:34 -0400 |
commit | f406c8b9693f2f71ef2caeb0b68521a7d22d00f0 (patch) | |
tree | e73e60c807bc89a457f76adf35853b7fd2c61d6f /net/sctp | |
parent | 1e0a8b13d35510e711fdf72e9a3e30bcb2bd49fa (diff) |
sctp: Add buffer utilization fields to /proc/net/sctp/assocs
sctp: Add buffer utilization fields to /proc/net/sctp/assocs
This patch adds the following fields to /proc/net/sctp/assocs output:
- sk->sk_wmem_alloc as "wmema" (transmit queue bytes committed)
- sk->sk_wmem_queued as "wmemq" (persistent queue size)
- sk->sk_sndbuf as "sndbuf" (size of send buffer in bytes)
- sk->sk_rcvbuf as "rcvbuf" (size of receive buffer in bytes)
When small DATA chunks containing 136 bytes data are sent the TX_QUEUE
(assoc->sndbuf_used) reaches a maximum of 40.9% of sk_sndbuf value when
peer.rwnd = 0. This was diagnosed from sk_wmem_alloc value reaching maximum
value of sk_sndbuf.
TX_QUEUE (assoc->sndbuf_used), sk_wmem_alloc and sk_wmem_queued values are
incremented in sctp_set_owner_w() for outgoing data chunks. Having access to
the above values in /proc/net/sctp/assocs will provide a better understanding
of SCTP buffer management.
With patch applied, example output when peer.rwnd = 0
where:
ASSOC ffff880132298000 is sender
ffff880125343000 is receiver
ASSOC SOCK STY SST ST HBKT ASSOC-ID TX_QUEUE RX_QUEUE \
ffff880132298000 ffff880124a0a0c0 2 1 3 29325 1 214656 0 \
ffff880125343000 ffff8801237d7700 2 1 3 36210 2 0 524520 \
UID INODE LPORT RPORT LADDRS <-> RADDRS HBINT INS OUTS \
0 25108 3455 3456 *10.4.8.3 <-> *10.5.8.3 7500 2 2 \
0 27819 3456 3455 *10.5.8.3 <-> *10.4.8.3 7500 2 2 \
MAXRT T1X T2X RTXC wmema wmemq sndbuf rcvbuf
4 0 0 72 525633 440320 524288 524288
4 0 0 0 1 0 524288 524288
Signed-off-by: Dilip Daya <dilip.daya@hp.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sctp')
-rw-r--r-- | net/sctp/proc.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/net/sctp/proc.c b/net/sctp/proc.c index ab3bba8cb0a8..4e45ee35d0db 100644 --- a/net/sctp/proc.c +++ b/net/sctp/proc.c | |||
@@ -295,7 +295,8 @@ static void * sctp_assocs_seq_start(struct seq_file *seq, loff_t *pos) | |||
295 | seq_printf(seq, " ASSOC SOCK STY SST ST HBKT " | 295 | seq_printf(seq, " ASSOC SOCK STY SST ST HBKT " |
296 | "ASSOC-ID TX_QUEUE RX_QUEUE UID INODE LPORT " | 296 | "ASSOC-ID TX_QUEUE RX_QUEUE UID INODE LPORT " |
297 | "RPORT LADDRS <-> RADDRS " | 297 | "RPORT LADDRS <-> RADDRS " |
298 | "HBINT INS OUTS MAXRT T1X T2X RTXC\n"); | 298 | "HBINT INS OUTS MAXRT T1X T2X RTXC " |
299 | "wmema wmemq sndbuf rcvbuf\n"); | ||
299 | 300 | ||
300 | return (void *)pos; | 301 | return (void *)pos; |
301 | } | 302 | } |
@@ -349,11 +350,16 @@ static int sctp_assocs_seq_show(struct seq_file *seq, void *v) | |||
349 | sctp_seq_dump_local_addrs(seq, epb); | 350 | sctp_seq_dump_local_addrs(seq, epb); |
350 | seq_printf(seq, "<-> "); | 351 | seq_printf(seq, "<-> "); |
351 | sctp_seq_dump_remote_addrs(seq, assoc); | 352 | sctp_seq_dump_remote_addrs(seq, assoc); |
352 | seq_printf(seq, "\t%8lu %5d %5d %4d %4d %4d %8d ", | 353 | seq_printf(seq, "\t%8lu %5d %5d %4d %4d %4d %8d " |
354 | "%8d %8d %8d %8d", | ||
353 | assoc->hbinterval, assoc->c.sinit_max_instreams, | 355 | assoc->hbinterval, assoc->c.sinit_max_instreams, |
354 | assoc->c.sinit_num_ostreams, assoc->max_retrans, | 356 | assoc->c.sinit_num_ostreams, assoc->max_retrans, |
355 | assoc->init_retries, assoc->shutdown_retries, | 357 | assoc->init_retries, assoc->shutdown_retries, |
356 | assoc->rtx_data_chunks); | 358 | assoc->rtx_data_chunks, |
359 | atomic_read(&sk->sk_wmem_alloc), | ||
360 | sk->sk_wmem_queued, | ||
361 | sk->sk_sndbuf, | ||
362 | sk->sk_rcvbuf); | ||
357 | seq_printf(seq, "\n"); | 363 | seq_printf(seq, "\n"); |
358 | } | 364 | } |
359 | read_unlock(&head->lock); | 365 | read_unlock(&head->lock); |