netdev
[Top] [All Lists]

Re: [patch] IP_FRAG_TIME versus unregister_netdevice

To: Philipp Rumpf <prumpf@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
Subject: Re: [patch] IP_FRAG_TIME versus unregister_netdevice
From: Andrew Morton <andrewm@xxxxxxxxxx>
Date: Sun, 20 Aug 2000 21:02:20 +1000
Cc: "netdev@xxxxxxxxxxx" <netdev@xxxxxxxxxxx>
References: <399E6A64.CB616120@uow.edu.au>, <399E6A64.CB616120@uow.edu.au>; from andrewm@uow.edu.au on Sat, Aug 19, 2000 at 09:07:16PM +1000 <20000819160601.I23855@parcelfarce.linux.theplanet.co.uk>
Sender: owner-netdev@xxxxxxxxxxx
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.

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