Received: by oss.sgi.com id ; Thu, 22 Jun 2000 05:45:34 -0700 Received: from panic.ohr.gatech.edu ([130.207.47.194]:55302 "EHLO havoc.gtf.org") by oss.sgi.com with ESMTP id ; Thu, 22 Jun 2000 05:45:16 -0700 Received: from mandrakesoft.com (adsl-77-228-135.atl.bellsouth.net [216.77.228.135]) by havoc.gtf.org (8.9.3/8.9.3) with ESMTP id IAA06797; Thu, 22 Jun 2000 08:44:28 -0400 Message-ID: <39520A2D.498A3E39@mandrakesoft.com> Date: Thu, 22 Jun 2000 08:44:29 -0400 From: Jeff Garzik Organization: MandrakeSoft X-Mailer: Mozilla 4.73 [en] (X11; I; Linux 2.2.17pre4 i686) X-Accept-Language: en MIME-Version: 1.0 To: Andrew Morton CC: Rusty Russell , Keith Owens , "netdev@oss.sgi.com" Subject: Re: modular net drivers References: Your message of "Wed, 21 Jun 2000 07:49:40 +1000." <4450.961537780@ocs3.ocs-net> <20000621065644.4B30A8154@halfway> <3951889B.B4BFEA36@uow.edu.au> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-netdev@oss.sgi.com Precedence: bulk Return-Path: X-Orcpt: rfc822;netdev-outgoing Andrew Morton wrote: > > Rusty Russell wrote: > > > > module_cleanup should unregister everything first, before doing other > > cleaning up (which might sleep). > > Yup. module_cleanup() calls unregister_netdev(). > > It would be better to do the unregister_netdev(), then to wait for everyone to stop using the device (but how?) and to then reap the module. Two things to remember: one, module_cleanup is called only when module use count (and hence user count) drops to zero, and two unregister_netdev closes the net device, so any users that slipped in and opened the net device during module_cleanup during (is that even possible?) are booted when the net device is closed. This also takes care of any wacky hardware cleanup that needs to be done in dev->stop(), so module_cleanup can simply concern itself with unregistered and freeing stuff and then exiting. Jeff -- Jeff Garzik | Building 1024 | Free beer tomorrow. MandrakeSoft, Inc. |