Page MenuHomeFreeBSD

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

Authored by jhb on Fri, Feb 7, 5:28 PM.
Tags
None
Referenced Files
F109975146: D48889.diff
Tue, Feb 11, 11:17 PM
F109972704: D48889.diff
Tue, Feb 11, 10:27 PM
Unknown Object (File)
Mon, Feb 10, 12:00 AM
Unknown Object (File)
Sun, Feb 9, 5:19 AM
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.Mon, Feb 10, 3:56 PM

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.