Page MenuHomeFreeBSD

pciconf: Fix up pciconf -lc output
ClosedPublic

Authored by dab on May 24 2021, 7:18 PM.

Details

Summary

The pciconf command fails to emit newlines when particular ecap field
values are seen. Fix them up. This has been seen on several systems at
$WORK. The documentation for PCI capabilities says that capability
type 0 should not be used once the spec for PCI capabilities was
published, but that seems more wishful-thinking than reality. pciconf
also chooses not to print fields related to field values that are
zero, but it seems several of these fields are zero on actual
hardware.

Sponsored by: Dell Technologies
Submitted by: Robert Herndon (Robert.Herndon@dell.com)

Test Plan

Tested at $WORK. Ran the before and after versions on hardware that exhibits the problem and compared the output.

Difference between broken and fixed output:

395c395,396
<     ecap 000b[100] = Vendor 0none114@pci0:93:15:0:    class=0x110100 card=0x00008086 chip=0x20588086 rev=0x07 hdr=0x00
---
>     ecap 000b[100] = Vendor 0
> none114@pci0:93:15:0: class=0x110100 card=0x00008086 chip=0x20588086 rev=0x07 hdr=0x00
399c400,401
<     ecap 000b[100] = Vendor 0none116@pci0:93:16:0:    class=0x110100 card=0x00000000 chip=0x20588086 rev=0x07 hdr=0x00
---
>     ecap 000b[100] = Vendor 0
> none116@pci0:93:16:0: class=0x110100 card=0x00000000 chip=0x20588086 rev=0x07 hdr=0x00
1338c1340,1341
<     ecap 000b[100] = Vendor 0none237@pci0:215:15:0:   class=0x110100 card=0x00008086 chip=0x20588086 rev=0x07 hdr=0x00
---
>     ecap 000b[100] = Vendor 0
> none237@pci0:215:15:0:        class=0x110100 card=0x00008086 chip=0x20588086 rev=0x07 hdr=0x00
1342c1345,1346
<     ecap 000b[100] = Vendor 0none239@pci0:215:16:0:   class=0x110100 card=0x00000000 chip=0x20588086 rev=0x07 hdr=0x00
---
>     ecap 000b[100] = Vendor 0
> none239@pci0:215:16:0:        class=0x110100 card=0x00000000 chip=0x20588086 rev=0x07 hdr=0x00

Diff Detail

Repository
rG FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

dab requested review of this revision.May 24 2021, 7:18 PM
dab retitled this revision from Fix up pciconf -lc output to pciconf: Fix up pciconf -lc output.May 24 2021, 7:20 PM
This revision is now accepted and ready to land.May 25 2021, 1:25 PM
This revision was automatically updated to reflect the committed changes.