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)
Sun, Mar 24, 8:21 PM
Unknown Object (File)
Feb 11 2024, 4:50 AM
Unknown Object (File)
Feb 9 2024, 3:47 AM
Unknown Object (File)
Dec 20 2023, 1:45 AM
Unknown Object (File)
Dec 12 2023, 1:34 AM
Unknown Object (File)
Nov 29 2023, 9:59 PM
Unknown Object (File)
Nov 20 2023, 8:25 AM
Unknown Object (File)
Nov 8 2023, 7:31 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
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.