All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ding Tianhong <dingtianhong@huawei.com>
To: David Miller <davem@davemloft.net>
Cc: <ben@decadent.org.uk>, <john.r.fastabend@intel.com>,
	<kaber@trash.net>, <netdev@vger.kernel.org>,
	<f.fainelli@gmail.com>
Subject: Re: [PATCH net-next] vlan: Fix lockdep warning when vlan dev handle notification
Date: Fri, 7 Mar 2014 09:55:25 +0800	[thread overview]
Message-ID: <5319270D.4030602@huawei.com> (raw)
In-Reply-To: <20140306.145126.497070034648321818.davem@davemloft.net>

On 2014/3/7 3:51, David Miller wrote:
> From: Ding Tianhong <dingtianhong@huawei.com>
> Date: Thu, 6 Mar 2014 22:13:33 +0800
> 
>> When I open the LOCKDEP config and run these steps:
>>
>> modprobe 8021q
>> vconfig add eth2 20
>> vconfig add eth2.20 30
>> ifconfig eth2 xx.xx.xx.xx
>>
>> then the Call Trace happened:
>  ...
>> The reason is that all of the vlan dev have the same class key for dev_lock_list,
>> if we up or down the real dev, the notification will change the state for every
>> vlan dev in the vlan group, then the vlan dev will hold netif_addr_lock and the
>> real dev also hold its own netif_addr_lock together, so the warning happened.
>>
>> The best way to fix the problem is add a new class key for the vlan dev if its
>> real dev is a vlan dev too.
>>
>> Signed-off-by: Ding Tianhong <dingtianhong@huawei.com>
> 
> So what happens when one does:
> 
> vconfig add eth2 20
> vconfig add eth2.20 30
> vconfig add eth2.30 40
> ifconfig eth2 xx.xx.xx.xx
> 
> 

the old vlan list:

eth2---------------------->eth2.20-------------------->eth2.20.30 (xxx_addr_lock_key)
			(xxx_addr_lock_key)|
					    ---------->eth2.20.50 (xxx_addr_lock_key)

after this patch:

eth2---------------------->eth2.20-------------------->eth2.20.30 (xxx_addr_lock_subkey)
			(xxx_addr_lock_key)|
					    ---------->eth2.20.50 (xxx_addr_lock_subkey)


The eth2.20 will only sync mc ddress with eth2.20.30 or eth2.20.50, and
the eth2.20.30 would never sync mc with eth2.20.50, so the xxx_addr_lock_subkey
will not meet each other.

But I think if I vconfig add eth2.20.30 50, the warning would happen again, but till now
I could not find any scene that use 3 vlan id on a virtual device, so I think it is not a 
problem.

  reply	other threads:[~2014-03-07  1:55 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-06 14:13 [PATCH net-next] vlan: Fix lockdep warning when vlan dev handle notification Ding Tianhong
2014-03-06 19:51 ` David Miller
2014-03-07  1:55   ` Ding Tianhong [this message]
2014-03-07  6:49     ` David Miller
2014-03-10  2:08       ` Ding Tianhong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5319270D.4030602@huawei.com \
    --to=dingtianhong@huawei.com \
    --cc=ben@decadent.org.uk \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=john.r.fastabend@intel.com \
    --cc=kaber@trash.net \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.