Subject: Re: [PATCH net-next 1/2] Convert neighbour-table to use hlist

From: Simon Horman <[email-masked]>
Date: Thu, 3 Oct 2024 12:23:17 +0100

On Tue, Oct 01, 2024 at 05:09:56AM +0000, Gilad Naaman wrote:
> Use doubly-linked instead of singly-linked list when linking neighbours,
> so that it is possible to remove neighbours without traversing the
> entire table.
> 
> Signed-off-by: Gilad Naaman <[email-masked]>

Hi Gilad,

This is not a full review, but rather some feedback to take into account
once a proper review arrives.

> ---
>  include/net/neighbour.h |   8 +--
>  net/core/neighbour.c    | 123 ++++++++++++++--------------------------
>  2 files changed, 45 insertions(+), 86 deletions(-)
> 
> diff --git a/include/net/neighbour.h b/include/net/neighbour.h
> index a44f262a7384..77a4aa53aecb 100644
> --- a/include/net/neighbour.h
> +++ b/include/net/neighbour.h
> @@ -135,7 +135,7 @@ struct neigh_statistics {
>  #define NEIGH_CACHE_STAT_INC(tbl, field) this_cpu_inc((tbl)->stats->field)
>  
>  struct neighbour {
> -	struct neighbour __rcu	*next;
> +	struct hlist_node __rcu list;
>  	struct neigh_table	*tbl;
>  	struct neigh_parms	*parms;
>  	unsigned long		confirmed;

Sparse is having a bit of a cow with rcu changes introduced by this patch.
Please take a look at that.

...