public inbox for linux-doc@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 0/4] usb: gadget: functionfs: DMABUF import interface
@ 2024-01-08 12:00 Paul Cercueil
  2024-01-08 12:00 ` [PATCH v3 1/4] usb: gadget: Support already-mapped DMA SGs Paul Cercueil
                   ` (3 more replies)
  0 siblings, 4 replies; 20+ messages in thread
From: Paul Cercueil @ 2024-01-08 12:00 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Sumit Semwal, Christian König,
	Jonathan Corbet
  Cc: Jonathan Cameron, Nuno Sá, Michael Hennerich,
	Andrzej Pietrasiewicz, linux-usb, linux-doc, linux-kernel,
	linux-media, dri-devel, linaro-mm-sig, Paul Cercueil

Hi,

This small patchset adds three new IOCTLs that can be used to attach,
detach, or transfer from/to a DMABUF object.

This interface is being used at Analog Devices, to transfer data from
high-speed transceivers to USB in a zero-copy fashion, using also the
DMABUF import interface to the IIO subsystem which is being upstreamed
in parallel [1] (and has high chances to be accepted for 5.9, I think
Jonathan can confirm). The two are used by the Libiio software [2].

On a ZCU102 board with a FMComms3 daughter board, using the combination
of these two new interfaces yields a drastic improvement of the
throughput, from about 127 MiB/s using IIO's buffer read/write interface
+ read/write to the FunctionFS endpoints, to about 274 MiB/s when
passing around DMABUFs, for a lower CPU usage (0.85 load avg. before,
vs. 0.65 after).

Right now, *technically* there are no users of this interface, as
Analog Devices wants to wait until both interfaces are accepted upstream
to merge the DMABUF code in Libiio into the main branch, and Jonathan
wants to wait and see if this patchset is accepted to greenlight the
DMABUF interface in IIO as well. I think this isn't really a problem;
once everybody is happy with its part of the cake, we can merge them all
at once.

This is obviously for 5.9, and based on next-20240108.

Changelog:

- [3/4]:
  - Inline to_ffs_dma_fence() which was called only once.
  - Simplify ffs_dma_resv_lock()
  - Add comment explaining why we unref twice in ffs_dmabuf_detach()
  - Document uapi struct usb_ffs_dmabuf_transfer_req and IOCTLs
- [4/4]: New patch, as I figured out having documentation wouldn't hurt.

Cheers,
-Paul

[1] https://lore.kernel.org/linux-iio/219abc43b4fdd4a13b307ed2efaa0e6869e68e3f.camel@gmail.com/T/
[2] https://github.com/analogdevicesinc/libiio/tree/pcercuei/dev-new-dmabuf-api

Paul Cercueil (4):
  usb: gadget: Support already-mapped DMA SGs
  usb: gadget: functionfs: Factorize wait-for-endpoint code
  usb: gadget: functionfs: Add DMABUF import interface
  Documentation: usb: Document FunctionFS DMABUF API

 Documentation/usb/functionfs.rst    |  36 +++
 drivers/usb/gadget/function/f_fs.c  | 463 ++++++++++++++++++++++++++--
 drivers/usb/gadget/udc/core.c       |   7 +-
 include/linux/usb/gadget.h          |   2 +
 include/uapi/linux/usb/functionfs.h |  41 +++
 5 files changed, 528 insertions(+), 21 deletions(-)

-- 
2.43.0


^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2024-01-18 21:05 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-08 12:00 [PATCH v3 0/4] usb: gadget: functionfs: DMABUF import interface Paul Cercueil
2024-01-08 12:00 ` [PATCH v3 1/4] usb: gadget: Support already-mapped DMA SGs Paul Cercueil
2024-01-08 12:00 ` [PATCH v3 2/4] usb: gadget: functionfs: Factorize wait-for-endpoint code Paul Cercueil
2024-01-08 12:00 ` [PATCH v3 3/4] usb: gadget: functionfs: Add DMABUF import interface Paul Cercueil
2024-01-08 12:28   ` Christian König
2024-01-08 12:39   ` Daniel Vetter
2024-01-08 14:21     ` Paul Cercueil
2024-01-08 15:29       ` Daniel Vetter
2024-01-08 16:27         ` Paul Cercueil
2024-01-08 19:19           ` Daniel Vetter
2024-01-09 11:06             ` Paul Cercueil
2024-01-09 13:01               ` Daniel Vetter
2024-01-15 12:54                 ` Paul Cercueil
2024-01-18 13:56                   ` Daniel Vetter
2024-01-18 13:59                     ` Daniel Vetter
2024-01-18 19:39                       ` Paul Cercueil
2024-01-18 21:05                         ` Daniel Vetter
2024-01-08 12:00 ` [PATCH v3 4/4] Documentation: usb: Document FunctionFS DMABUF API Paul Cercueil
2024-01-09 13:08   ` Vegard Nossum
2024-01-17 12:09     ` Paul Cercueil

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox