]> git.baikalelectronics.ru Git - kernel.git/commit
ntb_tool: Postpone memory window initialization for the user
authorLogan Gunthorpe <logang@deltatee.com>
Mon, 20 Jun 2016 19:15:09 +0000 (13:15 -0600)
committerJon Mason <jdmason@kudzu.us>
Fri, 5 Aug 2016 14:21:07 +0000 (10:21 -0400)
commit18280b52d7813451756e131a31becc8b68ac0641
tree46e4f9b227ba9a604b5ba298e29198cf6ce9ab77
parent6a54f3b5e59cbdbaeae2ea52f6e275a27f4a1641
ntb_tool: Postpone memory window initialization for the user

In order to make the interface closer to the raw NTB API, this commit
changes memory windows so they are not initialized on link up.
Instead, the 'peer_trans*' debugfs files are introduced. When read,
they return information provided by ntb_mw_get_range. When written,
they create a buffer and initialize the memory window. The
value written is taken as the requested size of the buffer (which
is then rounded for alignment). Writing a value of zero frees the buffer
and tears down the memory window translation. The 'peer_mw*' file is
only created once the memory window translation is setup by the user.

Additionally, it was noticed that the read and write functions for the
'peer_mw*' files should have checked for a NULL pointer.

Signed-off-by: Logan Gunthorpe <logang@deltatee.com>
Acked-by: Allen Hubbe <Allen.Hubbe@emc.com>
Signed-off-by: Jon Mason <jdmason@kudzu.us>
drivers/ntb/test/ntb_tool.c