Subject: Re: [PATCH net-next] flow_dissector: save computed hash in __skb_get_hash_symmetric_net()

From: Ido Schimmel <[email-masked]>
Date: Thu, 27 Nov 2025 10:24:59 +0200

On Wed, Nov 26, 2025 at 04:21:33PM +0000, Jon Kohler wrote:
> What about a variant of this patch that had an arg like:
> __skb_get_hash_symmetric(struct sk_buff *skb, bool save_hash)
> 
> Then we just make calls (like tun) opt in?

It will require changes in all the callers and I am not sure it's wise
to change a common function for a single user. Why not just patch tun to
call __skb_set_sw_hash(skb, hash, true)? IIUC, even in tun you only need
it in two out of the four callers of __skb_get_hash_symmetric():
tun_get_user() and tun_xdp_one() which both build an skb before
injecting it into the Rx path.