Re: [PATCH net-next] ipv4/fib: send RTM_DELROUTE notify when flush fib

Hangbin Liu
2023-08-09T10:02:47Z

On Wed, Aug 09, 2023 at 10:06:07AM +0300, Ido Schimmel wrote:
> We can instead represent fib_nh_is_v6 and nh_updated using a single bit:
>
> diff --git a/include/net/ip_fib.h b/include/net/ip_fib.h
> index a378eff827c7..a91f8a28689a 100644
> --- a/include/net/ip_fib.h
> +++ b/include/net/ip_fib.h
> @@ -152,8 +152,8 @@ struct fib_info {
> #define fib_rtt fib_metrics->metrics[RTAX_RTT-1]
> #define fib_advmss fib_metrics->metrics[RTAX_ADVMSS-1]
> int fib_nhs;
> - bool fib_nh_is_v6;
> - bool nh_updated;
> + u8 fib_nh_is_v6:1,
> + nh_updated:1;
> struct nexthop *nh;
> struct rcu_head rcu;
> struct fib_nh fib_nh[];
>
> And then add another bit there to mark a FIB info that is deleted
> because of preferred source address deletion.
>
> I suggest testing with the FIB tests in tools/testing/selftests/net/.

Thanks for the suggestion. The discuss in this patch is getting too long.
Let me post the new patch and we can discuss there.

Hangbin