linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] net-sysfs: display two backlog queue len separately
@ 2023-03-11 15:17 Jason Xing
  2023-03-12 19:02 ` Simon Horman
  2023-03-13 12:34 ` Eric Dumazet
  0 siblings, 2 replies; 14+ messages in thread
From: Jason Xing @ 2023-03-11 15:17 UTC (permalink / raw)
  To: davem, edumazet, kuba, pabeni
  Cc: netdev, linux-kernel, kerneljasonxing, Jason Xing

From: Jason Xing <kernelxing@tencent.com>

Sometimes we need to know which one of backlog queue can be exactly
long enough to cause some latency when debugging this part is needed.
Thus, we can then separate the display of both.

Signed-off-by: Jason Xing <kernelxing@tencent.com>
---
 net/core/net-procfs.c | 17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)

diff --git a/net/core/net-procfs.c b/net/core/net-procfs.c
index 1ec23bf8b05c..97a304e1957a 100644
--- a/net/core/net-procfs.c
+++ b/net/core/net-procfs.c
@@ -115,10 +115,14 @@ static int dev_seq_show(struct seq_file *seq, void *v)
 	return 0;
 }
 
-static u32 softnet_backlog_len(struct softnet_data *sd)
+static u32 softnet_input_pkt_queue_len(struct softnet_data *sd)
 {
-	return skb_queue_len_lockless(&sd->input_pkt_queue) +
-	       skb_queue_len_lockless(&sd->process_queue);
+	return skb_queue_len_lockless(&sd->input_pkt_queue);
+}
+
+static u32 softnet_process_queue_len(struct softnet_data *sd)
+{
+	return skb_queue_len_lockless(&sd->process_queue);
 }
 
 static struct softnet_data *softnet_get_online(loff_t *pos)
@@ -169,12 +173,15 @@ static int softnet_seq_show(struct seq_file *seq, void *v)
 	 * mapping the data a specific CPU
 	 */
 	seq_printf(seq,
-		   "%08x %08x %08x %08x %08x %08x %08x %08x %08x %08x %08x %08x %08x\n",
+		   "%08x %08x %08x %08x %08x %08x %08x %08x %08x %08x %08x %08x %08x "
+		   "%08x %08x\n",
 		   sd->processed, sd->dropped, sd->time_squeeze, 0,
 		   0, 0, 0, 0, /* was fastroute */
 		   0,	/* was cpu_collision */
 		   sd->received_rps, flow_limit_count,
-		   softnet_backlog_len(sd), (int)seq->index);
+		   0,	/* was len of two backlog queues */
+		   (int)seq->index,
+		   softnet_input_pkt_queue_len(sd), softnet_process_queue_len(sd));
 	return 0;
 }
 
-- 
2.37.3


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

end of thread, other threads:[~2023-03-14  1:57 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-11 15:17 [PATCH net-next] net-sysfs: display two backlog queue len separately Jason Xing
2023-03-12 19:02 ` Simon Horman
2023-03-13  1:55   ` Jason Xing
2023-03-13  2:28     ` Stephen Hemminger
2023-03-13  2:42       ` Jason Xing
2023-03-13  9:03       ` Jason Xing
2023-03-13 12:11     ` Simon Horman
2023-03-13 12:19       ` Jason Xing
2023-03-13 12:34 ` Eric Dumazet
2023-03-13 13:15   ` Jason Xing
2023-03-13 15:59     ` Eric Dumazet
2023-03-13 17:15       ` Jason Xing
2023-03-13 17:33         ` Eric Dumazet
2023-03-14  1:54           ` Jason Xing

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).