+145
−26
Loading
Currently copy between io buffer and SPDK ublk target buffer is done inside kernel `ublk_map_io()` or `ublk_unmap_io()`. This way performs very well in case of pre-allocated ublk target io buffer. For dynamically allocated io buffer, UBLK_F_NEED_GET_DATA is added for ublk target to provide buffer by one extra command communication for WRITE request. For READ, ublk target simply provides buffer, but can't know when the buffer is done in the kernel driver[1]. Commit dfae1900 workarounds this issue. UBLK_F_USER_COPY is added to kernel driver by moving io data copy out of kernel by providing read()/write() on /dev/ublkcN, and simply let ublk target do the io data copy. [1] Question about ublk and NEED_GET_DATA https://lore.kernel.org/linux-block/116d8a56-0881-56d3-9bcc-78ff3e1dc4e5@linux.alibaba.com/T/#m23bd4b8634c0a054e6797063167b469949a247bb Change-Id: I5ef584760ea42b28b3c46ecf02268904198b7269 Signed-off-by:Changpeng Liu <changpeng.liu@intel.com> Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/19042 Tested-by:
SPDK CI Jenkins <sys_sgci@intel.com> Community-CI: Mellanox Build Bot Reviewed-by:
Jim Harris <jim.harris@gmail.com> Reviewed-by:
Konrad Sztyber <konrad.sztyber@intel.com>