1 .TH PCILMR 8 "@TODAY@" "@VERSION@" "The PCI Utilities"
3 pcilmr \- margin PCIe Links
7 .RI [ "<margining options>" ] " <downstream component> ..."
10 .RI [ "<margining 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.
67 However, the utility results may be not particularly accurate and, as it was found out during
68 testing, specific devices provide rather dubious capability support and the reliability of
69 the information they provide is questionable. The PCIe specification provides reference values
70 for the eye diagram, which are also used by the
72 to evaluate the results, but it seems that it makes sense to contact the
73 manufacturer of a particular device for references.
75 The PCIe Base Specification Revision 5.0 sets allowed range for Timing Margin from 20%\~UI to 50%\~UI and
76 for Voltage Margin from 50\~mV to 500\~mV. Utility uses 30%\~UI as the recommended
77 value for Timing - taken from NVIDIA presentation ("PCIe 4.0 Mass Electrical Margins Data
81 requires root privileges (to access Extended Configuration Space), but during our testing
82 there were no problems with the devices and they successfully returned to their normal initial
83 state after the end of testing.
87 .B "<device/component>" \t
88 .RI [ "<domain>" :] <bus> : <dev> . <func>
93 .BI --margin " <downstream component> ..."
94 Margin selected Links.
97 Margin all ready for testing (in a meaning similar to the
99 option) Links in the system (one by one).
102 Scan for Links with negotiated speed 16 GT/s or higher. Mark "Ready" those of them
103 in which at least one of the Link sides have Margining Ready bit set meaning that
104 these Links are ready for testing and you can run utility on them.
105 .SS Margining Test options
108 Print Device Lane Margining Capabilities only. Do not run margining.
110 \fB\-l\fI <lane>\fP[\fI,<lane>...\fP]
111 Specify lanes for margining.
113 Remember that Device may use Lane Reversal for Lane numbering. However, utility
114 uses logical lane numbers in arguments and for logging. Utility will automatically
115 determine Lane Reversal and tune its calls.
117 Default: all link lanes.
120 Specify Error Count Limit for margining.
124 \fB-r\fI <recvn>\fP[\fI,<recvn>...\fP]
125 Specify Receivers to select margining targets.
127 Default: all available Receivers (including Retimers).
129 .BI -p " <parallel_lanes>"
130 Specify number of lanes to margin simultaneously.
132 According to spec it's possible for Receiver to margin up to MaxLanes + 1
133 lanes simultaneously, but during testing, performing margining on several
134 lanes simultaneously led to results that were different from sequential
135 margining, so this feature requires additional verification and
137 option right now is for experiments mostly.
141 .B "Use only one of -T/-t options at the same time (same for -V/-v)."
143 .B "Without these options utility will use MaxSteps from Device"
144 .B "capabilities as test limit."
147 Time Margining will continue until the Error Count is no more
148 than an Error Count Limit. Use this option to find Link limit.
151 Specify maximum number of steps for Time Margining.
156 option, but for Voltage.
159 Specify maximum number of steps for Voltage Margining.
160 .SS Margining Log options
162 .BI -o " <directory>"
163 Save margining results in csv form into the specified directory. Utility
164 will generate file with the name in form of
165 .RI "\[dq]lmr_" "<downstream component>" "_Rx" # _ <timestamp> ".csv\[dq]"
166 for each successfully tested receiver.
169 Utility syntax example:
171 .BI "pcilmr -l" " 0,1 " "-r" " 1,6 " "-TV" " ab:0.0 52:0.0"
174 .UR https://gist.github.com/bombanya/f2b15263712757ffba1a11eea011c419
175 Examples of collected results on different systems.
181 .B PCI Express Base Specification (Lane Margining at Receiver)