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 #1

Updated by Electric Monk 8 months ago

  • Gerrit CR set to 1989
Actions #2

Updated by Electric Monk 8 months ago

  • Status changed from New to Closed
  • % Done changed from 0 to 100

git commit 92f11af9ee66cf1fac02dc46553e805de69f204c

commit  92f11af9ee66cf1fac02dc46553e805de69f204c
Author: Robert Mustacchi <rm@fingolfin.org>
Date:   2022-02-08T15:12:38.000Z

    14460 pcieadm show-devs should warn on unused filters
    14459 pcieadm show-cfgspace sometimes confuses hex and strings
    14461 pcieadm-priv tests fail in the face of duplicate /devices paths
    Reviewed by: Gordon Ross <Gordon.W.Ross@gmail.com>
    Reviewed by: Andy Fiddaman <andy@omnios.org>
    Approved by: Dan McDonald <danmcd@joyent.com>

Actions

Also available in: Atom PDF