From: Vlad Yasevich <vyasevic@redhat.com>
To: Eric Dumazet <eric.dumazet@gmail.com>
Cc: netdev@vger.kernel.org, dingtianhong@huawei.com, kaber@trash.net,
vfalico@gmail.com, jiri@resnulli.us
Subject: Re: [PATCH v2 1/4] net: Find the nesting level of a given device by type.
Date: Fri, 16 May 2014 14:34:21 -0400 [thread overview]
Message-ID: <53765A2D.8050205@redhat.com> (raw)
In-Reply-To: <1400261568.7973.225.camel@edumazet-glaptop2.roam.corp.google.com>
On 05/16/2014 01:32 PM, Eric Dumazet wrote:
> On Fri, 2014-05-16 at 13:18 -0400, Vlad Yasevich wrote:
>> Multiple devices in the kernel can be stacked/nested and they
>> need to know their nesting level for the purposes of lockdep.
>> This patch provides a generic function that determines a nesting
>> level of a particular device by its type (ex: vlan, macvlan, etc).
>> We only care about nesting of the same type of devices.
>>
>> For example:
>> eth0 <- vlan0.10 <- macvlan0 <- vlan1.20
>>
>> The nesting level of vlan1.20 would be 1, since there is another vlan
>> in the stack under it.
>>
>> Signed-off-by: Vlad Yasevich <vyasevic@redhat.com>
>> ---
>> include/linux/netdevice.h | 10 ++++++++++
>> net/core/dev.c | 48 +++++++++++++++++++++++++++++++++++++++++++++++
>> 2 files changed, 58 insertions(+)
>
> Nice, but if LOCKDEP is not used, do we really want to have
> dev_get_nest_level() being something else than a constant ?
>
>
Doesn't seem to hurt. As it stands right now, vlan code will
keep calculating its own every time it needs to take a lock
and it will be other then 1 when you have a stack of them.
-vlad
next prev parent reply other threads:[~2014-05-16 18:49 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-16 17:18 [PATCH v2 0/4] Fix lockdep issues with stacked devices Vlad Yasevich
2014-05-16 17:18 ` [PATCH v2 1/4] net: Find the nesting level of a given device by type Vlad Yasevich
2014-05-16 17:32 ` Eric Dumazet
2014-05-16 18:34 ` Vlad Yasevich [this message]
2014-05-16 17:18 ` [PATCH v2 2/4] net: Allow for more then a single subclass for netif_addr_lock Vlad Yasevich
2014-05-16 17:18 ` [PATCH v2 3/4] vlan: Fix lockdep warning with stacked vlan devices Vlad Yasevich
2014-05-16 17:18 ` [PATCH v2 4/4] macvlan: Fix lockdep warnings with stacked macvlan devices Vlad Yasevich
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=53765A2D.8050205@redhat.com \
--to=vyasevic@redhat.com \
--cc=dingtianhong@huawei.com \
--cc=eric.dumazet@gmail.com \
--cc=jiri@resnulli.us \
--cc=kaber@trash.net \
--cc=netdev@vger.kernel.org \
--cc=vfalico@gmail.com \
/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 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).