Project

General

Profile

Actions

Bug #14459

closed

pcieadm show-cfgspace sometimes confuses hex and strings

Added by Robert Mustacchi 8 months ago. Updated 8 months ago.

Status:
Closed
Priority:
Normal
Category:
cmd - userland programs
Start date:
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:
External Bug:

Description

If you look at the output of pcieadm show-cfgspace there are a few places that just look wrong:

rm@beowulf:/ws/rm/pcieadm/projects/illumos/usr/src/cmd/pcieadm$ pfexec /usr/lib/pci/pcieadm show-cfgspace -d pcieb0 pcie.linkctl
PCI Express Capability (0x10)
  Link Control: 0xc40
    |--> ASPM Control: None (0x0)
    |--> Read Completion Boundary: 64 byte (0x0)
    |--> Link Disable: not force disabled (0x0)
    |--> Retrain Link: 0x0
    |--> Common Clock Configuration: common (0x40)
    |--> Extended Sync: 0x411fce
    |--> Clock Power Management: 0x411fce
    |--> Hardware Autonomous Width: 0x411b90
    |--> Link Bandwidth Management Interrupt: 0x421fce
    |--> Link Autonomous Bandwidth Interrupt: 0x421fce
    |--> DRS Signaling Control: 0x41029b

Note that at lot of the fields here are just random addresses where as these are supposed to be actual strings. The problem is we have specified the wrong type here. These should be PRDV_STRVAL, but are PRDV_HEX, leading to a very confusing result. When these are fixed up we now see something more sensible:

rm@beowulf:/ws/rm/pcieadm/projects/illumos/usr/src/cmd/pcieadm$ pfexec ./pcieadm show-cfgspace -d pcieb0 pcie.linkctl     
PCI Express Capability (0x10)
  Link Control: 0xc40
    |--> ASPM Control: None (0x0)
    |--> Read Completion Boundary: 64 byte (0x0)
    |--> Link Disable: not force disabled (0x0)
    |--> Retrain Link: 0x0
    |--> Common Clock Configuration: common (0x40)
    |--> Extended Sync: disabled (0x0)
    |--> Clock Power Management: disabled (0x0)
    |--> Hardware Autonomous Width: enabled (0x0)
    |--> Link Bandwidth Management Interrupt: enabled (0x400)
    |--> Link Autonomous Bandwidth Interrupt: enabled (0x800)
    |--> DRS Signaling Control: not reported (0x0)

In addition, I ran the pcieadm test suite to make sure that everything still passed:

rm@beowulf:~$ pfexec /opt/util-tests/bin/utiltest
Test: /opt/util-tests/tests/allowed-ips (run as root)             [00:00] [PASS]
Test: /opt/util-tests/tests/ar/artest (run as root)               [00:00] [PASS]
Test: /opt/util-tests/tests/chown_test (run as root)              [00:00] [PASS]
Test: /opt/util-tests/tests/date_test (run as root)               [00:00] [PASS]
Test: /opt/util-tests/tests/find/findtest (run as root)           [00:00] [PASS]
Test: /opt/util-tests/tests/grep_test (run as root)               [00:02] [PASS]
Test: /opt/util-tests/tests/head/head_test (run as root)          [00:00] [PASS]
Test: /opt/util-tests/tests/libjedec_test (run as root)           [00:00] [PASS]
Test: /opt/util-tests/tests/libsff/libsff (run as root)           [00:00] [PASS]
Test: /opt/util-tests/tests/make_test (run as root)               [00:00] [PASS]
Test: /opt/util-tests/tests/mdb/mdbtest (run as root)             [00:01] [PASS]
Test: /opt/util-tests/tests/mergeq/mqt (run as root)              [00:00] [PASS]
Test: /opt/util-tests/tests/mergeq/wqt (run as root)              [00:00] [PASS]
Test: /opt/util-tests/tests/pcidbtest (run as root)               [00:01] [PASS]
Test: /opt/util-tests/tests/pcieadm-priv (run as root)            [00:01] [PASS]
Test: /opt/util-tests/tests/pcieadmtest (run as root)             [00:03] [PASS]
Test: /opt/util-tests/tests/printf_test (run as root)             [00:00] [PASS]
Test: /opt/util-tests/tests/set-linkprop (run as root)            [00:00] [PASS]
Test: /opt/util-tests/tests/sleep/sleeptest (run as root)         [00:18] [PASS]
Test: /opt/util-tests/tests/smbios (run as root)                  [00:00] [PASS]
Test: /opt/util-tests/tests/svr4pkg_test (run as root)            [00:00] [PASS]
Test: /opt/util-tests/tests/xargs_test (run as root)              [00:00] [PASS]
Test: /opt/util-tests/tests/awk/runtests.sh (run as nobody)       [02:51] [PASS]
Test: /opt/util-tests/tests/ctf/precheck (run as root)            [00:00] [PASS]
Test: /opt/util-tests/tests/ctf/ctftest (run as root)             [00:05] [PASS]
Test: /opt/util-tests/tests/demangle/afl-fast (run as root)       [00:01] [PASS]
Test: /opt/util-tests/tests/demangle/gcc-libstdc++ (run as root)  [00:00] [PASS]
Test: /opt/util-tests/tests/demangle/llvm-stdcxxabi (run as root) [00:00] [PASS]
Test: /opt/util-tests/tests/libcustr/custr_remove (run as root)   [00:00] [PASS]
Test: /opt/util-tests/tests/libcustr/custr_trunc (run as root)    [00:00] [PASS]
Test: /opt/util-tests/tests/libnvpair_json/json_00_blank (run as root) [00:00] [PASS]
Test: /opt/util-tests/tests/libnvpair_json/json_01_boolean (run as root) [00:00] [PASS]
Test: /opt/util-tests/tests/libnvpair_json/json_02_numbers (run as root) [00:00] [PASS]
Test: /opt/util-tests/tests/libnvpair_json/json_03_empty_arrays (run as root) [00:00] [PASS]
Test: /opt/util-tests/tests/libnvpair_json/json_04_number_arrays (run as root) [00:00] [PASS]
Test: /opt/util-tests/tests/libnvpair_json/json_05_strings (run as root) [00:00] [PASS]
Test: /opt/util-tests/tests/libnvpair_json/json_06_nested (run as root) [00:00] [PASS]
Test: /opt/util-tests/tests/libnvpair_json/json_07_nested_arrays (run as root) [00:00] [PASS]
Test: /opt/util-tests/tests/sed/sed_addr (run as root)            [00:00] [PASS]
Test: /opt/util-tests/tests/sed/multi_test (run as root)          [00:00] [PASS]

Results Summary
PASS      40

Running Time:   00:03:32
Percent passed: 100.0%
Log directory:  /var/tmp/test_results/20220129T191306
Actions

Also available in: Atom PDF