History

net: introduce name_node struct to be used in hashlist

Introduce name_node structure to hold name of device and put it into hashlist instead of putting there struct net_device directly. Add a necessary infrastructure to manipulate the hashlist. This prepares the code to use the same hashlist for alternative names introduced later in this set.

Jiri Pirko committed 7 years ago

Commit ff927411 parent 6958c972 files · +87 −20Browse files

Showing the changes to include/linux (1 of 2 files). Show all

Unified · Split

include/linux/netdevice.h+8−2
@@ -925,6 +925,12 @@ struct dev_ifalias { · 924 unmodified lines
925925 struct devlink;
926926 struct tlsdev_ops;
927927
928+struct netdev_name_node {
929+ struct hlist_node hlist;
930+ struct net_device *dev;
931+ const char *name;
932+};
933+
928934 /*
929935 * This structure defines the management hooks for network devices.
930936 * The following hooks can be defined; unless noted otherwise, they are
@@ -1564,7 +1570,7 @@ enum netdev_priv_flags { · 633 unmodified lines
15641570 * (i.e. as seen by users in the "Space.c" file). It is the name
15651571 * of the interface.
15661572 *
1567− * @name_hlist: Device name hash chain, please keep it close to name[]
1573+ * @name_node: Name hashlist node
15681574 * @ifalias: SNMP alias
15691575 * @mem_end: Shared memory end
15701576 * @mem_start: Shared memory start
@@ -1774,7 +1780,7 @@ enum netdev_priv_flags { · 203 unmodified lines
17741780
17751781 struct net_device {
17761782 char name[IFNAMSIZ];
1777− struct hlist_node name_hlist;
1783+ struct netdev_name_node *name_node;
17781784 struct dev_ifalias __rcu *ifalias;
17791785 /*
17801786 * I/O specific fields

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t