• Jiri Pirko's avatar
    net: devlink: track netdev with devlink_port assigned · 02a68a47
    Jiri Pirko authored
    Currently, ethernet drivers are using devlink_port_type_eth_set() and
    devlink_port_type_clear() to set devlink port type and link to related
    netdev.
    
    Instead of calling them directly, let the driver use
    SET_NETDEV_DEVLINK_PORT macro to assign devlink_port pointer and let
    devlink to track it. Note the devlink port pointer is static during
    the time netdevice is registered.
    
    In devlink code, use per-namespace netdev notifier to track
    the netdevices with devlink_port assigned and change the internal
    devlink_port type and related type pointer accordingly.
    Signed-off-by: default avatarJiri Pirko <jiri@nvidia.com>
    Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
    02a68a47
devlink.c 329 KB