diff options
| author | Eric Dumazet <edumazet@google.com> | 2025-03-02 12:42:36 +0000 |
|---|---|---|
| committer | Jakub Kicinski <kuba@kernel.org> | 2025-03-04 17:46:26 -0800 |
| commit | d186f405fdf4229d0e9a52ba71662404b06cc002 (patch) | |
| tree | 6fe084401a9ea3a703ca5233285e209400519f9a /include/net | |
| parent | tcp: optimize inet_use_bhash2_on_bind() (diff) | |
| download | linux-d186f405fdf4229d0e9a52ba71662404b06cc002.tar.gz linux-d186f405fdf4229d0e9a52ba71662404b06cc002.zip | |
tcp: add RCU management to inet_bind_bucket
Add RCU protection to inet_bind_bucket structure.
- Add rcu_head field to the structure definition.
- Use kfree_rcu() at destroy time, and remove inet_bind_bucket_destroy()
first argument.
- Use hlist_del_rcu() and hlist_add_head_rcu() methods.
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Jason Xing <kerneljasonxing@gmail.com>
Reviewed-by: Kuniyuki Iwashima <kuniyu@amazon.com>
Link: https://patch.msgid.link/20250302124237.3913746-4-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'include/net')
| -rw-r--r-- | include/net/inet_hashtables.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/include/net/inet_hashtables.h b/include/net/inet_hashtables.h index da818fb0205f..1061c4f536a6 100644 --- a/include/net/inet_hashtables.h +++ b/include/net/inet_hashtables.h @@ -89,6 +89,7 @@ struct inet_bind_bucket { bool fast_ipv6_only; struct hlist_node node; struct hlist_head bhash2; + struct rcu_head rcu; }; struct inet_bind2_bucket { @@ -226,8 +227,7 @@ struct inet_bind_bucket * inet_bind_bucket_create(struct kmem_cache *cachep, struct net *net, struct inet_bind_hashbucket *head, const unsigned short snum, int l3mdev); -void inet_bind_bucket_destroy(struct kmem_cache *cachep, - struct inet_bind_bucket *tb); +void inet_bind_bucket_destroy(struct inet_bind_bucket *tb); bool inet_bind_bucket_match(const struct inet_bind_bucket *tb, const struct net *net, unsigned short port, |
