Go to main content

Managing Devices in Oracle® Solaris 11.4

Exit Print View

Updated: November 2020
 
 

PCIe Hot-Plugging With the hotplug Command

You can use the hotplug command with PCI Express (PCIe) and PCI SHPC devices to manage hot-pluggable connections, which can be a connector or a port. A hotplug connector is a physical representation in the system where a component is inserted or removed. A hotplug port is a logical representation in the system device tree where the connection of a device to the system is managed.

You can use the hotplug features to take a device, including an on-board device, online or offline without physically adding or removing the device from the system.

In order to manage devices with the hotplug command, you must enable the hotplug service. Except on sun4v platforms, the service is disabled by default on most platforms. To enable the hotplug service, type the following command:

# svcadm enable svc:/system/hotplug:default

Hot Plug Command Uses

The following examples show different uses of the hotplug command:

  • Displaying all the system's PCI/PCIe hot-pluggable connectors or ports. These ports can be virtual or physical.

    # hotplug list -lv
  • Configuring or unconfiguring PCI/PCIe devices.

    • To configure a device: hotplug enable path connector

    • To unconfigure a device: hotplug disable path connector

    The following example configures an Ethernet card in a PCIe slot.

    # hotplug enable /pci0,0 pcie0
  • Attaching or detaching the device driver for a PCI device node.

    • To attach a device driver: hotplug online path port

    • To detach a device driver: hotplug offline path port

    The following example detaches the device driver for a PCI device node to take it offline.

    # hotplug offline /pci0,0/pci1 pci.0,2
  • Installing or uninstalling services that can be supported by the drivers of the device on a specific port.

    • To install a service: hotplug install path port

    • To uninstall a service: hotplug uninstall path port

    The following example installs dependent ports of an IOV physical function.

    # hotplug install /pci@400/pci@1/pci@0/pci@4 pci.0,1
  • Listing information about all connectors, ports, and their associated devices in verbose mode.

    # hotplug list -v path connection

    The following example displays IOV virtual functions that were probed after the installation operation in the example for the install command.

    # hotplug list -v /pci@400/pci@1/pci@0/pci@4 pci.0,1
    <pci.0,1>  (ONLINE)
    { IOV physical function }
    { IOV virtual function 'pci.0,81' }
    { IOV virtual function 'pci.0,83' }
    { IOV virtual function 'pci.0,85' }
    { IOV virtual function 'pci.0,87' }
    <pci.0,81>  (OFFLINE)
    ethernet@0,81
    <pci.0,83>  (OFFLINE)
    ethernet@0,83
    <pci.0,85>  (OFFLINE)
    ethernet@0,85
    <pci.0,87>  (OFFLINE)
    ethernet@0,87

Troubleshooting PCI Hot-Plug Operations

This section describes error messages that indicate problems while you are performing PCI hot-plug operations, and possible solutions.

/pci@0,0/pci10de,5d@e <pci.a,1> (MAINTENANCE)
.
.
./pci@0,0/pci108e,534a@d <pci.0,0> (MAINTENANCE-SUSPENDED)

Cause:  These messages indicate that a fault event or a maintenance operation occurred. The MAINTENANCE states mean that a device in use is not fully operational. The MAINTENANCE-SUSPENDED state means that the device is live suspended due to a maintenance operation such as the reconfiguration of a device hardware.

ERROR: hotplug service is not available.

Cause:  The hotplug service is disabled.

Solution:  Enable the hotplug service.

# svcadm enable svc:/system/hotplug:default

ERROR: there are no connections to display.
(See hotplug(8) for more information.)

Cause:  Either the system does not have any supported I/O buses or the system might have other hot-pluggable I/O devices but you need to use the cfgadm command rather than the hotplug command to manage them.

# hotplug poweroff /pci@13c/pci@1/SYS/RCSA/PCIE11
ERROR: devices or resources are busy.

Cause:  You are attempting to offline a port with dependent devices that are currently in use by the system might fail.

Solution:  Retry to offline the port using the hotplug poweroff command after two minutes until the active holds are released.

# hotplug uninstall /pci@400/pci@1/pci@0/pci@4 pci.0,0
ERROR: devices or resources are busy.
ethernet@0,81:
...

Cause:  You are attempting to uninstall dependent ports of an IOV physical function while a dependent IOV virtual function is busy.

# hotplug disable Slot0
 ERROR: devices or resources are busy.
 /pci@0,0/pci8086,3a40@1c/pci108e,0@0:
    { Hold: module specfs (modid=3): Device opened. }
    { Hold: module genunix (modid=1): Network datalink. }
    { Open: module udp6 (modid=81). }
    { Open: module udp (modid=80). }
    { Network interface net0 }
    { net0: hosts IP addresses: 192.0.2.0 }
    { Plumbed IP Address }

Cause:  You are attempting to disable a PCIe slot which contains busy devices. In this example, a network adapter card with one network interface is inserted in the slot. The interface has a plumbed IP address. Extra information is displayed about related opens and holds on this device:

  • Hold from specfs is related to opening the device.

  • Hold from genunix is related to a configured network datalink.

  • Opens from udp and udp6 are related to IP address plumbing.

Solution:  The solution depends on why the device is busy. In this example, you must unplumb the IP address by using the ipadm command before trying again. For more information, see the ipadm(8).

# hotplug offline pci@0,0 pci.1,0
 ERROR: devices or resources are busy.
 /pci@0,0/pci8086,3408@1/pci1000,1000@0/sd@0,0:
    { Hold: module devfs (modid=6): Device lookup. }
    { Hold: module specfs (modid=3): Device opened. }
    { Open: process format[123501]. }
    { Open: module zfs (modid=49). }

Cause:  You are attempting to offline a busy device. In the example, it is a disk device which is used by the ZFS file system and is also opened by using the format command. Extra information is displayed about related holds on the device:

  • Hold from specfs is related to opening the device.

  • Hold from devfs is related to using a special device file in the /devices filesystem when opening the device.

Solution:  The solution depends on why the device is busy. In this example, you must reconfigure ZFS to stop using the disk and stop the format command before trying again. For more information, see the format(8) man page.