Messages in this thread | | | From | Stephen Hemminger <> | Subject | Re: MOD_INC_USE_COUNT | Date | Tue, 15 Nov 2005 10:52:57 -0800 |
| |
On Thu, 10 Nov 2005 21:14:29 +0800 Tony <tony.uestc@gmail.com> wrote:
> Hello All, > Usually, when a net_device->open is called, it will MOD_INC_USE_COUNT on > success. It is removed since 2.5.x, then should I increase the use > count? how? thx. > - > 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/
Did you read Documentation/network/netdevices.txt?
Networking devices don't do ref counting because they should be removable at any time! Because of hotplug and failover, it just doesn't work to keep track of ref counting network devices.
What happens is that each protocol is notified on module removal of a network device. The protocol then cleans up all references to that device. If the protocol is buggy, then you will see the kernel wait and print a message that ref count is still not correct.
-- Stephen Hemminger <shemminger@osdl.org> OSDL http://developer.osdl.org/~shemminger - 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/
| |