Skip to content

neighbour: Convert RTM_GETNEIGH to RCU and make pneigh RTNL-free.

Kuniyuki Iwashima netdev 3 versions – Applied

Status from this message: This series was applied to netdev/net-next.git (main)

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest15 patches 0 repliesApplied 15/15
  2. v215 patches 8 repliesSuperseded
  3. v114 patches 3 repliesSuperseded

Changes in v3 from the cover letter

* Patch 1:
* Return ERR_PTR() direclty instead of goto in neigh_valid_get_req().
* Patch 2:
* Use NL_SET_ERR_ATTR_MISS() for NDA_DST
* Patch 3:
* Rename err label to err_free_skb
* Patch 8:
* Cache pn->protocol in pneigh_fill_info()
* Patch 9:
* Rename err label to err_unlock

Patches in v3 All 15 applied

#Subject and filesSizeRepliesApplied
1/15neighbour: Make neigh_valid_get_req() return ndmsg.net/core/neighbour.c+19 -240 repliesApplied
2/15neighbour: Move two validations from neigh_get() to neigh_valid_get_req().net/core/neighbour.c+13 -130 repliesApplied
3/15neighbour: Allocate skb in neigh_get().net/core/neighbour.c+32 -560 repliesApplied
4/15neighbour: Move neigh_find_table() to neigh_get().net/core/neighbour.c+20 -170 repliesApplied
5/15neighbour: Split pneigh_lookup().include/net/neighbour.h net/core/neighbour.c net/ipv4/arp.c +2 more+36 -160 repliesApplied
6/15neighbour: Annotate neigh_table.phash_buckets and pneigh_entry.next with __rcu.include/net/neighbour.h net/core/neighbour.c+33 -230 repliesApplied
7/15neighbour: Free pneigh_entry after RCU grace period.include/net/neighbour.h net/core/neighbour.c+32 -170 repliesApplied
8/15neighbour: Annotate access to struct pneigh_entry.{flags,protocol}.net/core/neighbour.c+8 -50 repliesApplied
9/15neighbour: Convert RTM_GETNEIGH to RCU.net/core/neighbour.c+15 -100 repliesApplied
10/15neighbour: Drop read_lock_bh(&tbl->lock) in pneigh_dump_table().net/core/neighbour.c+3 -80 repliesApplied
11/15neighbour: Use rcu_dereference() in pneigh_get_{first,next}().net/core/neighbour.c+5 -50 repliesApplied
12/15neighbour: Remove __pneigh_lookup().include/net/neighbour.h net/core/neighbour.c net/ipv6/ndisc.c+2 -170 repliesApplied
13/15neighbour: Drop read_lock_bh(&tbl->lock) in pneigh_lookup().net/core/neighbour.c+16 -270 repliesApplied
14/15neighbour: Protect tbl->phash_buckets[] with a dedicated mutex.include/net/neighbour.h net/core/neighbour.c+22 -180 repliesApplied
15/15neighbour: Update pneigh_entry in pneigh_create().include/net/neighbour.h net/core/neighbour.c net/ipv4/arp.c+20 -230 repliesApplied

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v3 yet.

Read the v3 thread

Cover letter [PATCH v3 net-next 00/15] neighbour: Convert RTM_GETNEIGH to RCU and make pneigh RTNL-free.

This is kind of v3 of the series below [0] but without NEIGHTBL patches.

Patch 1 ~ 4 and 9 come from the series to convert RTM_GETNEIGH to RCU.

Other patches clean up pneigh_lookup() and convert the pneigh code to RCU + private mutex so that we can easily remove RTNL from RTM_NEWNEIGH in the later series.

[0]: https://lore.kernel.org/netdev/[email protected]/

Changes:
v3:
* Patch 1:
* Return ERR_PTR() direclty instead of goto in neigh_valid_get_req().
* Patch 2:
* Use NL_SET_ERR_ATTR_MISS() for NDA_DST
* Patch 3:
* Rename err label to err_free_skb
* Patch 8:
* Cache pn->protocol in pneigh_fill_info()
* Patch 9:
* Rename err label to err_unlock

v2: https://lore.kernel.org/netdev/[email protected]/
* Add patch 6 to silence Sparse __rcu warning

v1: https://lore.kernel.org/netdev/[email protected]/

Kuniyuki Iwashima (15):
neighbour: Make neigh_valid_get_req() return ndmsg.
neighbour: Move two validations from neigh_get() to

    neigh_valid_get_req().
  neighbour: Allocate skb in neigh_get().
  neighbour: Move neigh_find_table() to neigh_get().
  neighbour: Split pneigh_lookup().
  neighbour: Annotate neigh_table.phash_buckets and pneigh_entry.next
    with __rcu.

neighbour: Free pneigh_entry after RCU grace period.
neighbour: Annotate access to struct pneigh_entry.{flags,protocol}.
neighbour: Convert RTM_GETNEIGH to RCU.
neighbour: Drop read_lock_bh(&tbl->lock) in pneigh_dump_table().
neighbour: Use rcu_dereference() in pneigh_get_{first,next}().
neighbour: Remove __pneigh_lookup().
neighbour: Drop read_lock_bh(&tbl->lock) in pneigh_lookup().
neighbour: Protect tbl->phash_buckets[] with a dedicated mutex.
neighbour: Update pneigh_entry in pneigh_create().

 include/net/neighbour.h |  17 +-
 net/core/neighbour.c    | 384 ++++++++++++++++++++--------------------
 net/ipv4/arp.c          |   6 +-
 net/ipv6/ip6_output.c   |   2 +-
 net/ipv6/ndisc.c        |   8 +-
 5 files changed, 207 insertions(+), 210 deletions(-)
Signature · 1 line
2.50.0.727.gbf7dc18ff4-goog