• Jakub Kicinski's avatar
    netdevsim: move max vf config to dev · a3353ec3
    Jakub Kicinski authored
    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: default avatarJakub Kicinski <kuba@kernel.org>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    a3353ec3
netdevsim.h 9.02 KB