'pci_endpoint_test' fails for architectures allowing less than 32 MSI registers and that doesnt support MSI-X, avoid reporting false errors because of out-of-range irqs.
e.g for an EP configured with 8 msi_interrupts and no msix we can have
./pci_endpoint_test -t MSI_TEST
# PASSED: 1 / 1 tests passed. # 1 skipped test(s) detected. Consider enabling relevant config options to improve coverage. # Totals: pass:0 fail:0 xfail:0 xpass:0 skip:1 error:0
instead of
# FAILED: 0 / 1 tests passed # Totals: pass:0 fail:1 xfail:0 xpass:0 skip:0 error:0
An alternative could have been to implement VARIANTs so that the harness runs only the supported tests, but that seems quite heavy considering the huge number of possible interrupts.
Another alternative could also have been to use a new ioctl to get the allocated number of irqs from the driver, but that doesn't seem to be more efficient than just using -EINVAL when the irq is out of range.
thank you for your feedback
Christian Bruel (3): misc: pci_endpoint_test: Skip IRQ tests if irq is out of range misc: pci_endpoint_test: Cleanup extra 0 initialization selftests: pci_endpoint: Skip IRQ test if irq is out of range.
drivers/misc/pci_endpoint_test.c | 14 ++++++-------- .../selftests/pci_endpoint/pci_endpoint_test.c | 4 ++++ 2 files changed, 10 insertions(+), 8 deletions(-)