Page MenuHomeFreeBSD

pci: enhance printf for leaked MSI[-X] vectors
ClosedPublic

Authored by bz on Mar 23 2021, 4:01 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Oct 21, 5:10 PM
Unknown Object (File)
Mon, Oct 21, 5:09 PM
Unknown Object (File)
Mon, Oct 21, 5:09 PM
Unknown Object (File)
Mon, Oct 21, 5:09 PM
Unknown Object (File)
Mon, Oct 21, 4:47 PM
Unknown Object (File)
Oct 4 2024, 8:26 PM
Unknown Object (File)
Oct 4 2024, 10:53 AM
Unknown Object (File)
Oct 2 2024, 12:04 PM
Subscribers

Details

Summary

When debugging leaked MSI/MSI-X vectors through LinuxKPI I found
the informational printf unhelpful. Rather than just stating we
leaked also tell how many MSI and MSI-X vectors we leak.

Sponsored-by: The FreeBSD Foundation
Reviewed-by: ...
MFC-after: 2 weeks
Differential Revision:

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 38019
Build 34908: arc lint + arc unit

Event Timeline

bz requested review of this revision.Mar 23 2021, 4:01 PM

Hmm, we don't list the leaked resources for any other types so that's a bit inconsistent (e.g. we don't list the address or rid's of BARs).

sys/dev/pci/pci.c
5007

I would either say "MSI/MSI-X" or annotate the counts, e.g. "Device leaked MSI vectors: %d (MSI) %d (MSI-X)". OTOH, you can never have both MSI and MSI-X, so another possibility is:

if dinfo->cfg.msi.msi_alloc)
    pci_printf(&dinfo->cfg, "Device leaked %d MSI vectors\n", dinfo->cfg.msi.msi_alloc);
else
    pci_printf(&dinfo->cfg, "Device leaked %d MSI-X vectors\n", dinfo->cfg.msix.msix_alloc);

Update to two separate printfs as suggested by @jhb.

bz marked an inline comment as done.Mar 24 2021, 6:47 PM
This revision is now accepted and ready to land.Mar 25 2021, 8:53 PM
This revision was automatically updated to reflect the committed changes.