Skip to content

Commit

Permalink
ipv4: Retire global IPv4 hash table inet_addr_lst.
Browse files Browse the repository at this point in the history
No one uses inet_addr_lst anymore, so let's remove it.

Reviewed-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.com>
Link: https://patch.msgid.link/20241008172906.1326-5-kuniyu@amazon.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  • Loading branch information
Kuniyuki Iwashima authored and Jakub Kicinski committed Oct 10, 2024
1 parent 1675f38 commit 99ee348
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 11 deletions.
1 change: 0 additions & 1 deletion include/linux/inetdevice.h
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,6 @@ static inline void ipv4_devconf_setall(struct in_device *in_dev)
ARP_EVICT_NOCARRIER)

struct in_ifaddr {
struct hlist_node hash;
struct hlist_node addr_lst;
struct in_ifaddr __rcu *ifa_next;
struct in_device *ifa_dev;
Expand Down
10 changes: 0 additions & 10 deletions net/ipv4/devinet.c
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,6 @@ struct inet_fill_args {
#define IN4_ADDR_HSIZE_SHIFT 8
#define IN4_ADDR_HSIZE (1U << IN4_ADDR_HSIZE_SHIFT)

static struct hlist_head inet_addr_lst[IN4_ADDR_HSIZE];

static u32 inet_addr_hash(const struct net *net, __be32 addr)
{
u32 val = (__force u32) addr ^ net_hash_mix(net);
Expand All @@ -133,15 +131,13 @@ static void inet_hash_insert(struct net *net, struct in_ifaddr *ifa)
u32 hash = inet_addr_hash(net, ifa->ifa_local);

ASSERT_RTNL();
hlist_add_head_rcu(&ifa->hash, &inet_addr_lst[hash]);
hlist_add_head_rcu(&ifa->addr_lst, &net->ipv4.inet_addr_lst[hash]);
}

static void inet_hash_remove(struct in_ifaddr *ifa)
{
ASSERT_RTNL();
hlist_del_init_rcu(&ifa->addr_lst);
hlist_del_init_rcu(&ifa->hash);
}

/**
Expand Down Expand Up @@ -228,7 +224,6 @@ static struct in_ifaddr *inet_alloc_ifa(struct in_device *in_dev)
in_dev_hold(in_dev);
ifa->ifa_dev = in_dev;

INIT_HLIST_NODE(&ifa->hash);
INIT_HLIST_NODE(&ifa->addr_lst);

return ifa;
Expand Down Expand Up @@ -2804,11 +2799,6 @@ static struct rtnl_af_ops inet_af_ops __read_mostly = {

void __init devinet_init(void)
{
int i;

for (i = 0; i < IN4_ADDR_HSIZE; i++)
INIT_HLIST_HEAD(&inet_addr_lst[i]);

register_pernet_subsys(&devinet_ops);
register_netdevice_notifier(&ip_netdev_notifier);

Expand Down

0 comments on commit 99ee348

Please sign in to comment.