• Vlad Yasevich's avatar
    net: Find the nesting level of a given device by type. · 4085ebe8
    Vlad Yasevich authored
    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: default avatarVlad Yasevich <vyasevic@redhat.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    4085ebe8
dev.c 177 KB