1 .TH PCILMR 8 "@TODAY@" "@VERSION@" "The PCI Utilities"
3 pcilmr \- margin PCIe Links
7 .RI [ "<common options>" ] " <link port> " [ "<link options>" "] [" "<link port> " [ "<link options>" ] " ..." ]
10 .RI [ "<common options>" ]
14 List of the requirements for links and system settings
15 to run the margining test.
18 (depends on the system, relevant for server baseboards
21 Turn off PCIe Leaky Bucket Feature, Re-Equalization and Link Degradation;
23 Set Error Thresholds to 0;
25 Intel VMD for NVMe SSDs - in case of strange behavior of the
27 try to run it with the VMD turned off.
29 .B Device (link) requirements:
31 .I "Configured by the user before running the utility, the utility does not change them:"
34 The current Link data rate must be 16.0 GT/s or higher (right now
35 utility supports 16 GT/s and 32 GT/s Links);
37 Link Downstream Component must be at D0 Power Management State.
40 .I "Configured by the utility during operation, utility set them to their original "
41 .I "state after receiving the results:"
44 The ASPM must be disabled in both the Downstream Port and Upstream Port;
46 The Hardware Autonomous Speed Disable bit of the Link Control 2 register must be Set in both the
47 Downstream Port and Upstream Port;
49 The Hardware Autonomous Width Disable bit of the Link Control register must be Set in both the
50 Downstream Port and Upstream Port.
53 utility allows you to take advantage of the PCIe Lane Margining at the Receiver
54 capability which is mandatory for all Ports supporting a data rate of 16.0 GT/s or
55 higher, including Pseudo Ports (Retimers). Lane Margining at Receiver enables system
56 software to obtain the margin information of a given Receiver while the Link is in the
57 L0 state. The margin information includes both voltage and time, in either direction from
58 the current Receiver position. Margining support for timing is required, while support
59 for voltage is optional at 16.0 GT/s and required at 32.0 GT/s and higher data rates. Also,
60 independent time margining and independent voltage margining is optional.
62 Utility allows to get an approximation of the eye margin diagram in the form of a rhombus
63 (by four points). Lane Margining at the Receiver capability enables users to margin PCIe
64 links without a hardware debugger and without the need to stop the target system. Utility
65 can be useful to debug link issues due to receiver margins.
68 requires root privileges (to access Extended Configuration Space), but during our testing
69 there were no problems with the devices and they successfully returned to their normal initial
70 state after the end of testing.
73 The PCIe specification provides reference values for the eye diagram, which are also used by the
75 to evaluate the results, but it seems that it makes sense to contact the
76 manufacturer of a particular device for references.
78 The utility uses values set in PCIe Base Spec Rev. 5.0 Section 8.4.2 as the default eye width and height
79 minimum references. Recommended values were taken from
80 the PCIe Architecture PHY Test Spec Rev 5.0 (Transmitter Electrical Compliance).
82 Reference grading values currently used by the utility are presented in the table below:
89 \&:16 GT/s (Gen 4):32 GT/s (Gen 5)
114 uses full eye width and height values to grade lanes. However, it is possible that
115 device supports only one side margining. In such cases by default utility will
116 calculate EW or EH as a double one side result.
118 If info for specific device is available, you can configure grading criteria
119 and tweak utility behavior in one-side only cases for your device using
121 link specific option (see below).
123 .SH HARDWARE QUIRKS SUPPORT
125 Thanks to testing or directly from the manufacturer's documentation, we know that
126 some devices require special treatment during the margining.
127 Utility detects such devices based on their Vendor ID - Device ID pair.
128 Right now the list of special devices is hardcoded in
130 file. For such devices utility can automatically adjust port margining parameters
133 For example, for Ice Lake CPUs RC ports
135 will change device MaxVoltageOffset value and will force the use of
136 .RI ' "one side is the whole" "' grading mode."
140 .B "You can specify Downstream or Upstream Port of the Link."
142 .B "<device/component>" \t
143 .RI [ "<domain>" :] <bus> : <dev> . <func>
148 .BI --margin " <downstream component> ..."
149 Margin selected Links.
152 Margin all ready for testing (in a meaning similar to the
154 option) Links in the system (one by one).
157 Scan for Links with negotiated speed 16 GT/s or higher. Mark "Ready" those of them
158 in which at least one of the Link sides have Margining Ready bit set meaning that
159 these Links are ready for testing and you can run utility on them.
160 .SS Margining Common (for all specified links) options
162 Print Device Lane Margining Capabilities only. Do not run margining.
165 Specify Error Count Limit for margining.
169 .BI -o " <directory>"
170 Save margining results in csv form into the specified directory. Utility
171 will generate file with the name in form of
172 .RI "\[dq]lmr_" "<port>" "_Rx" # _ <timestamp> ".csv\[dq]"
173 for each successfully tested receiver.
176 Specify dwell time in seconds for the margining step.
179 .SS Margining Link specific options
181 \fB\-l\fI <lane>\fP[\fI,<lane>...\fP]
182 .R Specify lanes for margining.
184 Remember that Device may use Lane Reversal for Lane numbering. However, utility
185 uses logical lane numbers in arguments and for logging. Utility will automatically
186 determine Lane Reversal and tune its calls.
188 Default: all link lanes.
190 \fB-r\fI <recvn>\fP[\fI,<recvn>...\fP]
191 Specify Receivers to select margining targets.
193 Default: all available Receivers (including Retimers).
195 .BI -p " <parallel_lanes>"
196 Specify number of lanes to margin simultaneously.
198 According to spec it's possible for Receiver to margin up to MaxLanes + 1
199 lanes simultaneously, but during testing, performing margining on several
200 lanes simultaneously led to results that were different from sequential
201 margining, so this feature requires additional verification and
203 option right now is for experiments mostly.
207 .B "Use only one of -T/-t options at the same time (same for -V/-v)."
209 .B "Without these options utility will use MaxSteps from Device"
210 .B "capabilities as test limit."
213 Time Margining will continue until the Error Count is no more
214 than an Error Count Limit. Use this option to find Link limit.
217 Specify maximum number of steps for Time Margining.
222 option, but for Voltage.
225 Specify maximum number of steps for Voltage Margining.
227 \fB-g\fI <recvn>\fPt=\fI<criteria>\fP{%|ps}[,f]
229 .IB " <recvn>" t=f[, "<criteria>" "{%|ps}]"
231 .IB " <recvn>" v= "<criteria>" "[,f]"
233 .IB " <recvn>" v=f[, "<criteria>" ]
234 Specify pass/fail grading criteria for eye width (timing - t) or height
235 (voltage - v) for one of the link receivers. For EW you must choose one of the
236 units (% UI or ps), for EH mV is used.
240 is for situations when port doesn't support two side independent
241 margining. In such cases by default utility will calculate EW or EH as a
242 double one side result. You can add
246 option to tell the utility that the result in one direction is actually the
247 measurement of the full eye and it does not need to be multiplied. This is so called
248 .RI ' "one side is the whole" "' grading mode."
251 Utility syntax example:
253 .BI "pcilmr -o " "csv ab:0.0 " "-r " "1,6 " "-g " "1t=20% " "-g " "1v=f,30 52:0.0 " "-l " "0,1,2 " "-TV"
256 .UR https://gist.github.com/bombanya/f2b15263712757ffba1a11eea011c419
257 Examples of collected results on different systems.
263 .B PCI Express Base Specification (Lane Margining at Receiver)