• Jiri Pirko's avatar
    netdevsim: register couple of devlink params · 150e8f8a
    Jiri Pirko authored
    Register couple of devlink params, one generic, one driver-specific.
    Make the values available over debugfs.
    
    Example:
    $ echo "111" > /sys/bus/netdevsim/new_device
    $ devlink dev param
    netdevsim/netdevsim111:
      name max_macs type generic
        values:
          cmode driverinit value 32
      name test1 type driver-specific
        values:
          cmode driverinit value true
    $ cat /sys/kernel/debug/netdevsim/netdevsim111/max_macs
    32
    $ cat /sys/kernel/debug/netdevsim/netdevsim111/test1
    Y
    $ devlink dev param set netdevsim/netdevsim111 name max_macs cmode driverinit value 16
    $ devlink dev param set netdevsim/netdevsim111 name test1 cmode driverinit value false
    $ devlink dev reload netdevsim/netdevsim111
    $ cat /sys/kernel/debug/netdevsim/netdevsim111/max_macs
    16
    $ cat /sys/kernel/debug/netdevsim/netdevsim111/test1
    Signed-off-by: default avatarJiri Pirko <jiri@mellanox.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    150e8f8a
netdevsim.h 5.32 KB