After some research on Intel SR-IOV, I've realized that there is no convenient way to get the VF counters while VF interface is being attached to a VM (for example to a QEMU/KVM VM with a Libvirt manager). Furthermore, I didn't find even an inconvenient way to do it, because as soon as VM is being created on a HOST and it is bound in configuration to some VF interface(this is the main use case of SRI-OV VFs), the interface is automatically being detached from the HOST and attached to the VM (I think that it is done on purpose in order to allow passthrough to bypass the kernel or something), and there is actually no way that I found yet to find the counters of the VF used by the attached VM on the HOST(I'm using Ubuntu 16.04 and I've tried looking for counters on VF ports, with ethtool -S on the PF interface but with no avail), those counters may be actually very helpful in various situations. It would be really helpful if someone who has some experience in dealing with SRIOV could shade some light on this issue and tell me I'm wrong and that there is a simple way.

Update:. Actually I found that ethtool -S might be useful, it let you see the TX/RX queue counters of the nic, and I found that VF function driver ixgbevf uses exactly one different pair of TX/RX queues for each VF. And they are being assigned in increasing order, so it might be possible to do a mapping. But unfortunately it's an ugly and driver dependent solution.

  • Why people downvote posts without any explanation.. – Evgeny A. Dec 7 '16 at 11:58
  • They don't know the words you'e using :) – BaronSamedi1958 Dec 8 '16 at 14:12

Unfortunately you're not wrong, the whole idea of SR-IOV is that it allows the VM to interact directly with the NIC without the hypervisor or host in the middle. It isn't seeing the packets to generate counters,you won't get anything using ethtool or the normal ways. You maybe able to get something from the root of the NIC but it depends on the drivers your using etc.

  • 2
    Yes that's what I thought.. I'm using 82599 Intel nic, that uses ixgbe driver for PF and ixgbevf for VF. I saw the driver implementation in C++ and I saw that metrics are being collected in ixgbevf but are not reported. – Evgeny A. Dec 7 '16 at 11:57
  • 1
    I've added a possible temporary workaround. – Evgeny A. Dec 7 '16 at 17:31
  • Did you compare PCI pass thru Vs SR-IOV performance? – BaronSamedi1958 Dec 8 '16 at 14:12
  • Actually SR-IOV uses pass-through for each mapping between Virtual Function and a VM(Guest). – Evgeny A. Dec 8 '16 at 14:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.