1.\" 2.\" The contents of this file are subject to the terms of the 3.\" Common Development and Distribution License (the "License"). 4.\" You may not use this file except in compliance with the License. 5.\" 6.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 7.\" or http://www.opensolaris.org/os/licensing. 8.\" See the License for the specific language governing permissions 9.\" and limitations under the License. 10.\" 11.\" When distributing Covered Code, include this CDDL HEADER in each 12.\" file and include the License file at usr/src/OPENSOLARIS.LICENSE. 13.\" If applicable, add the following below this CDDL HEADER, with the 14.\" fields enclosed by brackets "[]" replaced with your own identifying 15.\" information: Portions Copyright [yyyy] [name of copyright owner] 16.\" 17.\" 18.\" Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. 19.\" Copyright 2018 Nexenta Systems, Inc. 20.\" 21.Dd February 12, 2018 22.Dt PCITOOL 8 23.Os 24.Sh NAME 25.Nm pcitool 26.Nd interrupt routing tool 27.Sh SYNOPSIS 28.Ss Sy x86 29.Nm 30.Cm pci@ Ns Ar unit-address Ns | Ns Cm niu@ Ns Ar unit-address 31.Fl i Ar cpu# Ns \&, Ns Ar ino# Ns | Ns Cm all 32.Op Fl qv 33.Op Fl r Oo Fl c Oc Ns | Ns Fl w Ar cpu# Oo Fl g Oc 34.Ss SPARC 35.Nm 36.Cm pci@ Ns Ar unit-address Ns | Ns Cm niu@ Ns Ar unit-address 37.Fl i Ar ino# Ns | Ns Cm all 38.Op Fl qv 39.Op Fl r Oo Fl c Oc Ns | Ns Fl w Ar cpu# Oo Fl g Oc 40.Nm 41.Cm pci@ Ns Ar unit-address 42.Fl m Ar msi# Ns | Ns Cm all 43.Op Fl qv 44.Op Fl r Oo Fl c Oc Ns | Ns Fl w Ar cpu# Oo Fl g Oc 45.Sh DESCRIPTION 46.Nm 47is a low-level tool which provides a facility for getting and setting interrupt 48routing information. 49.Ss Interrupt Routing 50On x86 platforms, both INOs and MSI/Xs are mapped to the same interrupt vectors. 51Use 52.Nm Fl i 53option to retrieve and reroute any interrupt vectors (both INO and MSI/Xs). 54.Pp 55On SPARC platforms, the INO is mapped to an interrupt mondo, where as one or 56more MSI/Xs are mapped to an INO. 57So, INO and MSI/Xs are individually retargetable. 58Use 59.Nm Fl i 60option to retrieve or reroute a given INO, where as use 61.Nm Fl m 62option for MSI/Xs. 63.Pp 64The following options are supported by 65.Nm 66for interrupt routing: 67.Bl -tag -width Ds 68.It Fl c 69.Pq Used with Fl r . 70Dump interrupt controller information. 71.It Fl g 72.Pq Used with Fl w . 73On some platforms (such as x86) multiple MSI interrupts of a single function 74need to be rerouted together. 75Use 76.Fl g 77to do this. 78.Fl g 79works only on supported platforms and only for groups of MSI interrupts. 80(A "group" of 1 is accepted). 81When 82.Fl g 83is used, the vector provided must be the lowest-numbered vector of the group. 84The size of the group is determined internally. 85.It Fl i 86Display device and CPU routing information for INOs on a given nexus, 87or reroute the given INO or INO group to a specific CPU. 88.It Fl m 89.Pq SPARC only 90Display device and CPU routing information for MSI/Xs on a given nexus, 91or reroute the given MSI/X or MSI/X group to a specific CPU. 92.It Fl q 93No errors reported as messages. 94Unix error status still returned by program, however. 95.It Fl r 96Display device and CPU routing information for INOs on a given nexus. 97The device path and instance number of each device for each displayed INO will 98be shown. 99On some platforms, interrupts dedicated to the root complex are indicated with 100.Ql (Internal) 101appended to their pathname. 102Default if neither 103.Fl r 104nor 105.Fl w 106are specified. 107.It Fl v 108Verbose output. 109.It Fl w 110Route the given INO or MSI/X to the given CPU. 111Display the new and original routing information. 112The INO or MSI/X must be specified. 113.El 114.Sh EXIT STATUS 115The following error statuses are returned to the shell: 116.Bl -tag -width Er 117.It Er 0 118No error 119.It Er EINVAL 120Out-of-range, misaligned or otherwise invalid argument has been passed in. 121.It Er ETIME 122Timeout waiting for pending interrupt to settle before changing interrupts to 123a new CPU. 124.It Er EIO 125An IO error occurred. 126.El 127.Sh EXAMPLES 128.Bl -tag -width Ds 129.It Sy Example 1 No Showing INOs or MSI/Xs 130The command for showing all INOs on /pci@0,0 is: 131.Bd -literal 132# pcitool /pci@0,0 -i all 133.Ed 134.Pp 135The command for showing ino <0x0,0x21> on the same root nexus, along with sample 136output, is: 137.Pp 138On x86 platform: 139.Bd -literal 140# pcitool /pci@0,0 -i 0,21 1410x0,0x21: mpt 0 /pci@7b,0/pci1022,7458@11/pci1000,3060@2 142.Ed 143.Pp 144On SPARC platform: 145.Bd -literal 146# pcitool /pci@0,0 -i 21 1470x0,0x21: mpt 0 /pci@7b,0/pci1022,7458@11/pci1000,3060@2 148.Ed 149.Pp 150The command for showing MSI 0x1 on the same root nexus, along with sample 151output, is: 152.Bd -literal 153# pcitool /pci@0,0 -m 0x1 1540x0,0x1: pcieb 0 /pci@7b,0/pci10de,5d@e 155.Ed 156.It Sy Example 2 No Rerouting INOs or MSI/Xs 157Successful rerouting ino 21 above from cpu 0 to cpu 1 gives the following 158output: 159.Pp 160On x86 platform: 161.Bd -literal 162# pcitool /pci@0,0 -i 0,21 -w 1 1630x0,0x21 -> 0x1,0x20 164.Ed 165.Pp 166On SPARC platform: 167.Bd -literal 168# pcitool /pci@0,0 -i 21 -w 1 1690x0,0x21 -> 0x1,0x21 170.Ed 171.Pp 172Successful rerouting msi 1 above from cpu 1 to cpu 0 gives the following 173output: 174.Bd -literal 175# pcitool /pci@0,0 -m 1 -w 0 1760x1,0x1 -> 0x0,0x1 177.Ed 178.Pp 179Successful rerouting a group of INOs starting at 24 from cpu 0 to cpu 1 gives 180the following output: 181.Pp 182On x86 platform: 183.Bd -literal 184# pcitool /pci@0,0 -i 3,24 -w 1 -g 1850x3,0x24 => 0x1,0x22 186.Ed 187.Pp 188On SPARC platform: 189.Bd -literal 190# pcitool /pci@0,0 -i 24 -w 1 -g 1910x3,0x24 => 0x1,0x22 192.Ed 193.El 194.Sh ARCHITECTURE 195.Sy PCI-based systems 196.Sh INTERFACE STABILITY 197.Sy Volatile 198.Sh SEE ALSO 199.Xr pci 5 , 200.Xr user_attr 5 , 201.Xr rbac 7 , 202.Xr su 8 203.Pp 204PCI specification 205.Po available from 206.Lk https://pcisig.com 207.Pc 208.Sh NOTES 209All values are entered in hex. 210.Pp 211Not all commands are applicable to all platforms. 212.Pp 213The user must have all privileges in order to access interrupt information. 214A regular user can access interrupt information when 215.Xr su 8 216to root or granted the 217.Qq Maintenance and Repair 218rights profile in the 219.Pa user_attr 220file. 221See 222.Xr user_attr 5 223and 224.Xr rbac 7 . 225