On Sun, Oct 20, 2024 at 04:41:25PM +0200, Niklas Cassel wrote: > On Fri, Oct 18, 2024 at 11:13:34AM -0400, Frank Li wrote: > > On Fri, Oct 18, 2024 at 04:01:05PM +0200, Niklas Cassel wrote: > > How about we add a new pcitest --set-doorbell-mode option > (that is similar to pcitest -i which sets the interrupt mode to use). > > That way, we can do: > ./pcitest --set-doorbell-mode 1 > (This will enable doorbell for e.g. BAR0, pci-epf-test will call > pci_epf_alloc_doorbell() when receiving this command from the RC side. > The command will return failure if pci_epf_alloc_doorbell() returned failure.) > > ./pcitest -B > (This will perform the doorbell test) > > ./pcitest --set-doorbell-mode 0 > (This will disable the doorbell for BAR0, > so it will again not trigger IRQs when BAR0 is written, > and pcitest's tests to read/write the BARs will again behave as expected.) > > (We probably also need another option pcitest --get-doorbell-mode.) > > I think this should solve all your concerns. Thoughts? And just to clarify, if we go with the --set-doorbell-mode approach, then my previous idea (introducing capabilities in pci-epf-test and pci-endpoint-test) is no longer a necessity. Kind regards, Niklas