All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH ] net: frag: print frag_mem_limit value in sockstat proc file
@ 2017-08-29 13:05 liujian56
  2017-08-29 23:04 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: liujian56 @ 2017-08-29 13:05 UTC (permalink / raw)
  To: davem; +Cc: kuznet, yoshfuji, brouer, fw, netdev, liujian56

From: liujian <liujian56@huawei.com>

>From 6d7b857d5( net: use lib/percpu_counter API for fragmentation mem
accounting),
frag_mem_limit and sum_frag_mem_limit have different value if there are
multiple NIC RX CPU.
Print frag_mem_limit value, then we can get more debug info.

Signed-off-by: liujian <liujian56@huawei.com>
---
 net/ipv4/proc.c | 3 ++-
 net/ipv6/proc.c | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/net/ipv4/proc.c b/net/ipv4/proc.c
index 43eb6567..370cda1 100644
--- a/net/ipv4/proc.c
+++ b/net/ipv4/proc.c
@@ -73,7 +73,8 @@ static int sockstat_seq_show(struct seq_file *seq, void *v)
 	seq_printf(seq, "RAW: inuse %d\n",
 		   sock_prot_inuse_get(net, &raw_prot));
 	frag_mem = ip_frag_mem(net);
-	seq_printf(seq,  "FRAG: inuse %u memory %u\n", !!frag_mem, frag_mem);
+	seq_printf(seq,  "FRAG: inuse %u memory %u current mem_limit %d\n",
+		!!frag_mem, frag_mem, frag_mem_limit(&net->ipv4.frags));
 	return 0;
 }
 
diff --git a/net/ipv6/proc.c b/net/ipv6/proc.c
index e88bcb8..00680bc 100644
--- a/net/ipv6/proc.c
+++ b/net/ipv6/proc.c
@@ -48,7 +48,8 @@ static int sockstat6_seq_show(struct seq_file *seq, void *v)
 			sock_prot_inuse_get(net, &udplitev6_prot));
 	seq_printf(seq, "RAW6: inuse %d\n",
 		       sock_prot_inuse_get(net, &rawv6_prot));
-	seq_printf(seq, "FRAG6: inuse %u memory %u\n", !!frag_mem, frag_mem);
+	seq_printf(seq, "FRAG6: inuse %u memory %u current mem_limit %d\n",
+		 !!frag_mem, frag_mem, frag_mem_limit(&net->ipv6.frags));
 	return 0;
 }
 
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH ] net: frag: print frag_mem_limit value in sockstat proc file
  2017-08-29 13:05 [PATCH ] net: frag: print frag_mem_limit value in sockstat proc file liujian56
@ 2017-08-29 23:04 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2017-08-29 23:04 UTC (permalink / raw)
  To: liujian56; +Cc: kuznet, yoshfuji, brouer, fw, netdev

From: <liujian56@huawei.com>
Date: Tue, 29 Aug 2017 21:05:34 +0800

> From: liujian <liujian56@huawei.com>
> 
> From 6d7b857d5( net: use lib/percpu_counter API for fragmentation mem
> accounting),
> frag_mem_limit and sum_frag_mem_limit have different value if there are
> multiple NIC RX CPU.
> Print frag_mem_limit value, then we can get more debug info.
> 
> Signed-off-by: liujian <liujian56@huawei.com>

Sorry, I don't think it is justified to change the deprecated procfs
output just for this.

Use tracepoints and other similar facilities to debug situations
like this if you like.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-08-29 23:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-29 13:05 [PATCH ] net: frag: print frag_mem_limit value in sockstat proc file liujian56
2017-08-29 23:04 ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.