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
925struct devlink;925struct devlink;
926struct tlsdev_ops;926struct tlsdev_ops;
927 927
928struct netdev_name_node {
929 struct hlist_node hlist;
930 struct net_device *dev;
931 const char *name;
932};
933
928/*934/*
929 * This structure defines the management hooks for network devices.935 * This structure defines the management hooks for network devices.
930 * The following hooks can be defined; unless noted otherwise, they are936 * The following hooks can be defined; unless noted otherwise, they are
@@ -1564,7 +1570,7 @@ enum netdev_priv_flags { · 633 unmodified lines
1564 * (i.e. as seen by users in the "Space.c" file). It is the name1570 * (i.e. as seen by users in the "Space.c" file). It is the name
1565 * of the interface.1571 * of the interface.
1566 *1572 *
1567 * @name_hlist: Device name hash chain, please keep it close to name[]1573 * @name_node: Name hashlist node
1568 * @ifalias: SNMP alias1574 * @ifalias: SNMP alias
1569 * @mem_end: Shared memory end1575 * @mem_end: Shared memory end
1570 * @mem_start: Shared memory start1576 * @mem_start: Shared memory start
@@ -1774,7 +1780,7 @@ enum netdev_priv_flags { · 203 unmodified lines
1774 1780
1775struct net_device {1781struct net_device {
1776 char name[IFNAMSIZ];1782 char name[IFNAMSIZ];
1777 struct hlist_node name_hlist;1783 struct netdev_name_node *name_node;
1778 struct dev_ifalias __rcu *ifalias;1784 struct dev_ifalias __rcu *ifalias;
1779 /*1785 /*
1780 * I/O specific fields1786 * 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