Skip to content

Commit

Permalink
net/9p/usbg: Add new usb gadget function transport
Browse files Browse the repository at this point in the history
Add the new gadget function for 9pfs transport. This function is
defining an simple 9pfs transport interface that consists of one in and
one out endpoint. The endpoints transmit and receive the 9pfs protocol
payload when mounting a 9p filesystem over usb.

Tested-by: Andrzej Pietrasiewicz <andrzej.p@collabora.com>
Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
Link: https://lore.kernel.org/r/20240116-ml-topic-u9p-v12-2-9a27de5160e0@pengutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Michael Grzeschik authored and Greg Kroah-Hartman committed Sep 3, 2024
1 parent d9c61bb commit a3be076
Show file tree
Hide file tree
Showing 4 changed files with 982 additions and 1 deletion.
17 changes: 16 additions & 1 deletion Documentation/filesystems/9p.rst
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,25 @@ For server running on QEMU host with virtio transport::

mount -t 9p -o trans=virtio <mount_tag> /mnt/9

where mount_tag is the tag associated by the server to each of the exported
where mount_tag is the tag generated by the server to each of the exported
mount points. Each 9P export is seen by the client as a virtio device with an
associated "mount_tag" property. Available mount tags can be
seen by reading /sys/bus/virtio/drivers/9pnet_virtio/virtio<n>/mount_tag files.

USBG Usage
==========

To mount a 9p FS on a USB Host accessible via the gadget at runtime::

mount -t 9p -o trans=usbg,aname=/path/to/fs <device> /mnt/9

To mount a 9p FS on a USB Host accessible via the gadget as root filesystem::

root=<device> rootfstype=9p rootflags=trans=usbg,cache=loose,uname=root,access=0,dfltuid=0,dfltgid=0,aname=/path/to/rootfs

where <device> is the tag associated by the usb gadget transport.
It is defined by the configfs instance name.

Options
=======

Expand All @@ -68,6 +82,7 @@ Options
virtio connect to the next virtio channel available
(from QEMU with trans_virtio module)
rdma connect to a specified RDMA channel
usbg connect to a specified usb gadget channel
======== ============================================

uname=name user name to attempt mount as on the remote server. The
Expand Down
6 changes: 6 additions & 0 deletions net/9p/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@ config NET_9P_XEN
This builds support for a transport for 9pfs between
two Xen domains.

config NET_9P_USBG
bool "9P USB Gadget Transport"
depends on USB_GADGET
help
This builds support for a transport for 9pfs over
usb gadget.

config NET_9P_RDMA
depends on INET && INFINIBAND && INFINIBAND_ADDR_TRANS
Expand Down
4 changes: 4 additions & 0 deletions net/9p/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ obj-$(CONFIG_NET_9P_FD) += 9pnet_fd.o
obj-$(CONFIG_NET_9P_XEN) += 9pnet_xen.o
obj-$(CONFIG_NET_9P_VIRTIO) += 9pnet_virtio.o
obj-$(CONFIG_NET_9P_RDMA) += 9pnet_rdma.o
obj-$(CONFIG_NET_9P_USBG) += 9pnet_usbg.o

9pnet-objs := \
mod.o \
Expand All @@ -23,3 +24,6 @@ obj-$(CONFIG_NET_9P_RDMA) += 9pnet_rdma.o

9pnet_rdma-objs := \
trans_rdma.o \

9pnet_usbg-objs := \
trans_usbg.o \
Loading

0 comments on commit a3be076

Please sign in to comment.