Re: network driver usage count

2007-11-23 Thread Ferenc Wagner
David Miller <[EMAIL PROTECTED]> writes:

> From: Wagner Ferenc <[EMAIL PROTECTED]>
> 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.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: network driver usage count

2007-11-23 Thread Ferenc Wagner
David Miller [EMAIL PROTECTED] writes:

 From: Wagner Ferenc [EMAIL PROTECTED]
 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.
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: network driver usage count

2007-11-22 Thread David Miller
From: Wagner Ferenc <[EMAIL PROTECTED]>
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.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: network driver usage count

2007-11-22 Thread David Miller
From: Wagner Ferenc [EMAIL PROTECTED]
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.
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: network driver usage count

2007-11-21 Thread Francois Romieu
Wagner Ferenc <[EMAIL PROTECTED]> :
[...]
> 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
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: network driver usage count

2007-11-21 Thread Wagner Ferenc
Stephen Hemminger <[EMAIL PROTECTED]> writes:

> On Wed, 21 Nov 2007 20:45:11 +0100
> Ferenc Wagner <[EMAIL PROTECTED]> 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.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: network driver usage count

2007-11-21 Thread Stephen Hemminger
On Wed, 21 Nov 2007 20:45:11 +0100
Ferenc Wagner <[EMAIL PROTECTED]> 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 <[EMAIL PROTECTED]>

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: network driver usage count

2007-11-21 Thread Stephen Hemminger
On Wed, 21 Nov 2007 20:45:11 +0100
Ferenc Wagner [EMAIL PROTECTED] 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 [EMAIL PROTECTED]

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: network driver usage count

2007-11-21 Thread Wagner Ferenc
Stephen Hemminger [EMAIL PROTECTED] writes:

 On Wed, 21 Nov 2007 20:45:11 +0100
 Ferenc Wagner [EMAIL PROTECTED] 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.
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: network driver usage count

2007-11-21 Thread Francois Romieu
Wagner Ferenc [EMAIL PROTECTED] :
[...]
 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
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/