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
F82777487: D29394.id86264.diff
Thu, May 2, 12:50 PM
F82777338: D29394.id86205.diff
Thu, May 2, 12:49 PM
F82777332: D29394.id86333.diff
Thu, May 2, 12:49 PM
F82768154: D29394.diff
Thu, May 2, 10:39 AM
Unknown Object (File)
Wed, Apr 24, 8:37 AM
Unknown Object (File)
Sun, Apr 21, 3:19 PM
Unknown Object (File)
Mon, Apr 15, 2:55 AM
Unknown Object (File)
Mar 24 2024, 8:21 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.