On 07/03/17(Tue) 19:28, Alexander Bluhm wrote:
> On Tue, Mar 07, 2017 at 10:44:56AM +0100, Martin Pieuchot wrote:
> > Remove unnecessary splsoftnet()/splx() dances.  Routing sockets do not
> > need the NET_LOCK() and in the code below the SPL has been raised to
> > shut up an assert, so they are no longer needed.
> > 
> > ok?
> 
> They are not necessary and do nothing.  But they mark exactly the
> place where the upper and bottom layer of the network stack meet.

No they don't.  What you're talking about is route_input() which does
an iteration on a global list of raw sockets:

381:                    LIST_FOREACH(rp, &rawcb, rcb_list)  {
382:                            ...

And that's exactly why I want to get rid of them.

But let's have a look at what's being "protected":

  - sbappendaddr() doesn't sleep so the KERNEL_LOCK() is enough for
    now.  However we want to make sure route_input(), hence rtm_*
    functions, are called w/ KERNEL_LOCK() until we have a solution
    for protecting socketbuffers.

  - sowakeup() also needs the KERNEL_LOCK() because of selwakeup()
    an csignal().  I doubt these subsystems will be fixed soon enough
    so we'll go for the same hack currently used in bpf(4).

Of course it only makes sense to address these two items when we have
a solution for ``rawcb''.

> I would leave them there as a hint until we know, how to sepearate
> the protocol stack from routing messages generated by path MTU
> discovery.

Then better put KERNEL_ASSERT_LOCKED() in the places mentioned above.

I still think we should remove them, they don't help.

Reply via email to