Skip to main content

PCIe Lane Margining Tool (LMT)

LMT is a standard PCIE margining measurement added by PCI-SIG in the PCIe 4.0 specification. This is required mainly to overcome the challenges in delivering a reliable 16GT/s solution. Lane Margining enables system designers to measure the available margin in a standardized manner.

Key Benefits

  • Works in a production platform without any test equipment
  • Provides a way to measure actual margin when running prod traffic
  • Provides visibility to the details of the defect:
    • exactly which wires/pins are bad
    • exactly how ‘bad’ each wire pair (vs a nominal system)
  • Avoids excessive part swaps triggered by multiple repair actions
  • Provides a reliable way to check if source defect is fixed after repairs

This project is part of ocp-diag-core and exists under the same MIT License Agreement.

Usage

Minimum python version is currently py3.8

The binary can be installed from PyPI ocptv-pci_lmt and can be used directly on a system as such:

> pci_lmt -h
usage: pci_lmt [-h] [-o {json,csv}] [-e ERROR_COUNT_LIMIT] [-d DWELL_TIME] [-a ANNOTATION] [-v] [--version] config_file

Runs Lane Margining Test on PCIe devices.

positional arguments:
  config_file           Path to the configuration file (in JSON format).

optional arguments:
  -h, --help            show this help message and exit
  -o {json,csv}         Output format. Supported formats: json, csv. Default: json
  -e ERROR_COUNT_LIMIT  Maximum errors allowed before terminating the test. Default: 63
  -d DWELL_TIME         Amount of time (in seconds) to wait before making BER measurements. Default: 5
  -a ANNOTATION         Annotation string to be prefix'd for LMT results. Default: <empty>
  -v                    Verbosity level. Use '-v' for INFO and '-vv' for DEBUG. Default: 0
  --version             Print tool version and exit.

Contact

Feel free to start a new discussion, or otherwise post an issue/request.

Developer notes

New code may be committed through features or bugfix branches (eg. fea/cool_new_thing or bugfix/none_in_collector). All PRs must be merged into the dev branch.

Quickest way to setup a dev environment:

# make a venv, see https://docs.python.org/3/library/venv.html
> python3 -m venv env
. ./env/bin/activate

> pip install -r requirements.txt

# [1] then the main script can be run from source
> python src/pci_lmt_bin/main.py --version
main.py 1.1.1

# [2] or alternatively do a local editable install and use it as an executable
# see: https://setuptools.pypa.io/en/latest/userguide/development_mode.html
> pip install -e .
> pci_lmt --version
pci_lmt 1.1.1

Before pushing new commits upstream, please check that your changes pass the linters, formatting, typechecker, etc. All the following checks should pass (and return exit code 0). They are also run in a github action, which safeguards against problematic code.

> black . --check --preview
All done! ✨ 🍰 ✨
14 files would be left unchanged.

# remove the fixme disable to see the list of TODOs in the codebase
> pylint src tests --disable fixme

--------------------------------------------------------------------
Your code has been rated at 10.00/10 (previous run: 10.00/10, +0.00)

> mypy src tests --check-untyped-defs
Success: no issues found in 14 source files

# run all unit tests
> find tests -type f -name "test_*.py" | xargs testslide

Metadata

Release files for ocptv-pci-lmt 1.5.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ocptv-pci-lmt 1.5.2
File Size Uploaded
ocptv_pci_lmt-1.5.2.tar.gz 21.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ocptv-pci-lmt 1.5.2
File Interpreter ABI Platform
ocptv_pci_lmt-1.5.2-py3-none-any.whl Python 3 none any Details

Total release size: 45.9 kB

Release files / ocptv_pci_lmt-1.5.2.tar.gz

Download URL ocptv_pci_lmt-1.5.2.tar.gz
Size 21.0 kB
Tags Source
SHA-256 checksum
How to use checksums
38e28d1fc9519d60a2561ad641951ebed379465dbab85074cffcf59e0ac1acae
BLAKE2b-256 checksum
How to use checksums
93bddbe96c46a7d9c14790a5a068f7334cdc6a17c87f16933b318419d568c804
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.12.8

Release files / ocptv_pci_lmt-1.5.2-py3-none-any.whl

Download URL ocptv_pci_lmt-1.5.2-py3-none-any.whl
Size 24.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
234917869f9b4e834a0236443a6f8d5d76bef6bc0a73c1b2b2ac849e0ef0cd42
BLAKE2b-256 checksum
How to use checksums
e4a9236314a8a47d2551704159d9ef0441ac48bc975cd1c4d3734372161903ce
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.12.8

Release history Release notifications | RSS feed

This release

1.5.2 This release

2 release files

1.5.1

2 release files

1.5.0

2 release files

1.4.0

2 release files

1.3.1

2 release files

1.3.0

2 release files

1.2.1

2 release files

1.2.0

2 release files

1.1.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page