Skip to content

Commit

Permalink
NTB: Add tool test client
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
Allen Hubbe authored and jonmason committed Jul 4, 2015
1 parent 963de47 commit 578b881
Show file tree
Hide file tree
Showing 4 changed files with 600 additions and 0 deletions.
32 changes: 32 additions & 0 deletions Documentation/ntb.txt
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,38 @@ Module Parameters:
* dyndbg - It is suggested to specify dyndbg=+p when loading this module, and
then to observe debugging output on the console.

### NTB Tool Test Client (ntb\_tool)

The Tool test client serves for debugging, primarily, ntb hardware and drivers.
The Tool provides access through debugfs for reading, setting, and clearing the
NTB doorbell, and reading and writing scratchpads.

The Tool does not currently have any module parameters.

Debugfs Files:

* *debugfs*/ntb\_tool/*hw*/ - A directory in debugfs will be created for each
NTB device probed by the tool. This directory is shortened to *hw*
below.
* *hw*/db - This file is used to read, set, and clear the local doorbell. Not
all operations may be supported by all hardware. To read the doorbell,
read the file. To set the doorbell, write `s` followed by the bits to
set (eg: `echo 's 0x0101' > db`). To clear the doorbell, write `c`
followed by the bits to clear.
* *hw*/mask - This file is used to read, set, and clear the local doorbell mask.
See *db* for details.
* *hw*/peer\_db - This file is used to read, set, and clear the peer doorbell.
See *db* for details.
* *hw*/peer\_mask - This file is used to read, set, and clear the peer doorbell
mask. See *db* for details.
* *hw*/spad - This file is used to read and write local scratchpads. To read
the values of all scratchpads, read the file. To write values, write a
series of pairs of scratchpad number and value
(eg: `echo '4 0x123 7 0xabc' > spad`
# to set scratchpads `4` and `7` to `0x123` and `0xabc`, respectively).
* *hw*/peer\_spad - This file is used to read and write peer scratchpads. See
*spad* for details.

## NTB Hardware Drivers

NTB hardware drivers should register devices with the NTB core driver. After
Expand Down
11 changes: 11 additions & 0 deletions drivers/ntb/test/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,14 @@ config NTB_PINGPONG
your ntb hardware and drivers are functioning at a basic level.

If unsure, say N.

config NTB_TOOL
tristate "NTB Debugging Tool Test Client"
help
This is a simple debugging driver that enables the doorbell and
scratchpad registers to be read and written from the debugfs. This
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.

If unsure, say N.
1 change: 1 addition & 0 deletions drivers/ntb/test/Makefile
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
obj-$(CONFIG_NTB_PINGPONG) += ntb_pingpong.o
obj-$(CONFIG_NTB_TOOL) += ntb_tool.o
Loading

0 comments on commit 578b881

Please sign in to comment.