Re: [PATCH net 2/2] net: ioam6: mitigate the two reallocations problem

From: Paolo Abeni
Date: Thu Jul 04 2024 - 05:23:49 EST


On Tue, 2024-07-02 at 19:44 +0200, Justin Iurman wrote:
> @@ -313,6 +316,10 @@ static int ioam6_output(struct net *net, struct sock *sk, struct sk_buff *skb)
>
> orig_daddr = ipv6_hdr(skb)->daddr;
>
> + local_bh_disable();
> + dst = dst_cache_get(&ilwt->cache);
> + local_bh_enable();
> +
> switch (ilwt->mode) {
> case IOAM6_IPTUNNEL_MODE_INLINE:

I now see that the way you coded patch 1/2 makes this one easier.

Still I think it's quite doubtful to make the dst cache access
unconditional.

Given the above I suggest to replace the 2 patches with a single one
moving the whole dst_cache logic before the switch statement.

Also this does not address a functional issue, IMHO it's more a
performance improvement, could as well target net-next with no fixes
tag.

WRT seg6 and rpl tunnels, before any patch, I think we first need
confirmation the problem is present there, too.

Thanks,

Paolo