hc
2024-12-19 9370bb92b2d16684ee45cf24e879c93c509162da
kernel/net/core/net-procfs.c
....@@ -20,8 +20,8 @@
2020 struct hlist_head *h;
2121 unsigned int count = 0, offset = get_offset(*pos);
2222
23
- h = &net->dev_name_head[get_bucket(*pos)];
24
- hlist_for_each_entry_rcu(dev, h, name_hlist) {
23
+ h = &net->dev_index_head[get_bucket(*pos)];
24
+ hlist_for_each_entry_rcu(dev, h, index_hlist) {
2525 if (++count == offset)
2626 return dev;
2727 }
....@@ -116,6 +116,12 @@
116116 return 0;
117117 }
118118
119
+static u32 softnet_backlog_len(struct softnet_data *sd)
120
+{
121
+ return skb_queue_len_lockless(&sd->input_pkt_queue) +
122
+ skb_queue_len_lockless(&sd->process_queue);
123
+}
124
+
119125 static struct softnet_data *softnet_get_online(loff_t *pos)
120126 {
121127 struct softnet_data *sd = NULL;
....@@ -159,12 +165,17 @@
159165 rcu_read_unlock();
160166 #endif
161167
168
+ /* the index is the CPU id owing this sd. Since offline CPUs are not
169
+ * displayed, it would be othrwise not trivial for the user-space
170
+ * mapping the data a specific CPU
171
+ */
162172 seq_printf(seq,
163
- "%08x %08x %08x %08x %08x %08x %08x %08x %08x %08x %08x\n",
173
+ "%08x %08x %08x %08x %08x %08x %08x %08x %08x %08x %08x %08x %08x\n",
164174 sd->processed, sd->dropped, sd->time_squeeze, 0,
165175 0, 0, 0, 0, /* was fastroute */
166176 0, /* was cpu_collision */
167
- sd->received_rps, flow_limit_count);
177
+ sd->received_rps, flow_limit_count,
178
+ softnet_backlog_len(sd), (int)seq->index);
168179 return 0;
169180 }
170181
....@@ -288,7 +299,7 @@
288299 else
289300 seq_printf(seq, "%04x", ntohs(pt->type));
290301
291
- seq_printf(seq, " %-8s %pf\n",
302
+ seq_printf(seq, " %-8s %ps\n",
292303 pt->dev ? pt->dev->name : "", pt->func);
293304 }
294305