• Yuri Nudelman's avatar
    habanalabs: unified memory manager infrastructure · babe8e7c
    Yuri Nudelman authored
    This is a part of overall refactoring attempt to separate nic and the
    core drivers.
    Currently, there are 4 different flows, that contain very similar code.
    These are the ts, nic, hwblocks and cb alloc/map flows. The similar
    aspect of all these flows is that they all contain a central store, with
    memory buffers inside, supporting the following set of operations:
    
    - Allocate buffer and return handle
    - Get buffer from the store with handle
    - Put the buffer (last put releases the buffer)
    - Map the buffer to the user
    
    This patch contains a generic data structure used to implement the above
    memory buffer store interface. Conversion of the existing code to use
    the new data structure will follow.
    Signed-off-by: default avatarYuri Nudelman <ynudelman@habana.ai>
    Reviewed-by: default avatarOded Gabbay <ogabbay@kernel.org>
    Signed-off-by: default avatarOded Gabbay <ogabbay@kernel.org>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    babe8e7c
memory_mgr.c 6.55 KB