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
F97704807: D29394.id.diff
Mon, Sep 30, 9:09 PM
Unknown Object (File)
Sat, Sep 28, 2:33 PM
Unknown Object (File)
Sat, Sep 28, 12:04 AM
Unknown Object (File)
Fri, Sep 27, 9:43 AM
Unknown Object (File)
Sun, Sep 22, 6:28 PM
Unknown Object (File)
Sat, Sep 7, 5:39 PM
Unknown Object (File)
Fri, Sep 6, 7:04 PM
Unknown Object (File)
Mon, Sep 2, 1:51 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 38053
Build 34942: 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–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.