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