Skip to content

Commit a6bed7a

Browse files
lsgunthjonmason
authored andcommitted
NTB: Introduce NTB MSI Test Client
Introduce a tool to test NTB MSI interrupts similar to the other NTB test tools. This tool creates a debugfs directory for each NTB device with the following files: port irqX_occurrences peerX/port peerX/count peerX/trigger The 'port' file tells the user the local port number and the 'occurrences' files tell the number of local interrupts that have been received for each interrupt. For each peer, the 'port' file and the 'count' file tell you the peer's port number and number of interrupts respectively. Writing the interrupt number to the 'trigger' file triggers the interrupt handler for the peer which should increment their corresponding 'occurrences' file. The 'ready' file indicates if a peer is ready, writing to this file blocks until it is ready. The module parameter num_irqs can be used to set the number of local interrupts. By default this is 4. This is only limited by the number of unused MSI interrupts registered by the hardware (this will require support of the hardware driver) and there must be at least 2*num_irqs + 1 spads registers available. Signed-off-by: Logan Gunthorpe <[email protected]> Cc: Dave Jiang <[email protected]> Cc: Allen Hubbe <[email protected]> Signed-off-by: Jon Mason <[email protected]>
1 parent 26b3a37 commit a6bed7a

File tree

3 files changed

+443
-0
lines changed

3 files changed

+443
-0
lines changed

drivers/ntb/test/Kconfig

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,12 @@ config NTB_PERF
2525
to and from the window without additional software interaction.
2626

2727
If unsure, say N.
28+
29+
config NTB_MSI_TEST
30+
tristate "NTB MSI Test Client"
31+
depends on NTB_MSI
32+
help
33+
This tool demonstrates the use of the NTB MSI library to
34+
send MSI interrupts between peers.
35+
36+
If unsure, say N.

drivers/ntb/test/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
obj-$(CONFIG_NTB_PINGPONG) += ntb_pingpong.o
22
obj-$(CONFIG_NTB_TOOL) += ntb_tool.o
33
obj-$(CONFIG_NTB_PERF) += ntb_perf.o
4+
obj-$(CONFIG_NTB_MSI_TEST) += ntb_msi_test.o

0 commit comments

Comments
 (0)