• Veaceslav Falico's avatar
    net: add netdev_adjacent->private and allow to use it · 402dae96
    Veaceslav Falico authored
    Currently, even though we can access any linked device, we can't attach
    anything to it, which is vital to properly manage them.
    
    To fix this, add a new void *private to netdev_adjacent and functions
    setting/getting it (per link), so that we can save, per example, bonding's
    slave structures there, per slave device.
    
    netdev_master_upper_dev_link_private(dev, upper_dev, private) links dev to
    upper dev and populates the neighbour link only with private.
    
    netdev_lower_dev_get_private{,_rcu}() returns the private, if found.
    
    CC: "David S. Miller" <davem@davemloft.net>
    CC: Eric Dumazet <edumazet@google.com>
    CC: Jiri Pirko <jiri@resnulli.us>
    CC: Alexander Duyck <alexander.h.duyck@intel.com>
    Signed-off-by: default avatarVeaceslav Falico <vfalico@redhat.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    402dae96
dev.c 167 KB