[lkml]   [2022]   [Jun]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Subject[PATCH 0/6] VDUSE: Support registering userspace memory as bounce buffer
Hi all,

This series introduces some new ioctls: VDUSE_IOTLB_GET_INFO,
registering and de-registering userspace memory for IOTLB
as bounce buffer in virtio-vdpa case.

The VDUSE_IOTLB_GET_INFO ioctl can help user to query IOLTB
information such as bounce buffer size. Then user can use
those information on VDUSE_IOTLB_REG_UMEM and
VDUSE_IOTLB_DEREG_UMEM ioctls to register and de-register
userspace memory for IOTLB.

During registering and de-registering, the DMA data in use
would be copied from kernel bounce pages to userspace bounce
pages and back.

With this feature, some existing application such as SPDK
and DPDK can leverage the datapath of VDUSE directly and
efficiently as discussed before [1]. They can register some
preallocated hugepages to VDUSE to avoid an extra memcpy
from bounce-buffer to hugepages.

The kernel and userspace codes could be found in github:

To test it with qemu-storage-daemon:

$ qemu-storage-daemon \
--chardev socket,id=charmonitor,path=/tmp/qmp.sock,server=on,wait=off \
--monitor chardev=charmonitor \
--blockdev driver=host_device,,aio=native,filename=/dev/nullb0,node-name=disk0 \
--export type=vduse-blk,id=vduse-test,name=vduse-test,node-name=disk0,writable=on


Please review, thanks!

Xie Yongji (6):
vduse: Remove unnecessary spin lock protection
vduse: Use memcpy_{to,from}_page() in do_bounce()
vduse: Support using userspace pages as bounce buffer
vduse: Support querying IOLTB information
vduse: Support registering userspace memory for IOTLB
vduse: Update api version to 1

drivers/vdpa/vdpa_user/iova_domain.c | 134 +++++++++++++++++++---
drivers/vdpa/vdpa_user/iova_domain.h | 9 ++
drivers/vdpa/vdpa_user/vduse_dev.c | 163 +++++++++++++++++++++++++++
include/uapi/linux/vduse.h | 53 ++++++++-
4 files changed, 345 insertions(+), 14 deletions(-)


 \ /
  Last update: 2022-06-29 10:27    [W:0.085 / U:0.612 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site