Solved Question About The Sequence Of Calls To Request/Free MSIX Interrupt resource

I have some questions about the sequence of calls to request/free MSIX interrupt resource.
I tried "amd64 FreeBSD 13.1" and "amd64 FreeBSD 13.2".

When requesting MSIX interrupt resource, I tried the following 2 sequences:
*Sequence A:
bus_alloc_resource
pci_msix_count
pci_alloc_msix
bus_setup_intr

*Sequence B:
pci_msix_count
pci_alloc_msix
bus_alloc_resource
bus_setup_intr

When using "Sequence A", I observed bus_alloc_resource FAIL (return NULL pointer).
When using "Sequence B", it works so I choose "Sequence B".

When freeing MSIX interrupt resource, I tried the following 2 sequences:
*Sequence C:
bus_teardown_intr
pci_release_msi
bus_release_resource

*Sequence D:
bus_teardown_intr
bus_release_resource
pci_release_msi

When using "Sequence C", I observed one system log "Device leaked MSI vectors" when unloading the device driver.
When using "Sequence D", I observed "sudo acpiconf -s 3" is no longer able to suspend system to RAM.

Which sequence is correct or is there some other good approach?

Related man:
https://man.freebsd.org/cgi/man.cgi?query=pci_release_msi&sektion=9&manpath=freebsd-release-ports


1680661044451.png


According to the man, "Sequence A" and "Sequence C" are correct.
However,
  • When using "Sequence A", I observed bus_alloc_resource FAIL (return NULL pointer).
  • When using "Sequence C", I observed one system log "Device leaked MSI vectors" when unloading the device driver.
Can advice what is the cause of the problem? Or is there a workaround solution available?
Thanks in advance.
 
Last edited:
Of course the most recent manpage is the one which should be worked with.

But in terms of relevancy here the text shown above:
There is not a single character that makes a diff between the versions.
 
The manual page you liked to was from 11.0-CURRENT. A version that's been replaced with 11.0-RELEASE 7 years ago and has been EoL for almost 6.

This is a relevant man page: pci_release_msi(9)
Thanks SirDice for the reply, I have updated my post with latest man accordingly.
But as what getopt mentioned, there is no difference between the versions.

According to the man, "Sequence A" and "Sequence C" are correct.
However,
  • When using "Sequence A", I observed bus_alloc_resource FAIL (return NULL pointer).
  • When using "Sequence C", I observed one system log "Device leaked MSI vectors" when unloading the device driver.
Do you know why? Can you advice what is the cause of the problem? Or is there a workaround solution available?
Thanks in advance.
 
Last edited:
Of course the most recent manpage is the one which should be worked with.

But in terms of relevancy here the text shown above:
There is not a single character that makes a diff between the versions.
Thanks getopt for the reply, I have updated my post with latest man accordingly.
Agree with you, there is no difference between the versions.
 
JasonZ
If you don't get an answer to your problem here, try other channels:

You may also search for known bugs here:

Or file a PR after reading this:
 
Before that though try turning off MSI-Interrupts. There are various loader and sysctl settings.

Please detail your platform and hardware using the interrupts.

Is this amd64 or Arm? Are you debugging a problem or developing software?
The reason I ask is I have had troubles with Realtek Network cards and the same topic. MSI Interrupts.
 
Before that though try turning off MSI-Interrupts. There are various loader and sysctl settings.

Please detail your platform and hardware using the interrupts.

Is this amd64 or Arm? Are you debugging a problem or developing software?
The reason I ask is I have had troubles with Realtek Network cards and the same topic. MSI Interrupts.
Thanks Phishfry for the reply.
I am using amd64 and developing software.
Can share with me the call sequence you finally decide to use?
 
I was speaking about settings like these. I have had to use in the past with some misbehaving RE devices.

hw.re.msix_disable=1
hw.re.msi_disable=1
 
Back
Top