mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
rtnetlink: speedup rtnl_dump_ifinfo()
When handling large number of netdevice, rtnl_dump_ifinfo() is very slow because it has O(N^2) complexity. Instead of scanning one single list, we can use the 256 sub lists of the dev_index hash table. This considerably speedups "ip link" operations Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
8d5b2c084d
commit
7c28bd0b8e
3 changed files with 29 additions and 17 deletions
|
@ -28,6 +28,10 @@ struct ctl_table_header;
|
|||
struct net_generic;
|
||||
struct sock;
|
||||
|
||||
|
||||
#define NETDEV_HASHBITS 8
|
||||
#define NETDEV_HASHENTRIES (1 << NETDEV_HASHBITS)
|
||||
|
||||
struct net {
|
||||
atomic_t count; /* To decided when the network
|
||||
* namespace should be freed.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue