Page MenuHomeFreeBSD

pciconf: Fix up pciconf -lc output
ClosedPublic

Authored by dab on May 24 2021, 7:18 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Oct 27, 11:09 PM
Unknown Object (File)
Fri, Oct 18, 12:41 PM
Unknown Object (File)
Tue, Oct 15, 11:57 PM
Unknown Object (File)
Oct 7 2024, 12:27 AM
Unknown Object (File)
Oct 4 2024, 3:46 AM
Unknown Object (File)
Oct 3 2024, 10:58 PM
Unknown Object (File)
Oct 3 2024, 9:09 AM
Unknown Object (File)
Sep 28 2024, 2:20 AM

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
Lint Not Applicable
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.