Subject: Re: [PATCH net] __netif_receive_skb_core: pass skb by reference

From: Boris Sukholitko <[email-masked]>
Date: Tue, 19 May 2020 10:35:48 +0300

On Mon, May 18, 2020 at 05:20:13PM +0100, Edward Cree wrote:
> Firstly, please add a Fixes: tag; I expect the relevant commit will be
>  88eb1944e18c ("net: core: propagate SKB lists through packet_type lookup")
>  but I'm not 100% sure so do check that yourself.

You are right, this is the right commit. Fixes tag added.

> Secondly:
> > @@ -5174,6 +5177,7 @@ static int __netif_receive_skb_core(struct sk_buff *skb, bool pfmemalloc,
> >  	}
> >  
> >  out:
> > +	*pskb = skb;
> >  	return ret;
> >  }
> Could we have some sort of WARN_ONs (maybe under #ifdef DEBUG) to check
>  that we never have a NULL skb with a non-NULL pt_prev?  Or at least a
>  comment at the top of the function stating this part of its contract
>  with callers?  I've gone through and convinced myself that it never
>  happens currently, but that depends on some fairly subtle details.

I've added the comment at this hunk. The *ppt_prev assignment happens
several lines above and skb is being used right next to it.

Please see v2 of the patch with this changes.

Thanks,
Boris.