Use the smc_rnics command or the sysfs power attribute
of a PCI function to set it online or offline in Linux®.
Before you begin
Changing the online state of a PCI function from Linux in LPAR or DPM partition mode affects the configuration state of the PCI function in the
partition, see Online and configuration state.
Procedure
- Optional: List your PCI functions with
the smc_rnics command to assure that the PCI function of interest is available to your partition. In the
command, specify the -a option to include offline PCI functions in the command output.
The command
displays a table of all PCI functions that are eligible for
your partition. A 0
in the Power column of the output table indicates that the PCI function is offline.
Example: This example shows an offline
PCI function with FID
0x050a
.
# smc_rnics -a
FID Power PCI_ID PCHID Type PPrt PNET_ID Net-Dev
-------------------------------------------------------------------
...
50a 0
...
- Set the PCI function online by issuing an
smc_rnics command with the -e option or through sysfs.
- Issue a command of the following
form:
# smc_rnics -e <fid>
where
<fid>
specifies the FID in hexadecimal format. You can omit leading zeros.
Hint: If the PCI function is already configured in another partition, you cannot set it online and the command
fails.
Example: To set a
PCI function with FID
0x050a
online,
issue:
# smc_rnics -e 50a
- Alternatively, write 1 to the sysfs
/sys/bus/pci/slots/<fid>/power attribute of the PCI function. In this path, <fid> is the
function's FID as an 8-digit hexadecimal number.
Example: To set a
PCI function with FID
0x050a
online,
issue:
# echo 1 > /sys/bus/pci/slots/0000050a/power
The
PCI function is now online to your
Linux instance. The output table of the
smc_rnics command now shows more information about the
PCI function and 1 is displayed in the Power column.
Example:
# smc_rnics
FID Power PCI_ID PCHID Type PPrt PNET_ID Net-Dev
-------------------------------------------------------------------
...
50a 1 000a:00:00.0 015c RoCE_Express 0 NET20 eno10
...
What to do next
You can now use the ip command to activate the interface that is
provided by the PCI function. You can see the interface name
in the Net-Dev column of your smc_rnics output table,
eno10
in the example. You can use the ethtool
and ip commands for a transient configuration of your network
interface. For a persistent configuration, use the network configuration tools of your distribution.
For information about these tools, see your distributor's documentation.
To
set a PCI function offline, use the
smc_rnics command with the -d. Alternatively, write 0 to the
sysfs power attribute of the PCI function.