Re: [PATCH] net: remove ___neigh_lookup_noref().

From: Eric Dumazet
Date: Tue Dec 05 2023 - 15:08:33 EST


On Tue, Dec 5, 2023 at 8:10 PM YangXin <yx.0xffff@xxxxxxxxx> wrote:
>
> key_eq() and hash() are functions of struct neigh_table, so we just need to call tbl->key_eq() and tbl->hash(), instead of passing them in as parameters.
>
> And if those two parameters were removed, ___neigh_lookup_noref() would be pointless, so I replaced ___neigh_lookup_noref() with __neigh_lookup_noref().
>
> Signed-off-by: YangXin <yx.0xffff@xxxxxxxxx>
> ---
> Last time I comitted this patch, Mr Dumazet said "this might defeat inlining.".
> So I compiled kernel on my computer with defconfig, made sure that this patch would not lead __neigh_lookup_noref() fail to inline.

Not sure how you checked, but I found the opposite.

This patch adds additional indirect function calls, with additional
RETPOLINE costs.

Look at ip_neigh_gw4() disassembly before/after your patch.