Received: by 2002:ab2:3141:0:b0:1ed:23cc:44d1 with SMTP id i1csp242588lqg; Fri, 1 Mar 2024 04:06:22 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVJaPDU7IZWZHdnMjmtZJ4mOeD6SfRoBVlb1CmhN6X+pfTKKiMQtAW0CuI2RAG2F17O75/DYmAl9TS34vFsUldDnb/Y3KGF9YHcazBA2A== X-Google-Smtp-Source: AGHT+IF5RZGwrdL+b+WZx/mGypOT0IC4yHApUR0DZCtaIeEGQguDuxecM9lOYDHSO9TxUzoUSeA+ X-Received: by 2002:a17:906:a90:b0:a44:6b6b:baf4 with SMTP id y16-20020a1709060a9000b00a446b6bbaf4mr1001707ejf.34.1709294782470; Fri, 01 Mar 2024 04:06:22 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709294782; cv=pass; d=google.com; s=arc-20160816; b=UysxWApGMaH/CLeXxivxMEwNTpOR+KXDI+BSetajbiObHgTRw1JR+T3nzBOgG1UQi4 7IkBZZ1lKdKkkoKCJS6e+GuwuWiZGy9h6teaRoi5yRb+WxApkSryXqEEoTd+i6CJK/9I rdQ8TCE88xFxTx7O/iejL8/VZqnwsXEZBv4kZ+o3YL8ua5+IT+F5rZsbp4/t4VVMPUPB jI//WOC0gWmvxeviMr+zpt3AXGC9lJaAwJDdxIjmyv89GZqxu6xdCVmNuot2GWkoAaKr j9HHA2uNTpdZvUt+NCLcO9tPn1WU6kCO4/UPwNk8O5p4sQT2pjM/t5Mlgj/Jr+nXl47E CK/A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=7R2qkVXY3upQu7yWaeS3qG8IDkeHBdby7qsep+v9bAo=; fh=dNWGVLSUjSMVQqcKAC5ZCNMCDSXbzeU8expYF11u+vo=; b=P8c8UhER+WnwArnJE6kHkbpS1oW6cEa2bbuISYPqLxMNO+lSsyo9WS5DcnwFvrMeLW P7BxRXj6225phYQpk+sdep/kx2ZXSwoHcT6Rqe/v35fuXWxXdXUt9asMb7p+DVwzv9FP pmUqKmKwzlT29faMXtRj71Uf4OsF9CTn9YqlCXbyc8Y/aSOu48OLw8xLN1IKEFio9GDZ kLv7eRxyiwZtfsDOOVpFL6V8vwluLf2y5hHcdeJHxFENT9ArjkGWA8pyiXBhZe7v7m8r 7xk4kGO7Nay0OJjmq61J3lxHj2rDiqU70jFIlOv57NJ8CI/6tTr8XWGVUtJ3+jIMUkUA Y0JA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=JIgnldDX; arc=pass (i=1 spf=pass spfdomain=collabora.com dkim=pass dkdomain=collabora.com dmarc=pass fromdomain=collabora.com); spf=pass (google.com: domain of linux-kernel+bounces-88383-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-88383-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id m15-20020a1709066d0f00b00a44953b931bsi370865ejr.297.2024.03.01.04.06.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Mar 2024 04:06:22 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-88383-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; dkim=pass header.i=@collabora.com header.s=mail header.b=JIgnldDX; arc=pass (i=1 spf=pass spfdomain=collabora.com dkim=pass dkdomain=collabora.com dmarc=pass fromdomain=collabora.com); spf=pass (google.com: domain of linux-kernel+bounces-88383-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-88383-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com 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 0B5231F237F1 for ; Fri, 1 Mar 2024 12:06:22 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 24B886DCF5; Fri, 1 Mar 2024 12:06:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="JIgnldDX" Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [46.235.227.194]) (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 60BB26CDB8; Fri, 1 Mar 2024 12:06:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=46.235.227.194 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709294769; cv=none; b=EgYRlqw98a9UwTKKfBb/w5JedxKc4Y637Y/hWLt6Y8LEsb6Kt4woz6R7BfPdzluojyDsI58vLujtXvB2ZjOjCUyoQ72udMH6X1oUdBdcf0VOgSSLK7uGBUQiCmTHzjx/2vrjEa+cHPPvxg6GTD/Fusn+Akvhwj/sEYN2bMr/J9k= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709294769; c=relaxed/simple; bh=VfJLA+apQ2y27CyTOnJ6ONaS3IDWYlPAkRiDGThMQtE=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=GGRgfy05Qz7DbpqRgSJ1utMxcqng4Cbga0RHaffFQ97vUfvrUWs4z5PsakTysqEd9Qu4ge8uow50DPrc2zPxc6BRcCD912Cf9EYfgldQnWCSlYLXX4/F+2H1I/H6XvCP+fy1PNMDBEWpMmIqacXSJzfiZy91IW6Z4GFtY3QJllw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=JIgnldDX; arc=none smtp.client-ip=46.235.227.194 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1709294764; bh=VfJLA+apQ2y27CyTOnJ6ONaS3IDWYlPAkRiDGThMQtE=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=JIgnldDXK8GgmRbTZW0t8M8yH3HcNouSz/z+AgCcAlJ6WH2eCNhX8pdb8NWeIOI6k G+0yhyFtYrPCMoTIuM4nfU/ltgK6fkXODsaCVArpsxqZfYHw9z7SFQc/3oXL21Abf9 06Ghc2KAfDIIZwJcreZjySyr7HlrM2L3qq10fS5mJlSHt++IRAwLoQq4zCfGeiMLXI qd3NHReHyscDhqtrDjT+ZO3kQ4GcsWIpYLyGudUF+AwpnM0KNkR4R/NDDLdrIex6+T vzQVJuEuMNR+e4uGi+/7HmgQhxe1BtY+J0P3TkPBZe0OdB4Kd1ynjUcfHavlXZB4MC /Tr0Dmkchc2YQ== Received: from [100.95.196.182] (cola.collaboradmins.com [195.201.22.229]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: andrzej.p) by madrid.collaboradmins.com (Postfix) with ESMTPSA id EBC623780EC6; Fri, 1 Mar 2024 12:06:03 +0000 (UTC) Message-ID: <9581f66e-dc3a-495b-bacb-30908a78a773@collabora.com> Date: Fri, 1 Mar 2024 13:06:03 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3 0/3] usb: gadget: 9pfs transport To: Michael Grzeschik , Eric Van Hensbergen , Latchesar Ionkov , Dominique Martinet , Christian Schoenebeck , Jonathan Corbet , Greg Kroah-Hartman Cc: v9fs@lists.linux.dev, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, kernel@pengutronix.de References: <20240116-ml-topic-u9p-v3-0-c62a36eccda1@pengutronix.de> Content-Language: en-US From: Andrzej Pietrasiewicz In-Reply-To: <20240116-ml-topic-u9p-v3-0-c62a36eccda1@pengutronix.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Hi Michael, W dniu 26.02.2024 o 14:56, Michael Grzeschik pisze: > This series is adding support to mount usb hostside exported 9pfs > filesystems via the usb gadget interface. It also includes a simple tool > (p9_fwd.py) to translate an tcp 9pfs transport and reuse it via the usb > interface. > > +--------------------------+ | +--------------------------+ > | 9PFS mounting client | | | 9PFS exporting server | > SW | | | | | > | (this:trans_usbg) | | |(e.g. diod or nfs-ganesha)| > +-------------^------------+ | +-------------^------------+ > | | | > | | +------v------+ > | | | p9_fwd.py | > | | +------^------+ > | | | > ------------------|------------------------------------|------------- > | | | > +-------------v------------+ | +-------------v------------+ > | | | | | > HW | USB Device Controller <---------> USB Host Controller | > | | | | | > +--------------------------+ | +--------------------------+ > > The USB host exports a filesystem, while the gadget on the USB device > side makes it mountable. > > 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 later) on the embedded board. Then the forwarder will find it > on the USB bus and start forwarding requests. > > In this case the 9p requests come from the device and are handled by the > host. The reason is that USB device ports are normally not available on > PCs, so a connection in the other direction would not work. > > One use-case is to use it as an alternative to NFS root booting during > the development of embedded Linux devices. > > Signed-off-by: Michael Grzeschik > --- > Changes in v3: > - dropped patch "usb: gadget: legacy: add 9pfs multi gadget" as discussed with gregkh I will give the dropped patch a try to see how it works, as it should work the same way regardless of how the gadget is composed, legacy or configfs. Speaking of the latter, IMO there _are_ valid usecases other than having 9pfs rootfs, so configfs support should be there. If you intend to send the patches adding configfs support then kindly Cc me and I will test and review it for you. Regards, Andrzej > - Link to v2: https://lore.kernel.org/r/20240116-ml-topic-u9p-v2-0-b46cbf592962@pengutronix.de > > Changes in v2: > - improved the commit messages > - introduced an patch to move the header u_f.h to include/linux/usb to compile usb gadget functions treewide > - moved usbg gadget function to net/9p/ > - adderessed several comments in function driver, like the cleanup path and kbuild errors > - improved the documentation in Documentation/filesystems/9p.rst > - Link to v1: https://lore.kernel.org/r/20240116-ml-topic-u9p-v1-0-ad8c306f9a4e@pengutronix.de > > --- > Michael Grzeschik (3): > usb: gadget: function: move u_f.h to include/linux/usb/ > net/9p/usbg: Add new usb gadget function transport > tools: usb: p9_fwd: add usb gadget packet forwarder script > > Documentation/filesystems/9p.rst | 47 ++ > drivers/usb/gadget/configfs.c | 2 +- > drivers/usb/gadget/function/f_fs.c | 2 +- > drivers/usb/gadget/function/f_hid.c | 2 +- > drivers/usb/gadget/function/f_loopback.c | 2 +- > drivers/usb/gadget/function/f_midi.c | 2 +- > drivers/usb/gadget/function/f_midi2.c | 2 +- > drivers/usb/gadget/function/f_sourcesink.c | 2 +- > drivers/usb/gadget/u_f.c | 2 +- > {drivers/usb/gadget => include/linux/usb}/u_f.h | 0 > net/9p/Kconfig | 6 + > net/9p/Makefile | 4 + > net/9p/trans_usbg.c | 871 ++++++++++++++++++++++++ > tools/usb/p9_fwd.py | 194 ++++++ > 14 files changed, 1130 insertions(+), 8 deletions(-) > --- > base-commit: 41bccc98fb7931d63d03f326a746ac4d429c1dd3 > change-id: 20240116-ml-topic-u9p-895274530eb1 > > Best regards,