* network driver usage count
@ 2007-11-21 19:45 Ferenc Wagner
2007-11-21 21:04 ` Stephen Hemminger
0 siblings, 1 reply; 6+ messages in thread
From: Ferenc Wagner @ 2007-11-21 19:45 UTC (permalink / raw)
To: linux-kernel
Hi!
Under 2.6.23.1, my lsmod output shows this:
$ lsmod | grep tg3
tg3 100580 0
The usage count is zero, even though it drives my two physical
interfaces:
$ ls -l /sys/class/net/eth-gb?/device/driver
lrwxrwxrwx 1 root root 0 2007-11-21 19:58 /sys/class/net/eth-gb1/device/driver -> ../../../bus/pci/drivers/tg3
lrwxrwxrwx 1 root root 0 2007-11-21 19:58 /sys/class/net/eth-gb2/device/driver -> ../../../bus/pci/drivers/tg3
These interfaces are up and bonded together, but that doesn't seem to
matter at all. I also checked other machines, the network driver
(tg3, e1000) usage counts are always zero under various recent 2.6
kernels, but nonzero under 2.4.21 for example.
And really, the module could be removed, cutting my ssh session. :)
Was this made possible intentionally? If yes, why?
--
Thanks,
Feri.
PS. please Cc: me, I'm not on the list.
PPS. on loading tg3, I get messages like:
eth-gb1: device_rename: sysfs_create_symlink failed (-17)
I configured renaming by udev, did I make a mistake?
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: network driver usage count
2007-11-21 19:45 network driver usage count Ferenc Wagner
@ 2007-11-21 21:04 ` Stephen Hemminger
2007-11-21 22:16 ` Wagner Ferenc
0 siblings, 1 reply; 6+ messages in thread
From: Stephen Hemminger @ 2007-11-21 21:04 UTC (permalink / raw)
To: linux-kernel
On Wed, 21 Nov 2007 20:45:11 +0100
Ferenc Wagner <wferi@niif.hu> wrote:
> Hi!
>
> Under 2.6.23.1, my lsmod output shows this:
>
> $ lsmod | grep tg3
> tg3 100580 0
>
> The usage count is zero, even though it drives my two physical
> interfaces:
>
> $ ls -l /sys/class/net/eth-gb?/device/driver
> lrwxrwxrwx 1 root root 0 2007-11-21 19:58 /sys/class/net/eth-gb1/device/driver -> ../../../bus/pci/drivers/tg3
> lrwxrwxrwx 1 root root 0 2007-11-21 19:58 /sys/class/net/eth-gb2/device/driver -> ../../../bus/pci/drivers/tg3
>
> These interfaces are up and bonded together, but that doesn't seem to
> matter at all. I also checked other machines, the network driver
> (tg3, e1000) usage counts are always zero under various recent 2.6
> kernels, but nonzero under 2.4.21 for example.
>
> And really, the module could be removed, cutting my ssh session. :)
>
> Was this made possible intentionally? If yes, why?
Yes, so devices can be removed at anytime.
--
Stephen Hemminger <shemminger@linux-foundation.org>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: network driver usage count
2007-11-21 21:04 ` Stephen Hemminger
@ 2007-11-21 22:16 ` Wagner Ferenc
2007-11-21 23:53 ` Francois Romieu
2007-11-23 1:04 ` David Miller
0 siblings, 2 replies; 6+ messages in thread
From: Wagner Ferenc @ 2007-11-21 22:16 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: linux-kernel
Stephen Hemminger <shemminger@linux-foundation.org> writes:
> On Wed, 21 Nov 2007 20:45:11 +0100
> Ferenc Wagner <wferi@niif.hu> wrote:
>
>> Under 2.6.23.1, my lsmod output shows this:
>>
>> $ lsmod | grep tg3
>> tg3 100580 0
>>
>> The usage count is zero, even though it drives my two physical
>> interfaces:
>>
>> $ ls -l /sys/class/net/eth-gb?/device/driver
>> lrwxrwxrwx 1 root root 0 2007-11-21 19:58 /sys/class/net/eth-gb1/device/driver -> ../../../bus/pci/drivers/tg3
>> lrwxrwxrwx 1 root root 0 2007-11-21 19:58 /sys/class/net/eth-gb2/device/driver -> ../../../bus/pci/drivers/tg3
>>
>> These interfaces are up and bonded together, but that doesn't seem to
>> matter at all. I also checked other machines, the network driver
>> (tg3, e1000) usage counts are always zero under various recent 2.6
>> kernels, but nonzero under 2.4.21 for example.
>>
>> And really, the module could be removed, cutting my ssh session. :)
>>
>> Was this made possible intentionally? If yes, why?
>
> Yes, so devices can be removed at anytime.
Hmm, that would warrant nuking all the reference counts on every
driver. I must be missing something, since I really feel it goes
against common sense. Can you point me to some discussion of this
change? I mean, I couldn't remove the driver of a mounted filesystem.
So why can I remove a driver serving live network traffic?
--
Thanks,
Feri.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: network driver usage count
2007-11-21 22:16 ` Wagner Ferenc
@ 2007-11-21 23:53 ` Francois Romieu
2007-11-23 1:04 ` David Miller
1 sibling, 0 replies; 6+ messages in thread
From: Francois Romieu @ 2007-11-21 23:53 UTC (permalink / raw)
To: Wagner Ferenc; +Cc: Stephen Hemminger, linux-kernel
Wagner Ferenc <wferi@niif.hu> :
[...]
> So why can I remove a driver serving live network traffic?
Why not ? It is quite common to remove physically a network/storage
device.
--
Ueimor
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: network driver usage count
2007-11-21 22:16 ` Wagner Ferenc
2007-11-21 23:53 ` Francois Romieu
@ 2007-11-23 1:04 ` David Miller
2007-11-23 10:09 ` Ferenc Wagner
1 sibling, 1 reply; 6+ messages in thread
From: David Miller @ 2007-11-23 1:04 UTC (permalink / raw)
To: wferi; +Cc: shemminger, linux-kernel
From: Wagner Ferenc <wferi@niif.hu>
Date: Wed, 21 Nov 2007 23:16:59 +0100
> Hmm, that would warrant nuking all the reference counts on every
> driver.
That's not true. When packets are in flight, references go
to the device and the device cannot be unloaded until those
references get dropped.
This behavior makes sense because otherwise you have to figure
out the myriad of references (each ipv4 address, each ipv6
address, routes, ARP entries, etc.) just to perform such a
simple operation.
If you do not mean to unload the device, simply do not do it.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: network driver usage count
2007-11-23 1:04 ` David Miller
@ 2007-11-23 10:09 ` Ferenc Wagner
0 siblings, 0 replies; 6+ messages in thread
From: Ferenc Wagner @ 2007-11-23 10:09 UTC (permalink / raw)
To: David Miller; +Cc: shemminger, linux-kernel
David Miller <davem@davemloft.net> writes:
> From: Wagner Ferenc <wferi@niif.hu>
> Date: Wed, 21 Nov 2007 23:16:59 +0100
>
>> Hmm, that would warrant nuking all the reference counts on every
>> driver.
>
> That's not true. When packets are in flight, references go
> to the device and the device cannot be unloaded until those
> references get dropped.
I'm trying to understand it. Do you mean that the "usage count" in
the lsmod output does not express the user's view of a piece of *ware
being in use, but rather the number of internal kernel references to
it, which would become invalid should that piece disappear? Where the
former "invalidily" means some undetectable and uncorrectable
inconsistency in the kernel data structures, which leads to a kernel
crash.
> This behavior makes sense because otherwise you have to figure
> out the myriad of references (each ipv4 address, each ipv6
> address, routes, ARP entries, etc.) just to perform such a
> simple operation.
Yes, that's the user's idea of a network device being in use. It can
get hairy indeed.
> If you do not mean to unload the device, simply do not do it.
Now I know...
--
Thanks for taking the time,
Feri.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2007-11-23 10:11 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-11-21 19:45 network driver usage count Ferenc Wagner
2007-11-21 21:04 ` Stephen Hemminger
2007-11-21 22:16 ` Wagner Ferenc
2007-11-21 23:53 ` Francois Romieu
2007-11-23 1:04 ` David Miller
2007-11-23 10:09 ` Ferenc Wagner
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®