Managing Network Virtualization and Network Resources in Oracle® Solaris 11.2

Exit Print View

Updated: September 2014
 
 

Configuring Clients and Allocating Rings

This section describes how to configure clients on a datalink based on the type of support for ring allocation.

How to Configure Clients and Allocate Rings

Make sure that you can interpret the output of the dladm commands that display datalink ring properties, as explained in Commands for Configuring Rings. This information helps you to configure clients and allocate rings.

  1. Become an administrator.

    For more information, see Using Your Assigned Administrative Rights in Securing Users and Processes in Oracle Solaris 11.2 .

  2. Display the underlying physical datalink's properties.
    # dladm show-linkprop -p rxringsavail,txringsavail,rxhwclntavail,txhwclntavail link

    Determine the following information from the output of the command:

    • Whether the NIC supports hardware-based clients

    • The availability of rings to allocate to hardware-based clients

    • The availability of hardware-based clients that you can configure on the link

  3. Depending on the information from the previous step, perform one of the following:
    • Create the hardware-based client with the following syntax:
      # dladm create-vnic -p rxrings=value[,txrings=value] -l link VNIC

      where value can be one of the following:

      • hw - Indicates that you are configuring a hardware-based client.

      • number - Indicates that you are configuring a hardware-based client only. The number refers to the quantity of rings that you can allocate to the client for its exclusive use.

    • Create the software-based client with the following syntax:
      # dladm create-vnic -p rxrings=sw[,txrings=sw] -l link VNIC

    Alternatively, if the client was previously created, you can use the dladm set-linkprop command to set the ring properties.

  4. (Optional) Verify the ring information of the client that you created.
    # dladm show-linkprop -p rxrings,txrings VNIC
  5. (Optional) Verify the link's rings that are distributed among different clients.
    # dladm show-phys -H link
Example 7-2  Configuring Clients and Allocating Rings on the nxge Device

This example is based on the nxge device and shows how to configure clients and allocate rings on the datalink net5. This example shows how to create the following clients:

  • The VNIC vnic2, which is a hardware-based client with exclusive use of Rx and Tx rings.

  • The VNIC vnic3, which is a hardware-based client with a fixed number of rings that are set according to the NIC driver's initial configuration.

  • The VNIC vnic4, which is a software-based client.

  1. Check whether the physical datalink net5 supports ring allocation for clients.

    # dladm show-linkprop -p rxringsavail,txringsavail net5
    LINK     PROPERTY        PERM  VALUE     EFFECTIVE   DEFAULT   POSSIBLE
    net5     rxringsavail    r-    7         7           --        --
    net5     txringsavail    r-    11        11          --        --

    The output shows that the physical datalink net5 has 7 Rx rings and 11 Tx rings that you can assign to the clients over the physical datalink net5.

  2. Check the availability of hardware-based clients that you can create over the physical datalink net5.

    # dladm show-linkprop -p rxhwclntavail,txhwclntavail net5 
    LINK     PROPERTY        PERM  VALUE    EFFECTIVE   DEFAULT   POSSIBLE
    net5     rxhwclntavail   r-    3        3           --        --
    net5     txhwclntavail   r-    4        4           --        -- 

    The output shows that you can create 3 hardware-based Rx clients and 4 hardware-based Tx clients over the datalink net5.

  3. Check the existing ring usage over the physical datalink net5.

    # dladm show-phys -H net5
    LINK     RINGTYPE    RINGS     CLIENTS 
    nxge1    RX          0-7       <default,mcast>
    nxge1    TX          0-11      <default>
    

    The output shows that the nxge1 device has eight Rx rings (0-7) and twelve Tx rings (0-11). Because no datalinks are on the nxge1 device, the Rx rings and Tx rings are not assigned to any datalinks. The value <default> in the CLIENTS column means that the Tx rings will be used by the software-based clients. The value <default,mcast> under the CLIENTS column means that the Rx rings will be used by the software-based clients and non-unicast packets.

  4. Create the VNIC vnic2 over the datalink net5 with two Rx rings and two Tx rings.

    # dladm create-vnic -l net5 -p rxrings=2,txrings=2 vnic2
  5. Verify the rings that are assigned to the VNIC vnic2.

    # dladm show-linkprop -p rxrings,txrings vnic2
    LINK     PROPERTY     PERM   VALUE    EFFECTIVE    DEFAULT   POSSIBLE
    vnic2    rxrings      rw     2        2            --        sw,hw,<1-7>
    vnic2    txrings      rw     2        2            --        sw,hw,<1-11>
  6. Verify the ring usage on the physical datalink net5.

    # dladm show-phys -H net5
    LINK     RINGTYPE     RINGS      CLIENTS
    nxge1    RX           0,3-7      <default,mcast>
    nxge1    TX           0,3-11     <default>
    nxge1    RX           1-2        vnic2
    nxge1    TX           1-2        vnic2

    The output shows that the Rx rings allocated to vnic2 are 1 and 2. For Tx rings, vnic2 uses the rings 1 and 2.

  7. Check whether you can create additional hardware-based clients over the physical datalink net5.

    # dladm show-linkprop -p rxhwclntavail,txhwclntavail net5
    LINK     PROPERTY        PERM  VALUE     EFFECTIVE   DEFAULT   POSSIBLE
    net5     rxhwclntavail   r-    2         2           --        --
    net5     txhwclntavail   r-    3         3           --        --
    

    The output shows that you can create two hardware-based Rx clients and three hardware-based Tx clients over the physical datalink net5.

  8. Create the VNIC vnic3, which is a hardware-based client.

    # dladm create-vnic -l net5 -p rxrings=hw,txrings=hw vnic3
  9. Verify the rings that are assigned to the VNIC vnic3.

    # dladm show-linkprop -p rxrings,txrings vnic3
    LINK     PROPERTY     PERM    VALUE   EFFECTIVE    DEFAULT   POSSIBLE
    vnic3    rxrings      rw      --      1            --        sw,hw,<1-7>
    vnic3    txrings      rw      hw      hw           --        sw,hw,<-11>

    Note -  The number of rings that are assigned to a client depends on the network device. One ring is assigned to a client on the device that enables you to explicitly specify the number of rings, for example, the nxge device. For other devices, the number of rings assigned to a client depends on how the device is configured. See Example 7–3.
  10. Check whether you can create additional hardware-based clients over the physical datalink net5.

    # dladm show-linkprop -p rxhwclntavail,txhwclntavail net5
    LINK     PROPERTY        PERM   VALUE   EFFECTIVE  DEFAULT   POSSIBLE
    net5     rxhwclntavail   r-     2       2          --        --
    net5     txhwclntavail   r-     2       2          --        -- 

    The output shows that you can create 2 hardware-based Rx clients and 2 hardware-based Tx clients over the physical datalink net5.

  11. Create the VNIC vnic4, which is a software-based client.

    # dladm create-vnic -l net5 -p rxrings=sw,txrings=sw vnic4
  12. Verify the ring usage on vnic4.

    # dladm show-linkprop -p rxrings,txrings vnic4
    LINK     PROPERTY     PERM   VALUE    EFFECTIVE   DEFAULT   POSSIBLE 
    vnic4    rxrings      rw     sw       --          --        sw,hw,<1-7>   
    vnic4    txrings      rw     sw       --          --        sw,hw,<1-11>
  13. Verify the ring usage on the physical datalink net5.

    # dladm show-phys -H net5
    LINK     RINGTYPE    RINGS       CLIENTS
    nxge1    RX          0,4-7       <default,mcast>,vnic4
    nxge1    TX          0,4-11      <default>,vnic4
    nxge1    RX          1-2         vnic2
    nxge1    RX          3           vnic3
    nxge1    TX          1-2         vnic2
    nxge1    TX          3           vnic3

    The output shows that vnic4 is software-based client that shares the default set of rings on the physical datalink net5. The VNIC vnic2 is a hardware-based client that has exclusive use of two rings (2-3) and vnic3 is a hardware-based client that has exclusive use of one ring (3).

Example 7-3  Configuring Clients and Allocating Rings on the ixgbe Device

This example is based on the ixgbe device and shows how to configure clients and allocate rings on the physical datalink net4.

  1. Check the existing ring usage over the physical datalink net4.

    # dladm show-phys -H net4
    LINK      RINGTYPE    RINGS     CLIENTS 
    net4      RX          0-3       <default,mcast>
    net4      RX          4-7       --
    net4      RX          8-11      -- 
    net4      RX          12-15     --
    net4      TX          0-7       <default>
  2. Check whether you can create hardware-based clients over the physical datalink net4.

    # dladm show-linkprop -p rxhwclntavail,txhwclntavail,rxringsavail,txringsavail net4
    LINK     PROPERTY        PERM   VALUE   EFFECTIVE  DEFAULT   POSSIBLE
    net4     rxhwclntavail   r-     3       3          --        --
    net4     txhwclntavail   r-     0       0          --        --
    net4     rxringsavail    r-     0       0          --        -- 
    net4     txringsavail    r-     0       0          --        -- 

    The output shows that you can create 3 hardware-based Rx clients over the physical datalink net4.

  3. Create the VNIC vnic3, which is a hardware-based Rx client.

    # dladm create-vnic -l net4 -p rxrings=hw vnic3

    You cannot configure the txrings property for vnic3 because the available number of hardware-based Tx clients (txhwclntavail) is zero.

  4. Verify the rings that are assigned to the VNIC vnic3.

    # dladm show-linkprop -p rxrings,txrings vnic3
    LINK     PROPERTY       PERM   VALUE     EFFECTIVE  DEFAULT   POSSIBLE
    vnic3    rxrings         rw    hw        hw         --        sw,hw
    vnic3    txrings         rw    --        8          --        -- 
  5. Check whether you can create additional hardware-based clients over the physical datalink net4.

    # dladm show-linkprop -p rxhwclntavail,txhwclntavail,rxringsavail,txringsavail net5
    LINK     PROPERTY        PERM  VALUE     EFFECTIVE   DEFAULT   POSSIBLE
    net4     rxhwclntavail   r-    2         2           --        -- 
    net4     txhwclntavail   r-    0         0           --        -- 
    net4     rxringsavail    r-    0         0           --        -- 
    net4     txringsavail    r-    0         0           --        -- 
    

    The output shows that you can create 2 hardware-based Rx clients over the physical datalink net4.

  6. Verify the ring usage on the physical datalink net4.

    # dladm show-phys -H net4
    LINK      RINGTYPE    RINGS     CLIENTS 
    net4      RX          0-3       <default,mcast>
    net4      RX          4-7       vnic3 
    net4      RX          8-11       
    net4      RX          12-15     --
    net4      TX          0-7       <default>,vnic3

    The output shows that vnic3 is a hardware-based Rx client with exclusive use of four rings. For Tx rings, vnic3 uses the default set of rings and also shares the rings with other datalinks when they are created on the physical datalink net4.