Philipp Rumpf wrote:
>
> 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.
[ Fixed my column wrap this time :) ]
This is not a module issue. It's an unregister_netdevice() issue. It's
quite legitimate to call unregister_netdevice in a kernel which doesn't use
modules at all.
The registration and unregistration of netdevices really shouldn't be linked
to module constructors and destructors. If we had `ifconfig plumb' then the
only place where module refcounts need be altered is in
[un]register_netdevice.
Of course, requiring a separate plumb/unplumb operation would cause howls of
anguish from networking script developers - the operation would probably have
to be grafted into ifconfig or insmod/rmmod somehow for back-compatibility.
One effect of the current setup is that /sbin/rmmod can alter your routing
tables! This means that you can `ifdown' a device, then ten minutes later
some hosts become unreachable because cron came along and reaped the module.
Wierd.
|