[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1505822433.29839.44.camel@edumazet-glaptop3.roam.corp.google.com>
Date: Tue, 19 Sep 2017 05:00:33 -0700
From: Eric Dumazet <eric.dumazet@...il.com>
To: Paolo Abeni <pabeni@...hat.com>
Cc: netdev@...r.kernel.org, "David S. Miller" <davem@...emloft.net>,
Hannes Frederic Sowa <hannes@...essinduktion.org>
Subject: Re: [PATCH net-next] net: avoid a full fib lookup when rp_filter is
disabled.
On Tue, 2017-09-19 at 12:46 +0200, Paolo Abeni wrote:
..
> Acked-by: Hannes Frederic Sowa <hannes@...essinduktion.org>
> Signed-off-by: Paolo Abeni <pabeni@...hat.com>
> ---
> +/* called under RCU lock */
> +struct in_ifaddr *inet_lookup_ifaddr_rcu(struct net *net, __be32 addr)
> +{
> + u32 hash = inet_addr_hash(net, addr);
> + struct in_ifaddr *ifa;
> +
> + hlist_for_each_entry_rcu(ifa, &inet_addr_lst[hash], hash)
> + if (ifa->ifa_local == addr &&
> + net_eq(dev_net(ifa->ifa_dev->dev), net))
> + return ifa;
> +
> + return NULL;
> +}
> +
Any particular reason you do not use this helper to replace the lookup
in __ip_dev_find() ?
In this case, copy paste can be avoided, please avoid a future patch
consolidating the things...
Thanks.
Powered by blists - more mailing lists