net: Find the nesting level of a given device by type.
authorVlad Yasevich <vyasevic@redhat.com>
Fri, 16 May 2014 21:04:53 +0000 (17:04 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 31 May 2014 20:20:34 +0000 (13:20 -0700)
commit69ab2a8b80f2a479df6728effb935174dd5303bf
tree6a5dd7ae2efd814be75480571ed7507fbd725cb6
parente2c7f968588cdafe7cca360acd9665e51a1165d8
net: Find the nesting level of a given device by type.

[ Upstream commit 4085ebe8c31face855fd01ee40372cb4aab1df3a ]

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>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
include/linux/netdevice.h
net/core/dev.c