mbox series

[0/1] Zerocopy for USB Gadget FunctionFS

Message ID 20220118190849.22084-1-ingo.rohloff@lauterbach.com (mailing list archive)
Headers show
Series Zerocopy for USB Gadget FunctionFS | expand

Message

Ingo Rohloff Jan. 18, 2022, 7:08 p.m. UTC
The
commit f7d34b445abc00e979b7 ("USB: Add support for usbfs zerocopy.")
added support for zerocopy operations for an USB Host via devio.c

The idea is to mmap buffers into user space, which are then filled
with data (either by the kernel for reads or by the user for writes).

Using these mmapped buffers avoids copying data between 
kernel space and user space.

The proposed patch here, does the same for a USB Gadget and an 
application using USB FunctionFS.

The proposed patch keeps one big list of mmaped buffers for the
whole f_fs.c module, rather then binding them to a particular
file descriptor.
The rational behind this is, that you then might even pass around
buffers between different endpoints and even different functions.

If you want to test this patch, I have some demonstration code here:

   https://github.com/trace32/test_usb_ffs

so long
  Ingo

Ingo Rohloff (1):
  usb: gadget: f_fs: Support zerocopy transfers via mmap.

 drivers/usb/gadget/function/f_fs.c | 230 ++++++++++++++++++++++++++++-
 1 file changed, 226 insertions(+), 4 deletions(-)