]> git.baikalelectronics.ru Git - kernel.git/commit
netdevsim: move max vf config to dev
authorJakub Kicinski <kuba@kernel.org>
Sat, 30 Oct 2021 23:15:04 +0000 (16:15 -0700)
committerDavid S. Miller <davem@davemloft.net>
Mon, 1 Nov 2021 13:29:41 +0000 (13:29 +0000)
commitd45bec6241c7b023a3d1474baef3434a42c9f395
tree7fe799a651058d89bcbc661302af5b005a62b395
parent3fe50c00a37a46b3eb254e00da24e2154a012e93
netdevsim: move max vf config to dev

max_vfs is a strange little beast because the file
hangs off of nsim's debugfs, but it configures a field
in the bus device. Move it to dev.c, let's look at it
as if the device driver was imposing VF limit based
on FW info (like pci_sriov_set_totalvfs()).

Again, when moving refactor the function not to hold
the vfs lock pointlessly while parsing the input.
Wrap the access from the read side in READ_ONCE()
to appease concurrency checkers. Do not check if
return value from snprintf() is negative...

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/netdevsim/bus.c
drivers/net/netdevsim/dev.c
drivers/net/netdevsim/netdevsim.h