netdevsim: Add max_vfs to bus_dev
authorDmytro Linkin <dlinkin@nvidia.com>
Wed, 2 Jun 2021 12:17:14 +0000 (15:17 +0300)
committerDavid S. Miller <davem@davemloft.net>
Wed, 2 Jun 2021 21:08:36 +0000 (14:08 -0700)
commitd395381909a32060927e3f90116f938379be0636
tree693d5f1bd08df85caa8d90614c3857579a7b6345
parent53c7bb553056d3a6713ea413576c6d1b0c3f0f61
netdevsim: Add max_vfs to bus_dev

Currently there is no limit to the number of VFs netdevsim can enable.
In a real systems this value exist and used by the driver.
Fore example, some features might need to consider this value when
allocating memory.

Expose max_vfs variable to debugfs as configurable resource. If are VFs
configured (num_vfs != 0) then changing of max_vfs not allowed.

Co-developed-by: Yuval Avnery <yuvalav@nvidia.com>
Signed-off-by: Yuval Avnery <yuvalav@nvidia.com>
Signed-off-by: Dmytro Linkin <dlinkin@nvidia.com>
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/netdevsim/bus.c
drivers/net/netdevsim/dev.c
drivers/net/netdevsim/netdevsim.h