On Mon, Mar 29, 2021 at 08:29:49PM -0500, Bjorn Helgaas wrote: > I think I misunderstood Greg's subdirectory comment. We already have > directories like this: Yes, IIRC, Greg's remark applies if you have to start creating directories with manual kobjects. > and aspm_ctrl_attr_group (for "link") is nicely done with static > attributes. So I think we could do something like this: > > /sys/bus/pci/devices/0000:01:00.0/ # PF directory > sriov/ # SR-IOV related stuff > vf_total_msix > vf_msix_count_BB:DD.F # includes bus/dev/fn of first VF > ... > vf_msix_count_BB:DD.F # includes bus/dev/fn of last VF It looks a bit odd that it isn't a subdirectory, but this seems reasonable. > For NVMe, a write to vf_msix_count_* would have to auto-offline the VF > before asking the PF to assign the vectors, as Jason suggests above. It is also not awful if it returns EBUSY if the admin hasn't done some device-specific offline sequence. I'm just worried adding the idea of offline here is going to open a huge can of worms in terms of defining what it means, and the very next ask will be to start all VFs in offline mode. This would be some weird overlap with the no-driver-autoprobing sysfs. We've been thinking about this alot here and there are not easy answers. mlx5 sort of has an offline concept too, but we have been modeling it in devlink, which is kind of like nvme-cli for networking. Jason