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)
Thu, Feb 27, 11:27 AM
Unknown Object (File)
Mon, Feb 24, 2:28 PM
Unknown Object (File)
Thu, Feb 13, 9:13 PM
Unknown Object (File)
Jan 20 2025, 4:26 PM
Unknown Object (File)
Jan 20 2025, 4:26 PM
Unknown Object (File)
Jan 14 2025, 1:25 AM
Unknown Object (File)
Jan 9 2025, 7:58 AM
Unknown Object (File)
Jan 3 2025, 11:10 AM
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
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

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–5012

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.