Subject: Re: [PATCH net-next] net: preserve sock reference when scrubbing the skb.

From: Flavio Leitner <[email-masked]>
Date: Tue, 26 Jun 2018 19:03:00 -0300

On Tue, Jun 26, 2018 at 02:48:47PM -0700, Cong Wang wrote:
> On Mon, Jun 25, 2018 at 11:41 PM Eric Dumazet <[email-masked]> wrote:
> > When a packet is attached to a socket, we should keep the association as much as possible.
> 
> As much as possible within one stack, I agree. I still don't understand
> why we should keep it across the stack boundary.
> 
> > Only when a new association needs to be done, skb_orphan() needs to be called.
> >
> > Doing this skb_orphan() too soon breaks back pressure in general, this is bad, since a socket
> > can evades SO_SNDBUF limits.
> 
> Right before leaving the stack is not too soon, it is the latest
> actually, for veth case.

Depends on how you view things - it's the same host/stack sharing the
same resources, so why should we not keep it?

-- 
Flavio