Commit 0e0939c
net-procfs: use xarray iterator to implement /proc/net/dev
In commit 759ab1e ("net: store netdevs in an xarray")
Jakub added net->dev_by_index to map ifindex to netdevices.
We can get rid of the old hash table (net->dev_index_head),
one patch at a time, if performance is acceptable.
This patch removes unpleasant code to something more readable.
As a bonus, /proc/net/dev gets netdevices sorted by their ifindex.
Signed-off-by: Eric Dumazet <edumazet@google.com>
Link: https://lore.kernel.org/r/20240207165318.3814525-1-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>1 parent 6fb5dfe commit 0e0939c
1 file changed
+7
-41
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
| 9 | + | |
16 | 10 | | |
17 | | - | |
| 11 | + | |
18 | 12 | | |
19 | | - | |
20 | | - | |
21 | 13 | | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
26 | 17 | | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | 18 | | |
46 | 19 | | |
47 | 20 | | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | 21 | | |
53 | 22 | | |
54 | 23 | | |
55 | 24 | | |
56 | 25 | | |
57 | 26 | | |
58 | 27 | | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
| 28 | + | |
63 | 29 | | |
64 | 30 | | |
65 | 31 | | |
66 | 32 | | |
67 | 33 | | |
68 | | - | |
| 34 | + | |
69 | 35 | | |
70 | 36 | | |
71 | 37 | | |
| |||
0 commit comments