From mboxrd@z Thu Jan 1 00:00:00 1970 From: Flavio Leitner Subject: Re: [PATCH net-next] net: preserve sock reference when scrubbing the skb. Date: Tue, 26 Jun 2018 20:33:02 -0300 Message-ID: <20180626233302.GU19565@plex.lan> References: <20180625155610.30802-1-fbl@redhat.com> <48e15faf-f935-0166-e1db-18f7286e7264@gmail.com> <20180626220300.GT19565@plex.lan> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Eric Dumazet , Linux Kernel Network Developers , Paolo Abeni , David Miller , Florian Westphal , NetFilter To: Cong Wang Return-path: Received: from mail-qt0-f194.google.com ([209.85.216.194]:43513 "EHLO mail-qt0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932404AbeFZXdJ (ORCPT ); Tue, 26 Jun 2018 19:33:09 -0400 Received: by mail-qt0-f194.google.com with SMTP id c8-v6so135976qtp.10 for ; Tue, 26 Jun 2018 16:33:09 -0700 (PDT) Content-Disposition: inline In-Reply-To: Sender: netdev-owner@vger.kernel.org List-ID: On Tue, Jun 26, 2018 at 03:47:31PM -0700, Cong Wang wrote: > On Tue, Jun 26, 2018 at 3:03 PM Flavio Leitner wrote: > > > > On Tue, Jun 26, 2018 at 02:48:47PM -0700, Cong Wang wrote: > > > On Mon, Jun 25, 2018 at 11:41 PM Eric Dumazet 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? > > Because stacks are supposed to be independent, netdevices are > isolated, iptables and route tables too. This is how netns is designed > from the beginning. The trend today is actually more isolation instead > of more sharing, given the popularity of containers. It is still isolated, the sk carries the netns info and it is orphaned when it re-enters the stack. -- Flavio