linux/drivers/net/netdevsim
David Ahern 7fa76d777e netdevsim: Add extack error message for devlink reload
devlink reset command can fail if a FIB resource limit is set to a value
lower than the current occupancy. Return a proper message indicating the
reason for the failure.

$ devlink resource sh netdevsim/netdevsim0
netdevsim/netdevsim0:
  name IPv4 size unlimited unit entry size_min 0 size_max unlimited size_gran 1 dpipe_tables none
    resources:
      name fib size unlimited occ 43 unit entry size_min 0 size_max unlimited size_gran 1 dpipe_tables none
      name fib-rules size unlimited occ 4 unit entry size_min 0 size_max unlimited size_gran 1 dpipe_tables none
  name IPv6 size unlimited unit entry size_min 0 size_max unlimited size_gran 1 dpipe_tables none
    resources:
      name fib size unlimited occ 54 unit entry size_min 0 size_max unlimited size_gran 1 dpipe_tables none
      name fib-rules size unlimited occ 3 unit entry size_min 0 size_max unlimited size_gran 1 dpipe_tables none

$ devlink resource set netdevsim/netdevsim0 path /IPv4/fib size 40

$ devlink dev  reload netdevsim/netdevsim0
Error: netdevsim: New size is less than current occupancy.
devlink answers: Invalid argument

Signed-off-by: David Ahern <dsahern@gmail.com>
Acked-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2018-06-05 12:32:37 -04:00
..
bpf.c netdevsim: fix overflow on the error path 2018-02-01 11:22:51 +01:00
devlink.c netdevsim: Add extack error message for devlink reload 2018-06-05 12:32:37 -04:00
fib.c netdevsim: Add extack error message for devlink reload 2018-06-05 12:32:37 -04:00
Makefile netdevsim: Add simple FIB resource controller via devlink 2018-03-29 14:10:31 -04:00
netdev.c netdevsim: Change nsim_devlink_setup to return error to caller 2018-03-31 22:22:10 -04:00
netdevsim.h netdevsim: Add extack error message for devlink reload 2018-06-05 12:32:37 -04:00