Go to main content

Oracle® VM Server for SPARC 3.6 Administration Guide

Exit Print View

Updated: September 2019
 
 

Creating Ethernet Virtual Functions

This section describes how to dynamically create and destroy virtual functions. If you cannot use the dynamic methods to perform these actions, initiate a delayed reconfiguration on the root domain before you create or destroy virtual functions.

How to Create an Ethernet SR-IOV Virtual Function

If you cannot use this dynamic method, use the static method instead. See Static SR-IOV.

  1. Identify the physical function device.
    primary# ldm list-io

    Note that the name of the physical function includes the location information for the PCIe SR-IOV card or on-board device.

  2. If I/O virtualization for the bus that has the physical function is not enabled already, enable it.

    Perform this step only if I/O virtualization is not enabled already for the bus that has the physical function.

    See How to Enable I/O Virtualization for a PCIe Bus.

  3. Create a single virtual function or multiple virtual functions from an Ethernet physical function either dynamically or statically.

    After you create one or more virtual functions, you can assign them to a guest domain.

    • Dynamic method:
      • To create multiple virtual functions from a physical function all at the same time, use the following command:
        primary# ldm create-vf -n number | max [name=user-assigned-name] pf-name

        Use the ldm create-vf -n max command to create all the virtual functions for that physical function at one time. You can use the name property to optionally specify a name for the virtual function.


        Caution

        Caution  - When your system uses an Intel 10-Gbit Ethernet card, maximize performance by creating no more than 31 virtual functions from each physical function.


        You can use either the path name or the pseudonym name to specify virtual functions. However, the recommended practice is to use the pseudonym name.

      • To create one virtual function from a physical function, use the following command:
        ldm create-vf [mac-addr=num] [alt-mac-addrs=[auto|num1,[auto|num2,...]]]
          [pvid=pvid] [vid=vid1,vid2,...] [mtu=size] [name=value...] pf-name

        Note - If not explicitly assigned, the MAC address is automatically allocated for network devices.

        Use this command to create one virtual function for that physical function. You can also manually specify Ethernet class-specific property values.


      Note - Sometimes a newly created virtual function is not available for immediate use while the OS probes for IOV devices. Use the ldm list-io command to determine whether the parent physical function and its child virtual functions have the INV value in the Status column. If they have this value, wait until the ldm list-io output no longer shows the INV value in the Status column (about 45 seconds) before you use that physical function or any of its child virtual functions. If this status persists, there is a problem with the device.

      A device status might be INV immediately following a root domain reboot (including that of the primary) or immediately after you use the ldm create-vf or ldm destroy-vf command.


    • Static method:
      1. Initiate a delayed reconfiguration.
        primary# ldm start-reconf root-domain-name
      2. Create a single virtual function or multiple virtual functions from an Ethernet physical function.

        Use the same commands as shown previously to dynamically create the virtual functions.

      3. Reboot the root domain.
        • To reboot the non-primary root domain:
          primary# ldm stop-domain -r root-domain
        • To reboot the primary root domain:
          primary# shutdown -i6 -g0 -y
Example 5  Displaying Information About the Ethernet Physical Function

This example shows information about the /SYS/MB/NET0/IOVNET.PF0 physical function:

  • This physical function is from an on-board NET0 network device.

  • The IOVNET string indicates that the physical function is a network SR-IOV device.

primary# ldm list-io
/SYS/PM0/CMP0/NIU_CORE                    NIU    niu_0    primary
/SYS/PM0/CMP1/NIU_CORE                    NIU    niu_1    primary
/SYS/PM0/CMP0/PEX                         BUS    pci_0    primary  IOV
/SYS/PM0/CMP1/PEX                         BUS    pci_1
/SYS/MB/PCIE0                             PCIE   pci_0    primary  OCC      
/SYS/MB/PCIE2                             PCIE   pci_0    primary  OCC      
/SYS/MB/PCIE4                             PCIE   pci_0    primary  OCC      
/SYS/MB/PCIE6                             PCIE   pci_0    primary  EMP      
/SYS/MB/PCIE8                             PCIE   pci_0    primary  EMP      
/SYS/MB/SASHBA                            PCIE   pci_0    primary  OCC      
/SYS/MB/NET0                              PCIE   pci_0    primary  OCC      
/SYS/MB/PCIE1                             PCIE   pci_1    primary  OCC      
/SYS/MB/PCIE3                             PCIE   pci_1    primary  OCC      
/SYS/MB/PCIE5                             PCIE   pci_1    primary  OCC      
/SYS/MB/PCIE7                             PCIE   pci_1    primary  EMP      
/SYS/MB/PCIE9                             PCIE   pci_1    primary  EMP      
/SYS/MB/NET2                              PCIE   pci_1    primary  OCC      
/SYS/MB/NET0/IOVNET.PF0                   PF     pci_0    primary
/SYS/MB/NET0/IOVNET.PF1                   PF     pci_0    primary
/SYS/MB/PCIE5/IOVNET.PF0                  PF     pci_1    primary
/SYS/MB/PCIE5/IOVNET.PF1                  PF     pci_1    primary
/SYS/MB/NET2/IOVNET.PF0                   PF     pci_1    primary
/SYS/MB/NET2/IOVNET.PF1                   PF     pci_1    primary

The following command shows more details about the specified physical function. The maxvfs value indicates the maximum number of virtual functions that is supported by the device.

primary# ldm list-io -l /SYS/MB/NET0/IOVNET.PF0
NAME                                      TYPE   BUS      DOMAIN   STATUS   
----                                      ----   ---      ------   ------   
/SYS/MB/NET0/IOVNET.PF0                   PF     pci_0    primary           
[pci@400/pci@1/pci@0/pci@4/network@0]
    maxvfs = 7
Example 6  Dynamically Creating an Ethernet Virtual Function Without Setting Optional Properties

This example dynamically creates a virtual function without setting any optional properties. In this case, the MAC address for a network class virtual function is automatically allocated.

Ensure that I/O virtualization is enabled on the pci_0 PCIe bus. See How to Enable I/O Virtualization for a PCIe Bus.

Now, you can use the ldm create-vf command to create the virtual function from the /SYS/MB/NET0/IOVNET.PF0 physical function.

primary# ldm create-vf /SYS/MB/NET0/IOVNET.PF0
Created new vf: /SYS/MB/NET0/IOVNET.PF0.VF0
Example 7  Dynamically Creating an Ethernet Virtual Function and Setting Properties

This example dynamically creates a virtual function while setting the mac-addr property to 00:14:2f:f9:14:c0 and the vid property to VLAN IDs 2 and 3.

primary# ldm create-vf mac-addr=00:14:2f:f9:14:c0 vid=2,3 /SYS/MB/NET0/IOVNET.PF0
Example 8  Dynamically Creating an Ethernet Virtual Function With Two Alternate MAC Addresses

This example dynamically creates a virtual function that has two alternate MAC addresses. One MAC address is automatically allocated, and the other is explicitly specified as 00:14:2f:f9:14:c2.

primary# ldm create-vf alt-mac-addrs=auto,00:14:2f:f9:14:c2 /SYS/MB/NET0/IOVNET.PF0
Example 9  Statically Creating a Virtual Function Without Setting Optional Properties

This example statically creates a virtual function without setting any optional properties. In this case, the MAC address for a network class virtual function is automatically allocated.

First you initiate a delayed reconfiguration on the primary domain and then enable I/O virtualization on the pci_0 PCIe bus. Because the pci_0 bus has already been assigned to the primary root domain, use the ldm set-io command to enable I/O virtualization.

primary# ldm start-reconf primary
Initiating a delayed reconfiguration operation on the primary domain.
All configuration changes for other domains are disabled until the primary
domain reboots, at which time the new configuration for the primary domain
will also take effect.

primary# ldm set-io iov=on pci_0

Now, you can use the ldm create-vf command to create the virtual function from the /SYS/MB/NET0/IOVNET.PF0 physical function.

primary# ldm create-vf /SYS/MB/NET0/IOVNET.PF0

------------------------------------------------------------------------------
Notice: The primary domain is in the process of a delayed reconfiguration.
Any changes made to the primary domain will only take effect after it reboots.
------------------------------------------------------------------------------

Created new vf: /SYS/MB/NET0/IOVNET.PF0.VF0

Finally, reboot the primary root domain to make the changes take effect.

primary# shutdown -i6 -g0 -y
Example 10  Creating Multiple SR-IOV Ethernet Virtual Functions

    The following examples show ways in which you can create multiple SR-IOV Ethernet virtual functions:

  • The following command shows how you can create 8 virtual functions from the /SYS/MB/NET2/IOVNET.PF1 physical function and specify name of new_vf for the virtual function:

    primary# ldm create-vf -n 8 name=new_vf /SYS/MB/NET2/IOVNET.PF1
    Created new vf: /SYS/MB/NET2/IOVNET.PF1.VF0
    Created new vf: /SYS/MB/NET2/IOVNET.PF1.VF1
    Created new vf: /SYS/MB/NET2/IOVNET.PF1.VF2
    ...
    Created new vf: /SYS/MB/NET2/IOVNET.PF1.VF7

    Note that the ldm create-vf -n command creates multiple virtual functions that are set with default property values, if appropriate. You can later specify non-default property values by using the ldm set-io command.

    The name you specify as the value of the name property is used as a base name for the generated virtual function names. The ldm list-io command shows the virtual function name you specified:

    primary# ldm list-io /SYS/MB/NET2/IOVNET.PF1
    NAME                                       TYPE   BUS      DOMAIN    STATUS
    ----                                       ----   ---      ------    ------
    /SYS/MB/NET2/IOVNET.PF1                    PF     pci_1    ldg1     
    /SYS/MB/NET2/IOVNET.PF1.VF0                VF     pci_1             
    Assigned-Name: new_vf.0
    /SYS/MB/NET2/IOVNET.PF1.VF1                VF     pci_1             
    Assigned-Name: new_vf.1
    /SYS/MB/NET2/IOVNET.PF1.VF2                VF     pci_1             
    Assigned-Name: new_vf.2
    ...
    /SYS/MB/NET2/IOVNET.PF1.VF7                VF     pci_1             
    Assigned-Name: new_vf.7
  • The following command shows how you can create 8 virtual functions from the /SYS/MB/NET2/IOVNET.PF1 physical function:

    primary# ldm create-vf -n 8 /SYS/MB/NET2/IOVNET.PF1
    Created new vf: /SYS/MB/NET2/IOVNET.PF1.VF0
    Created new vf: /SYS/MB/NET2/IOVNET.PF1.VF1
    Created new vf: /SYS/MB/NET2/IOVNET.PF1.VF2
    ...
    Created new vf: /SYS/MB/NET2/IOVNET.PF1.VF7

    Note that the ldm create-vf -n command creates multiple virtual functions that are set with default property values, if appropriate. You can later specify non-default property values by using the ldm set-io command.