• Jiri Pirko's avatar
    net: devlink: add port_init/fini() helpers to allow pre-register/post-unregister functions · ae3bbc04
    Jiri Pirko authored
    Lifetime of some of the devlink objects, like regions, is currently
    forced to be different for devlink instance and devlink port instance
    (per-port regions). The reason is that for devlink ports, the internal
    structures initialization happens only after devlink_port_register() is
    called.
    
    To resolve this inconsistency, introduce new set of helpers to allow
    driver to initialize devlink pointer and region list before
    devlink_register() is called. That allows port regions to be created
    before devlink port registration and destroyed after devlink
    port unregistration.
    Signed-off-by: default avatarJiri Pirko <jiri@nvidia.com>
    Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
    ae3bbc04
devlink.c 326 KB