On Sat, Aug 19, 2000 at 09:07:16PM +1000, Andrew Morton wrote:
> 1: Make unregister_netdevice hunt down all the skbuffs associated
> with this device and release them. Sounds hard.
>
> 2: Make the 10 second delay equal to the max of sysctl_ipfrag_time,
> sysctl_ip6frag_time, and who knows what else. This isn't
> attractive because it'll require us to be able to predict
> the future lifetime of all skbuffs for all protocols.
>
> 3: Make unregister_netdevice return -EAGAIN, so the caller
> (usually /sbin/rmmod) can make a policy decision what to do.
> Long term, this is the correct architecture.
>
> The problem with this is that the net drivers will then
> need to be taught that unregister_netdevice can fail.
> They will ALL need changing.
>
> It's not a big change, but frankly, if we're going to
> churn each and every driver then we may as well get
> it right. And at present the Linux netdevice lifecycle is
> far from right. The lack or userland access to
> [un]register_netdevice and the unhealthy linkage
> between sys_ins/del_module and [un]register_netdevice
> is the source of a lot of bugs, races and general
> 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.
>
> 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.
5: Use the refcount of the module containing the network device driver rather
than a separate refcount. This is what most other subsystems do (it's also
horrendously ugly, but it works with the current module architecture).
It'd probably require changes to all network drivers as well, but they should
be rather simple - basically equivalent to the owner field in struct
file_operations.
This would mean you can't rmmod a network device that is even remotely busy,
but if I understand the issues involved correctly, you can ifconfig it down
and wait before trying to rmmod it.
Philipp
|