Re: Removing skb_orphan() from ip_rcv_core()

2019-06-25 Thread Joe Stringer
On Tue, Jun 25, 2019 at 4:07 AM Jamal Hadi Salim wrote: > > On 2019-06-24 11:26 p.m., Joe Stringer wrote: > [..] > > > > I haven't got as far as UDP yet, but I didn't see any need for a > > dependency on netfilter. > > I'd be curious to see what you did. My experience, even for TCP is > the socket

Re: Removing skb_orphan() from ip_rcv_core()

2019-06-25 Thread Joe Stringer
On Mon, Jun 24, 2019 at 11:37 PM Eric Dumazet wrote: > On 6/24/19 8:17 PM, Joe Stringer wrote: > > On Fri, Jun 21, 2019 at 1:59 PM Florian Westphal wrote: > >> Joe Stringer wrote: > >>> However, if I drop these lines then I end up causing sockets to > >>> release references too many times. Seems

Re: Removing skb_orphan() from ip_rcv_core()

2019-06-25 Thread Eric Dumazet
On 6/25/19 2:35 AM, Daniel Borkmann wrote: > > But wasn't the whole point of 9c4c325252c5 ("skbuff: preserve sock reference > when > scrubbing the skb.") to defer orphaning to as late as possible? If I'm not > missing > anything, then above would reintroduce the issues that 9c4c325252c5 was

Re: Removing skb_orphan() from ip_rcv_core()

2019-06-25 Thread Jamal Hadi Salim
On 2019-06-24 11:26 p.m., Joe Stringer wrote: [..] I haven't got as far as UDP yet, but I didn't see any need for a dependency on netfilter. I'd be curious to see what you did. My experience, even for TCP is the socket(transparent/tproxy) lookup code (to set skb->sk either listening or establi

Re: Removing skb_orphan() from ip_rcv_core()

2019-06-25 Thread Jamal Hadi Salim
On 2019-06-24 12:49 p.m., Eric Dumazet wrote: Well, I would simply remove the skb_orphan() call completely. My experience: You still need to call skb_orphan() from the lower level (and set the skb destructor etc). cheers, jamal

Re: Removing skb_orphan() from ip_rcv_core()

2019-06-25 Thread Daniel Borkmann
On 06/25/2019 08:37 AM, Eric Dumazet wrote: > On 6/24/19 8:17 PM, Joe Stringer wrote: >> On Fri, Jun 21, 2019 at 1:59 PM Florian Westphal wrote: >>> >>> Joe Stringer wrote: As discussed during LSFMM, I've been looking at adding something like an `skb_sk_assign()` helper to BPF so that l

Re: Removing skb_orphan() from ip_rcv_core()

2019-06-24 Thread Eric Dumazet
On 6/24/19 8:17 PM, Joe Stringer wrote: > On Fri, Jun 21, 2019 at 1:59 PM Florian Westphal wrote: >> >> Joe Stringer wrote: >>> As discussed during LSFMM, I've been looking at adding something like >>> an `skb_sk_assign()` helper to BPF so that logic similar to TPROXY can >>> be implemented wi

Re: Removing skb_orphan() from ip_rcv_core()

2019-06-24 Thread Joe Stringer
On Mon, Jun 24, 2019 at 7:47 AM Jamal Hadi Salim wrote: > > On 2019-06-21 1:58 p.m., Joe Stringer wrote: > > Hi folks, picking this up again.. > [..] > > During LSFMM, it seemed like no-one knew quite why the skb_orphan() is > > necessary in that path in the current version of the code, and that w

Re: Removing skb_orphan() from ip_rcv_core()

2019-06-24 Thread Joe Stringer
On Fri, Jun 21, 2019 at 1:59 PM Florian Westphal wrote: > > Joe Stringer wrote: > > As discussed during LSFMM, I've been looking at adding something like > > an `skb_sk_assign()` helper to BPF so that logic similar to TPROXY can > > be implemented with integration into other BPF logic, however >

Re: Removing skb_orphan() from ip_rcv_core()

2019-06-24 Thread Eric Dumazet
On 6/24/19 7:47 AM, Jamal Hadi Salim wrote: > On 2019-06-21 1:58 p.m., Joe Stringer wrote: >> Hi folks, picking this up again.. > [..] >> During LSFMM, it seemed like no-one knew quite why the skb_orphan() is >> necessary in that path in the current version of the code, and that we >> may be abl

Re: Removing skb_orphan() from ip_rcv_core()

2019-06-24 Thread Jamal Hadi Salim
On 2019-06-21 1:58 p.m., Joe Stringer wrote: Hi folks, picking this up again.. [..] During LSFMM, it seemed like no-one knew quite why the skb_orphan() is necessary in that path in the current version of the code, and that we may be able to remove it. Florian, I know you weren't in the room for

Re: Removing skb_orphan() from ip_rcv_core()

2019-06-21 Thread Eric Dumazet
On 6/21/19 10:58 AM, Joe Stringer wrote: > Hi folks, picking this up again.. > > As discussed during LSFMM, I've been looking at adding something like > an `skb_sk_assign()` helper to BPF so that logic similar to TPROXY can > be implemented with integration into other BPF logic, however > curre

Re: Removing skb_orphan() from ip_rcv_core()

2019-06-21 Thread Florian Westphal
Joe Stringer wrote: > As discussed during LSFMM, I've been looking at adding something like > an `skb_sk_assign()` helper to BPF so that logic similar to TPROXY can > be implemented with integration into other BPF logic, however > currently any attempts to do so are blocked by the skb_orphan() cal

Removing skb_orphan() from ip_rcv_core()

2019-06-21 Thread Joe Stringer
Hi folks, picking this up again.. As discussed during LSFMM, I've been looking at adding something like an `skb_sk_assign()` helper to BPF so that logic similar to TPROXY can be implemented with integration into other BPF logic, however currently any attempts to do so are blocked by the skb_orphan