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)
Wed, Feb 28, 11:06 PM
Unknown Object (File)
Feb 11 2024, 9:44 AM
Unknown Object (File)
Feb 8 2024, 8:53 PM
Unknown Object (File)
Dec 20 2023, 12:55 AM
Unknown Object (File)
Dec 19 2023, 7:03 PM
Unknown Object (File)
Dec 12 2023, 9:53 PM
Unknown Object (File)
Nov 15 2023, 8:48 PM
Unknown Object (File)
Nov 15 2023, 8:19 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.