netdev
[Top] [All Lists]

Re: [patch] IP_FRAG_TIME versus unregister_netdevice

To: andrewm@xxxxxxxxxx (Andrew Morton)
Subject: Re: [patch] IP_FRAG_TIME versus unregister_netdevice
From: kuznet@xxxxxxxxxxxxx
Date: Sat, 19 Aug 2000 21:20:47 +0400 (MSK DST)
Cc: davem@xxxxxxxxxx, netdev@xxxxxxxxxxx
In-reply-to: <399E6A64.CB616120@xxxxxxxxxx> from "Andrew Morton" at Aug 19, 0 09:07:16 pm
Sender: owner-netdev@xxxxxxxxxxx
Hello!

> The problem is, orphan ipv4 fragments have a reference to
> the device

It must release this reference. I forgot to do this last step, of course,
though all the necessary code to make this in self-consitent way was ready.

Any code, queueing packet to process it at an unknown moment in future,
should release reference to device or hook notifier.
Protocols do this, defragmenter forgets, I apologise.


> 3: Make unregister_netdevice return -EAGAIN, so the caller
>    (usually /sbin/rmmod) can make a policy decision what to do.
...
>    The problem with this is that the net drivers will then
>    need to be taught that  unregister_netdevice can fail.

No. unregister_netdevice() cannot fail. It is simply used
in wrong context.

All that it makes, is making device inaccessible for future
references, this operation cannot fail exactly like unlink() or
close() of a file cannot fail, because file is "busy".

Any _reasonable_ object maintanance system has two closing
routines: unlink() and put(). Otherwise it cannot be free
of deadlocks, races etc. Seems, it is pretty evident.

Waiting overloads and breaks this principle, combining close()
with unlink() to some strange mix. It is due to evident reasons though.


>    They will ALL need changing.

It is not true. Original ancient design of modules was _right_.
It was broken in details, but the idea was right.
It had no "destroy" routine, but assumption that most of modules need not
any special destructor is fair assumption, working for modules,
which do not allocate dynamic resources, required to be kept
after close().

It was broken later by some unknown reasons and it is never
too late to undo these quasi-improvements.
BTW nothing in modules changed since that time,
only some barroque details sort of MODULE_AUTHOR appeared. 8)


>    bogosity.  We need `ifconfig plumb' and `ifconfig
>    unplumb', like Solaris.  I'll write a rant about this
>    sometime, but I suggest it's 2.5-food.

Yes.


> 4: Make unregister_netdevice() wait until the device is
>    free, as Alexey suggested in his comment.
> 
>    That's what this patch does.  It waits indefinitely for the
>    device to become free and prints a message every ten seconds
>    while waiting.

Right. It should be made to date of release 2.4 in any case.

Alexey

<Prev in Thread] Current Thread [Next in Thread>