• Jiri Pirko's avatar
    netdevsim: change fib accounting and limitations to be per-device · a5facc4c
    Jiri Pirko authored
    Currently, the accounting is done per-namespace. However, devlink
    instance is always in init_net namespace for now, so only the accounting
    related to init_net is used. Limitations set using devlink resources
    are only considered for init_net. nsim_devlink_net() always
    returns init_net always.
    
    Make the accounting per-device. This brings no functional change.
    Per-device accounting has the same values as per-net.
    For a single netdevsim instance, the behaviour is exactly the same
    as before. When multiple netdevsim instances are created, each
    can have different limits.
    
    This is in prepare to implement proper devlink netns support. After
    that, the devlink instance which would exist in particular netns would
    account and limit that netns.
    Signed-off-by: default avatarJiri Pirko <jiri@mellanox.com>
    Acked-by: default avatarJakub Kicinski <jakub.kicinski@netronome.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    a5facc4c
netdevsim.h 5.43 KB