Re: introducing ip_send()/ip6_send() to OpenBSD kernel

2015-12-04 Thread Martin Pieuchot
On 04/12/15(Fri) 20:45, David Gwynne wrote: > > On 4 Dec 2015, at 7:36 PM, Martin Pieuchot wrote: > > On 04/12/15(Fri) 12:38, David Gwynne wrote: > >>> On 4 Dec 2015, at 06:44, Alexandr Nedvedicky > >>> wrote: > >> [...] > >> it might be better

Re: introducing ip_send()/ip6_send() to OpenBSD kernel

2015-12-04 Thread Martin Pieuchot
On 04/12/15(Fri) 12:38, David Gwynne wrote: > > > On 4 Dec 2015, at 06:44, Alexandr Nedvedicky > > wrote: > > > > Hello, > > > > below is final patch I'm going to commit. Summary of changes: > > - softnettq declaration moved to net/if_var.h (by bluhm@) > >

Re: introducing ip_send()/ip6_send() to OpenBSD kernel

2015-12-04 Thread Alexandr Nedvedicky
On Thu, Dec 03, 2015 at 11:00:09PM +0100, Thierry Deval wrote: > Hello Sasha, > > You kept the static prototypes for ip_send_dispatch and > ip6_send_dispatch. > > You'd better avoid mixing static and non-static declarations for the same > functions. ;-) > bluhm sitting next to me spot it too.

introducing ip_send()/ip6_send() to OpenBSD kernel

2015-12-03 Thread Alexandr Nedvedicky
Hello, patch below introduces ip_send() function to OpenBSD kernel. ip_send() function takes an mbuf with packet and passes to ip_output(), which will be running in softnet task. the patch also changes icmp_error()/icmp6_error() to dispatch the ICMP error responses via ip_send(), so both

Re: introducing ip_send()/ip6_send() to OpenBSD kernel

2015-12-03 Thread Alexandr Nedvedicky
Hello, so after a feedback in a hackroom here is the third version of patch. The summary of changes is as follows: - ip*_send() function use softnettq to dispatch packet - ip*_output() functions running in ip*_send_dispatch() are protected KERNEL_LOCK() and running at

Re: introducing ip_send()/ip6_send() to OpenBSD kernel

2015-12-03 Thread Alexandr Nedvedicky
Hello, mikeb@ found a fundamental problem in my earlier patch. The ip_send() function was using `softnettq` (softnet task queue) to dispatch packet via ip*_output(). Doing so it's risky business as ip*_output() is not unlocked yet. So new patch version introduces a new task: ipsendtq. The

Re: introducing ip_send()/ip6_send() to OpenBSD kernel

2015-12-03 Thread Alexandr Nedvedicky
Hello, below is final patch I'm going to commit. Summary of changes: - softnettq declaration moved to net/if_var.h (by bluhm@) - lock order swapped: KERNEL_LOCK() goes first folllowed by spl (by bluhm@) - long line got fixed (by bluhm@) -

Re: introducing ip_send()/ip6_send() to OpenBSD kernel

2015-12-03 Thread David Gwynne
> On 4 Dec 2015, at 06:44, Alexandr Nedvedicky > wrote: > > Hello, > > below is final patch I'm going to commit. Summary of changes: > - softnettq declaration moved to net/if_var.h (by bluhm@) > - lock order swapped: KERNEL_LOCK() goes first

Re: introducing ip_send()/ip6_send() to OpenBSD kernel

2015-12-03 Thread Martin Pieuchot
On 03/12/15(Thu) 18:07, Alexandr Nedvedicky wrote: > Hello, > > so after a feedback in a hackroom here is the third version of patch. The > summary of changes is as follows: > - ip*_send() function use softnettq to dispatch packet > - ip*_output() functions running in

Re: introducing ip_send()/ip6_send() to OpenBSD kernel

2015-12-03 Thread Alexander Bluhm
On Thu, Dec 03, 2015 at 06:07:41PM +0100, Alexandr Nedvedicky wrote: > +#ifdef _KERNEL > +extern struct taskq *softnettq; > +#endif /* _KERNEL */ > #endif /* _NET_IF_H_ */ I think this should go to net/if_var.h > +static void > +ip_send_dispatch(void *cx) > +{ Maybe you should pass