Skip to content

Commit 578b881

Browse files
Allen Hubbejonmason
authored andcommitted
NTB: Add tool test client
This is a simple debugging driver that enables the doorbell and scratch pad registers to be read and written from the debugfs. This tool enables more complicated debugging to be scripted from user space. This driver may be used to test that your ntb hardware and drivers are functioning at a basic level. Signed-off-by: Allen Hubbe <[email protected]> Signed-off-by: Jon Mason <[email protected]>
1 parent 963de47 commit 578b881

File tree

4 files changed

+600
-0
lines changed

4 files changed

+600
-0
lines changed

Documentation/ntb.txt

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,38 @@ Module Parameters:
6464
* dyndbg - It is suggested to specify dyndbg=+p when loading this module, and
6565
then to observe debugging output on the console.
6666

67+
### NTB Tool Test Client (ntb\_tool)
68+
69+
The Tool test client serves for debugging, primarily, ntb hardware and drivers.
70+
The Tool provides access through debugfs for reading, setting, and clearing the
71+
NTB doorbell, and reading and writing scratchpads.
72+
73+
The Tool does not currently have any module parameters.
74+
75+
Debugfs Files:
76+
77+
* *debugfs*/ntb\_tool/*hw*/ - A directory in debugfs will be created for each
78+
NTB device probed by the tool. This directory is shortened to *hw*
79+
below.
80+
* *hw*/db - This file is used to read, set, and clear the local doorbell. Not
81+
all operations may be supported by all hardware. To read the doorbell,
82+
read the file. To set the doorbell, write `s` followed by the bits to
83+
set (eg: `echo 's 0x0101' > db`). To clear the doorbell, write `c`
84+
followed by the bits to clear.
85+
* *hw*/mask - This file is used to read, set, and clear the local doorbell mask.
86+
See *db* for details.
87+
* *hw*/peer\_db - This file is used to read, set, and clear the peer doorbell.
88+
See *db* for details.
89+
* *hw*/peer\_mask - This file is used to read, set, and clear the peer doorbell
90+
mask. See *db* for details.
91+
* *hw*/spad - This file is used to read and write local scratchpads. To read
92+
the values of all scratchpads, read the file. To write values, write a
93+
series of pairs of scratchpad number and value
94+
(eg: `echo '4 0x123 7 0xabc' > spad`
95+
# to set scratchpads `4` and `7` to `0x123` and `0xabc`, respectively).
96+
* *hw*/peer\_spad - This file is used to read and write peer scratchpads. See
97+
*spad* for details.
98+
6799
## NTB Hardware Drivers
68100

69101
NTB hardware drivers should register devices with the NTB core driver. After

drivers/ntb/test/Kconfig

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,14 @@ config NTB_PINGPONG
66
your ntb hardware and drivers are functioning at a basic level.
77

88
If unsure, say N.
9+
10+
config NTB_TOOL
11+
tristate "NTB Debugging Tool Test Client"
12+
help
13+
This is a simple debugging driver that enables the doorbell and
14+
scratchpad registers to be read and written from the debugfs. This
15+
enables more complicated debugging to be scripted from user space.
16+
This driver may be used to test that your ntb hardware and drivers are
17+
functioning at a basic level.
18+
19+
If unsure, say N.

drivers/ntb/test/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
obj-$(CONFIG_NTB_PINGPONG) += ntb_pingpong.o
2+
obj-$(CONFIG_NTB_TOOL) += ntb_tool.o

0 commit comments

Comments
 (0)