Re: [PATCH][ATM] use rtnl_{lock,unlock} during device operations (take 2)

From: David S. Miller (davem@redhat.com)
Date: Sat Jun 07 2003 - 02:02:33 EST


   From: Werner Almesberger <wa@almesberger.net>
   Date: Fri, 6 Jun 2003 22:11:00 -0300
   
   When a driver's "close" function returns, the driver must have
   released all externally visible resources (e.g. VPI/VCI) that
   belong to the VCC, and ideally all invisible resources (e.g.
   buffers). There must be no more calls to "push".
   
   In return, the stack must not make any other calls for that
   VCC after invoking "close".

This is exactly how netdevice's WON'T be acting anymore.

All netdevice objects are allocated dynamically, and unregister
just means "disconnect" not "free". It marks the device as
dead, and NULLs out all the callbacks in the netdevice struct.

Any further attempt to use the device (via some PROCFS file I/O
or whatever) will just error out.

So we return long before all references go away, and the final
netdevice reference put does the de-allocation of the netdevice
struct.

Totally asynchronous, and it just works.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sat Jun 07 2003 - 22:00:32 EST