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.

net-sysfs: display two backlog queue len separately

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>
Reviewed-by: Simon Horman <simon.horman@corigine.com>
Link: https://lore.kernel.org/r/20230321015746.96994-1-kerneljasonxing@gmail.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>

authored by

Jason Xing and committed by
Paolo Abeni
59da2d7b 4d1f5155

+13 -5
+13 -5
net/core/net-procfs.c
··· 115 115 return 0; 116 116 } 117 117 118 - static u32 softnet_backlog_len(struct softnet_data *sd) 118 + static u32 softnet_input_pkt_queue_len(struct softnet_data *sd) 119 119 { 120 - return skb_queue_len_lockless(&sd->input_pkt_queue) + 121 - skb_queue_len_lockless(&sd->process_queue); 120 + return skb_queue_len_lockless(&sd->input_pkt_queue); 121 + } 122 + 123 + static u32 softnet_process_queue_len(struct softnet_data *sd) 124 + { 125 + return skb_queue_len_lockless(&sd->process_queue); 122 126 } 123 127 124 128 static struct softnet_data *softnet_get_online(loff_t *pos) ··· 156 152 static int softnet_seq_show(struct seq_file *seq, void *v) 157 153 { 158 154 struct softnet_data *sd = v; 155 + u32 input_qlen = softnet_input_pkt_queue_len(sd); 156 + u32 process_qlen = softnet_process_queue_len(sd); 159 157 unsigned int flow_limit_count = 0; 160 158 161 159 #ifdef CONFIG_NET_FLOW_LIMIT ··· 175 169 * mapping the data a specific CPU 176 170 */ 177 171 seq_printf(seq, 178 - "%08x %08x %08x %08x %08x %08x %08x %08x %08x %08x %08x %08x %08x\n", 172 + "%08x %08x %08x %08x %08x %08x %08x %08x %08x %08x %08x %08x %08x " 173 + "%08x %08x\n", 179 174 sd->processed, sd->dropped, sd->time_squeeze, 0, 180 175 0, 0, 0, 0, /* was fastroute */ 181 176 0, /* was cpu_collision */ 182 177 sd->received_rps, flow_limit_count, 183 - softnet_backlog_len(sd), (int)seq->index); 178 + input_qlen + process_qlen, (int)seq->index, 179 + input_qlen, process_qlen); 184 180 return 0; 185 181 } 186 182