Skip to content
  • Logan Gunthorpe's avatar
    ntb_tool: Postpone memory window initialization for the user · 717146a2
    Logan Gunthorpe authored
    
    
    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: default avatarLogan Gunthorpe <logang@deltatee.com>
    Acked-by: default avatarAllen Hubbe <Allen.Hubbe@emc.com>
    Signed-off-by: default avatarJon Mason <jdmason@kudzu.us>
    717146a2