• Jiri Pirko's avatar
    devlink: expose peer SF devlink instance · 0b7a2721
    Jiri Pirko authored
    Introduce a new helper devl_port_fn_devlink_set() to be used by driver
    assigning a devlink instance to the peer devlink port function.
    
    Expose this to user over new netlink attribute nested under port
    function nest to expose devlink handle related to the port function.
    
    This is particularly helpful for user to understand the relationship
    between devlink instances created for SFs and the port functions
    they belong to.
    
    Note that caller of devlink_port_notify() needs to hold devlink
    instance lock, put the assertion to devl_port_fn_devlink_set() to make
    this requirement explicit. Also note the limitations that only allow to
    make this assignment for registered objects.
    Signed-off-by: default avatarJiri Pirko <jiri@nvidia.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    0b7a2721
port.c 43.6 KB