netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Problem with unregister_netdevice
@ 2013-01-04 14:22 Tomas Vasko
  2013-01-04 20:52 ` David Miller
  0 siblings, 1 reply; 3+ messages in thread
From: Tomas Vasko @ 2013-01-04 14:22 UTC (permalink / raw)
  To: netdev

Hi all,

after upgrade from 3.5.7 to 3.6.x I am experiencing problem with
unregistering of network devices like:


  kernel:[ 1523.380066] unregister_netdevice: waiting for XX to become free. Usage count = YY


The XX seems to be an interface used for either ipsec transport or 
ipsec tunnel and YY seems to be number of recently active ipsec peers.
Problem occurs when multiple routing tables are used.

>From bisecting on .../git/torvalds/linux-2.6.git it seems the culprit is
this commit: 81166dd6fa8eb780b2132d32fbc77eb6ac04e44e

Steps to reproduce:

see setup-81166dd.sh script bellow, on two computers (say nodeA and nodeB)
run it with swapped arguments -- 
  on nodeA run: setup-81166dd.sh eth1 A B 
  on nodeB run: setup-81166dd.sh eth1 B A

Script assumes you are using 8139cp driver for your device, please change for
any other. I've used this one for one interface in kvm while cutting my system
down for this reproduction.

Finally on node A run:  ping6 -n fc00:B::1
and on node B run:      ping6 -n fc00:A::1 -f -c 1500 ; modprobe -r 8139cp

This usually triggers the bug immediately, sometimes more pinging or more time
(up to 2 minutes) is needed to trigger it.

Problem is present also in 3.8-rc2 although there is takes longer time to
trigger. I did not hit it on single core computer.

Please let me know if there is anything I can do to help fixing the problem.

thanks,
tomas

-------------- setup-81166dd.sh --------------
#!/bin/bash

#on node A run: $0 eth2 A B
#on node B run: $0 eth2 B A

[ $# -ne 3 ] && { echo usage: $0 dev A B; exit 1; }

dev=$1
A=$2
B=$3

modprobe 8139cp
sleep 1
ip l s $dev up
ip a a fc00:$A::1/128 dev $dev

ip -6 r a fc00::/16 dev $dev  table 2
ip -6 r a fe80::/64 dev $dev  table 2

ip -6 rule  add to fc00::/16 table 2

setkey -c  << __END__
flush;
spdflush;

add fc00:$A::1 fc00:$B::1 ah 0x2$A$B -A hmac-md5 0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa;
add fc00:$B::1 fc00:$A::1 ah 0x2$B$A -A hmac-md5 0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa;

add fc00:$A::1 fc00:$B::1 esp 0x1$A$B -E 3des-cbc 0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa;
add fc00:$B::1 fc00:$A::1 esp 0x1$B$A -E 3des-cbc 0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa;

spdadd fc00:$A::1 fc00:$B::1 any -P out ipsec
              esp/transport//require
              ah/transport//require;

spdadd fc00:$B::1 fc00:$A::1 any -P in ipsec
              esp/transport//require
              ah/transport//require;

__END__

exit 0

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Problem with unregister_netdevice
  2013-01-04 14:22 Problem with unregister_netdevice Tomas Vasko
@ 2013-01-04 20:52 ` David Miller
  2013-01-08  8:19   ` Li, Zhen-Hua
  0 siblings, 1 reply; 3+ messages in thread
From: David Miller @ 2013-01-04 20:52 UTC (permalink / raw)
  To: vasko; +Cc: netdev

From: Tomas Vasko <vasko@truth.sk>
Date: Fri, 4 Jan 2013 15:22:41 +0100

> From bisecting on .../git/torvalds/linux-2.6.git it seems the culprit is
> this commit: 81166dd6fa8eb780b2132d32fbc77eb6ac04e44e

Please quote the commit message of the commit next time when
referencing a commit, it saves us a lot of time.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Problem with unregister_netdevice
  2013-01-04 20:52 ` David Miller
@ 2013-01-08  8:19   ` Li, Zhen-Hua
  0 siblings, 0 replies; 3+ messages in thread
From: Li, Zhen-Hua @ 2013-01-08  8:19 UTC (permalink / raw)
  To: David Miller; +Cc: vasko, netdev

I also met such problem before.  The ref_cnt of the device is not
going to be 0, so it fall in dead loop in unregister_device.
At last I did not fix it, but add a max retry times to avoid it.


On Sat, Jan 5, 2013 at 4:52 AM, David Miller <davem@davemloft.net> wrote:
> From: Tomas Vasko <vasko@truth.sk>
> Date: Fri, 4 Jan 2013 15:22:41 +0100
>
>> From bisecting on .../git/torvalds/linux-2.6.git it seems the culprit is
>> this commit: 81166dd6fa8eb780b2132d32fbc77eb6ac04e44e
>
> Please quote the commit message of the commit next time when
> referencing a commit, it saves us a lot of time.
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-01-08  8:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-04 14:22 Problem with unregister_netdevice Tomas Vasko
2013-01-04 20:52 ` David Miller
2013-01-08  8:19   ` Li, Zhen-Hua

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).