Page MenuHomeFreeBSD

pci: Cosmetic cleanups to MSI/MSI-X routines
ClosedPublic

Authored by jhb on Feb 7 2025, 5:28 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Jul 29, 7:35 AM
Unknown Object (File)
Fri, Jul 11, 4:03 AM
Unknown Object (File)
Mon, Jul 7, 8:42 PM
Unknown Object (File)
Sun, Jul 6, 7:55 PM
Unknown Object (File)
Sun, Jul 6, 3:11 AM
Unknown Object (File)
Sun, Jul 6, 2:18 AM
Unknown Object (File)
Sun, Jul 6, 2:02 AM
Unknown Object (File)
Fri, Jul 4, 10:00 PM
Subscribers
None

Details

Summary
  • Use unsigned integers for various variables. The count argument to the alloc method as well as the IRQ values used with the pcib_if.m methods should also be unsigned eventually.
  • Use mallocarray to allocate arrays
  • Use bool in a few places

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

sys/dev/pci/pci.c
2023

Have you considered using bitstring instead?

sys/dev/pci/pci.c
2023

I did think about it. This routine is also I think never used (and possibly something I should just remove entirely). I had added it because some language in the PCI spec implied that drivers may wish to shuffle MSI-X assignments, but I have yet to see a driver that does. The one thing I think drivers would like to do is allocate additional MSI-X IRQs on the fly which would be a different API than this. But due to the fact that this isn't used, I didn't pursue a bigger change than just switching to bool.

The one thing I think drivers would like to do is allocate additional MSI-X IRQs on the fly

I think that would be pretty useful for things like RDMA or sub-interfaces in ICE.

But due to the fact that this isn't used, I didn't pursue a bigger change than just switching to bool.

Fair point.

This revision is now accepted and ready to land.Feb 10 2025, 3:56 PM
In D48889#1115618, @krzysztof.galazka_intel.com wrote:

The one thing I think drivers would like to do is allocate additional MSI-X IRQs on the fly

I think that would be pretty useful for things like RDMA or sub-interfaces in ICE.

We definitely have use cases in cxgbe(4) for this, I just haven't implemented it. :(

This revision was automatically updated to reflect the committed changes.