Skip to content

Commit

Permalink
net-sysfs: display two backlog queue len separately
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jason Xing authored and Paolo Abeni committed Mar 22, 2023
1 parent 4d1f515 commit 59da2d7
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions net/core/net-procfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -152,6 +156,8 @@ static void softnet_seq_stop(struct seq_file *seq, void *v)
static int softnet_seq_show(struct seq_file *seq, void *v)
{
struct softnet_data *sd = v;
u32 input_qlen = softnet_input_pkt_queue_len(sd);
u32 process_qlen = softnet_process_queue_len(sd);
unsigned int flow_limit_count = 0;

#ifdef CONFIG_NET_FLOW_LIMIT
Expand All @@ -169,12 +175,14 @@ 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);
input_qlen + process_qlen, (int)seq->index,
input_qlen, process_qlen);
return 0;
}

Expand Down

0 comments on commit 59da2d7

Please sign in to comment.