Ethernet Products
Determine ramifications of Intel® Ethernet products and technologies
4811 Discussions

How to identify the underlying VF within a VM

idata
Employee
1,335 Views

Hi Folks,

We have the following need. We expose multiple SRIOV VF's from different SRIOV NIC's into a KVM linux VM. Within the VM we want to consistently name the VF's & assign an unique functionality for each of them with a static IP. For this at the physical host level we use "ip link set addr" to set the mac address of a VF and then pass this mac address in an injected config file (injected as a disk into the VM). The VM uses the mac address to map the underlying VF's & based on that determines what functionality a particular eth within VM should have.

 

First time when a VM is brought up we setup udev persistent-net rules such that the eth interfaces have a consistent name. However we run into an issue. Whenever the underlying physical host SRIOV PF is down, ixgbevf driver within the VM cannot determine the mac address of the VF. It prints a message like "PF in reset state. Assigning new mac" & arbitarily assings a new mac to the VF. With this our unique way to identify a VF is broken within the VM & alsopersistent net rules no longer apply.

We were wondering if we can somehow pass the SRIOV VF number to the VM & if the ixgbevf driver can somehow decode the VF number so that we can match it always within the VM using the pci-coordinates of the eth interface rather than using the mac address. Question is, is this an option? Is there a way sitting within a VM to query the VF as to the underlying co-ordinates?

Thanks.

--Shyam

0 Kudos
1 Reply
Patrick_K_Intel1
Employee
477 Views

Shyam,

Thank you for using Intel Ethernet and visiting our blog.

You may want to review some documents I've created over the past few years:

/community/wired/blog/2011/01/19/come-and-get-it-sr-iov-primer-document-updated http://communities.intel.com/community/wired/blog/2011/01/19/come-and-get-it-sr-iov-primer-document-updated

/community/wired/blog/2010/06/09/announcing-the-intel-ethernet-sr-iov-toolkit-v11 http://communities.intel.com/community/wired/blog/2010/06/09/announcing-the-intel-ethernet-sr-iov-toolkit-v11

I think I understand what it is you are trying to do, however it boils down to the fact that a VF is physically part of a PF. So if your PF is down, so is your VF.

As to the other part of your question - how can a VM know about the bus characteristics of the PF. That kind of functionality is not currently in our drivers - this is by design.

One could add this capability however. Using the mailbox mechanism the VF driver could ask for such information from the PF. The SR-IOV Toolkit (link above) should provide some guidance on how to do this kind of custom messaging.

Best of luck!

- Patrick

0 Kudos
Reply