SR-IOV: "failed to free a virtual function" on HyperV, Event 12587

evan221 96 Reputation points
2021-01-07T19:40:33.94+00:00

Trying to troubleshoot SR-IOV using a i350-T2 adapter.

SR-IOV and IOMMU enabled in BIOS
SR-IOV enabled on the Intel adapter
SR-IOV enabled when creating a new HyperV vSwitch
SR-IOV enabled in hardware acceleration of the virtual NIC settings of the guest
Troubleshooting via PowerShell seems to indicate for all intensive purposes that it should work; I was following this guide here starting at page 51: http://www.oldding.net/wp-content/uploads/2014/01/Optimizing-and-Troubleshooting-Hyper-V-Networking....

Some screenshots taken from the output during the troubleshooting steps:

  1. Output when checking the adapter itself:
    54561-screenshot-1.png
  2. Output when looking at the virtual switch:
    54419-screenshot-2.png
  3. And lastly, possibly most troubling, the output when checking the host for support:
    54485-screenshot-3.png

The guide I linked above indicates that a healthy system should output "{OK}" when running (Get-VMHost).IovSupportReasons, however my system returns nothing... The alternative suggested in the guide above is an error code though, so am hoping that no output returned means no errors... I should mention the guide was written for 2012R2 whereas I am running 2019.

Lastly, the event log when I try to start my VM:

Event ID 12587

'TD-DC2' Network Adapter (9791012B-79ED-494E-9762-928F91799821--D2CF0919-8746-4531-9DA1-FB15CB562983) failed to free a virtual function: One or more arguments are invalid (0x80070057) (Virtual Function ID 0 Virtual Machine ID 9791012B-79ED-494E-9762-928F91799821)

Yet, going up, you can clearly see 6 VFs available on the adapter, and on the vSwitch.

SR-IOV is obviously not working in the guest, as you can see in 'Networking', a status of "Degraded (SR-IOV not operational)" , along with the synthetic "HyperV Virtual Network Adapter".

Any advice on this would be appreciated.

Hyper-V
Hyper-V
A Windows technology providing a hypervisor-based virtualization solution enabling customers to consolidate workloads onto a single server.
2,734 questions
0 comments No comments
{count} votes

Accepted answer
  1. evan221 96 Reputation points
    2021-01-08T17:40:18.15+00:00

    Thank for you the reply. I was able to resolve this last night, after contacting my motherboard manufacturer - there had been a BIOS update released, literally just days prior, which after updating, allowed SR-IOV to work. I did not have to change anything in my configuration. For the record both the host and the guest are Server 2019 though.

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Mico Mi 1,926 Reputation points
    2021-01-08T07:03:49.033+00:00

    Hi,
    Please tell me what is the OS of your host and VM.
    Have you read this doc before:
    https://learn.microsoft.com/zh-cn/archive/blogs/jhoward/everything-you-wanted-to-know-about-sr-iov-in-hyper-v-part-8
    I noticed on a well configured machine, IovSupportReasons has a single value in the array, “OK”.
    54825-image.png
    Please run Get-VMNetworkAdapter against a running VMs network adapter and check the value of Status and StatusDescription. On a “good” machine, the value of IovUsage is 1.
    There are slightly more subtle ones, those around when port policies have been applied. So we need to look at the policies which have been applied.
    54826-image.png
    "There is one other thing that is definitely worth checking. Some BIOS’s have more than one firmware setting to enable SR-IOV. If in doubt, always go back to your system manufacturers documentation to make sure you have the settings configured correctly. And remember, if you do change BIOS settings, you may need to hard power cycle the machine, not just a soft restart. "
    Also I see in some instances, after they removed the adapter with problems, everything is ok.
    I hope these could give you some help.

    Thanks for your time!
    Best Regards,
    Mico Mi

    -----------------------------

    If the Answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.