Subject: Re: [PATCH net-next 1/4] vrf: Make pcpu_dstats update functions available to other modules.

From: Guillaume Nault <[email-masked]>
Date: Tue, 3 Dec 2024 12:32:19 +0100

On Mon, Dec 02, 2024 at 07:59:24PM -0800, Jakub Kicinski wrote:
> On Mon, 2 Dec 2024 22:48:48 +0100 Guillaume Nault wrote:
> > -	int len = skb->len;
> >  	netdev_tx_t ret = is_ip_tx_frame(skb, dev);
> > +	unsigned int len = skb->len;
> 
> You can't reorder skb->len init after is_ip_tx_frame().
> IDK what is_ stands for but that function xmits / frees the skb.

Yes, silly mistake. Sorry for not spotting that :/.

> You're already making this code cleaner, let's take another step
> forward and move that call out of line. Complex functions should not
> be called as part of variable init IMHO. It makes the code harder to
> read at best and error prone at worst..

Yes, fully agree. I'll post v2 tomorrow.