Received: by 2002:a05:7412:8d09:b0:fa:4c10:6cad with SMTP id bj9csp531373rdb; Tue, 16 Jan 2024 07:52:01 -0800 (PST) X-Google-Smtp-Source: AGHT+IG5kuA0e0fLgvCUirYI43bvIMGCO8sCsjGvvSDooWRBMjwu5iupKMEqFJETErfqxxJ78/fW X-Received: by 2002:a17:907:1685:b0:a2e:9f1c:1b96 with SMTP id cx5-20020a170907168500b00a2e9f1c1b96mr120498ejd.80.1705420321294; Tue, 16 Jan 2024 07:52:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1705420321; cv=none; d=google.com; s=arc-20160816; b=HLknqrItOg2aTFP7W5lh7M2RDvwF7IWO6dosJhhgfvIrivjJCqE8X/oD4jvFjEmIPY Va6mY0r4zpNar7t7GzpIU4xxEaqSJVdOblxnd7Mt93Hx6A2+xwRnTSmZSfvG4g0wrfLz vd+SaFB+YVAFnVXpo3CWxVsKqVrtFRPDkeM28tG75/Bq0femrZolKz3EyJykvcjxuWEO xsplCCVQaembIhJg5ZHwsjw3kQISFaP7OMxkmJKKbNJCQD6v1udxnW/qiXCfks9NIbrD 4SbGTAOQDgMFQ9/8AnX4s3oGVxsWraCnrD+OMOjqeXZc67k//DOXQidmxzo4Js3gCBB3 jmvw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :user-agent:content-transfer-encoding:references:in-reply-to:date:cc :to:from:subject:message-id; bh=Vd1TYeQq0Xxgb4+4wdxdSpvEP0/JMGr78sHTf4vKukM=; fh=MMNpMS0jYCUm/XyqUFbGPkB4lpoWLaTJhV0aXVhS4/k=; b=el+6oojUI0UQ+CybLxoQxLd9Fz5N9HFmSlXqmKD5/LbFXCcaNgDqp0XbxgzJuYeE9v YqEkuYm+fU1R3KUU44FGnNS04Mv12xjYj2w50Zox0a8sUoF4r9lJ+KCEo3yw062RgqO9 XxZOU3lGtd0wMIQcG+6EokZBq/Elq3+r9/FE+lveFA/4RCAHFAEmZMIdxuPUFb33yHCk ZTvmwz7qPyO7G+pbnyuDNbZcoM2mN1wzwOlkoJP6LDONMEWOjdvDDW+2llyPQ6Rtk2l/ B+qeqQ+HQcduRts7N1LzpkrPEnMRUBKUTpkv7H+MNRj0I1UG7oO10GMMHSNv2HhAwMzF tRGQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-27541-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-27541-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id k26-20020a1709062a5a00b00a2d5b1f5220si2864443eje.392.2024.01.16.07.52.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Jan 2024 07:52:01 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-27541-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-27541-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-27541-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 110E31F23E04 for ; Tue, 16 Jan 2024 15:52:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 538971C69A; Tue, 16 Jan 2024 15:51:54 +0000 (UTC) Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [185.203.201.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 13D0C1C683 for ; Tue, 16 Jan 2024 15:51:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rPlj4-0003Dv-L9; Tue, 16 Jan 2024 16:51:42 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rPlj3-000H4W-Sb; Tue, 16 Jan 2024 16:51:41 +0100 Received: from localhost ([127.0.0.1]) by ptz.office.stw.pengutronix.de with esmtp (Exim 4.96) (envelope-from ) id 1rPlj3-0012XM-2I; Tue, 16 Jan 2024 16:51:41 +0100 Message-ID: <0aba51a8be0fb165b44ec956bec7a9698a9518a2.camel@pengutronix.de> Subject: Re: [PATCH 0/3] usb: gadget: 9pfs transport From: Jan =?ISO-8859-1?Q?L=FCbbe?= To: Dominique Martinet , Michael Grzeschik Cc: Latchesar Ionkov , linux-usb@vger.kernel.org, Jonathan Corbet , Greg Kroah-Hartman , v9fs@lists.linux.dev, Christian Schoenebeck , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, kernel@pengutronix.de, Eric Van Hensbergen Date: Tue, 16 Jan 2024 16:51:41 +0100 In-Reply-To: References: <20240116-ml-topic-u9p-v1-0-ad8c306f9a4e@pengutronix.de> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.50.2 (by Flathub.org) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: jlu@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org On Tue, 2024-01-16 at 20:45 +0900, Dominique Martinet wrote: > Michael Grzeschik wrote on Tue, Jan 16, 2024 at 02:49:40AM +0100: > > This series is adding support to mount 9pfs exported filesystems via th= e > > usb gadget interface. It also includes tools and descriptions on how to > > translate an tcp 9pfs and use it via the usb interface. >=20 > So I didn't have time to look at everything through, just want to make > sure, this series allows sharing data from an usb gadget (e.g. some > device with storage) over 9p as an alternative to things like MTP ? It's the other way around. :) The USB host exports a filesystem, while the gadget on the USB device side makes it mountable. Our main use-case is to u= se it as an alternative to NFS root booting during the development of embedded Li= nux devices. NFS root works in many cases, but has some downsides, which make i= t cumbersome to use in more and more cases. NFS root needs correctly configured Ethernet interfaces on both the develop= ment host and the target device. On the target, this can interfere with the netw= ork configuration that is used for the normal device operation (DHCP client, ..= ). For the host, configuring a NFS (and perhaps DHCP) server can be an obstacl= e. For target devices which don't have a real Ethernet interface, NFS root wou= ld also work with the USB Ethernet gadget, but this increases the complexity further. As many embedded boards have a USB device port anyway, which is used during development for uploading the boot-loader and to flash filesystem images (i= e. via the fastboot protocol), we want to just reuse that single data cable to allow access to the root filesystem as well.=20 Compared to flashing images, using a network filesystem like NFS and 9P red= uces the time between compiling on the host and running the binary on the target= , as no flash and reboot cycle is needed. That can get rid of many minutes of wa= iting over a day. :) > I don't quite understand what the forwarder and diod have to do with > this; you're emulating a fake usb device with the forwarder that just > transmits requests to diod as backend implementation? > But 'usb.core.find(idVendor=3D0x1D6B, idProduct=3D0x0109)' looks like it'= s > searching for a real device not creating one, so that doesn't seem to > match up... diod (9pfs server) and the forwarder are on the development host, where the= root filesystem is actually stored. The gadget is initialized during boot (or la= ter) on the embedded board. Then the forwarder will find it on the USB bus and s= tart forwarding requests. It may seem a bit unusual that in this case the requests come from the devi= ce and are handled by the host. The reason is that USB device ports are normal= ly not available on PCs, so a connection in the other direction would not work= . In the future, the functionality of the forwarder could be integrated into = the 9pfs server. Alternatively, an improved forwarder could also react to udev events of gadgets showing up and forward them to different 9PFS server over= the network (when you have multiple target devices connected to one USB host). Perhaps, the inverse setup (9PFS server on the USB gadget side, mounted on = a PC) also would be useful in the future and could share some of this code. Then, you'd have an alternative to MTP. > If you have any background information on where you're coming from and > where this is headed it'd be great to include in the cover letter. Yes. Probably also in Documentation/. Thanks, Jan