From: Mika Westerberg <mika.westerberg@linux.intel.com>
To: linux-usb@vger.kernel.org
Cc: Yehezkel Bernat <YehezkelShB@gmail.com>,
Lukas Wunner <lukas@wunner.de>,
Andreas Noever <andreas.noever@gmail.com>,
Alan Borzeszkowski <alan.borzeszkowski@linux.intel.com>,
Andrew Lunn <andrew+netdev@lunn.ch>,
Jonathan Corbet <corbet@lwn.net>,
Shuah Khan <skhan@linuxfoundation.org>,
"David S . Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Mika Westerberg <mika.westerberg@linux.intel.com>
Subject: [PATCH v2 10/10] docs: admin-guide: thunderbolt: Add instructions how to use USB4STREAM
Date: Mon, 11 May 2026 12:27:44 +0200 [thread overview]
Message-ID: <20260511102744.1867485-11-mika.westerberg@linux.intel.com> (raw)
In-Reply-To: <20260511102744.1867485-1-mika.westerberg@linux.intel.com>
Add instructions how USB4STREAM can be configured and used.
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
---
Documentation/admin-guide/thunderbolt.rst | 61 +++++++++++++++++++++++
1 file changed, 61 insertions(+)
diff --git a/Documentation/admin-guide/thunderbolt.rst b/Documentation/admin-guide/thunderbolt.rst
index 89df26553aa0..91a6cb109988 100644
--- a/Documentation/admin-guide/thunderbolt.rst
+++ b/Documentation/admin-guide/thunderbolt.rst
@@ -373,6 +373,67 @@ port which are named like ``thunderbolt0`` and so on. From this point
you can either use standard userspace tools like ``ip`` to
configure the interface or let your GUI handle it automatically.
+Streaming data directly over Thunderbolt cable
+----------------------------------------------
+In addition to Thunderbolt networking (aka. USB4NET) Linux supports
+streaming data directly over a cable as well (aka. USB4STREAM). This is
+possible through ``thunderbolt-stream`` driver.
+
+Similarly to ``thunderbolt-net`` you load the driver first on one end::
+
+ host1 # modprobe thunderbolt-stream
+
+Then you configure it via ``ConfigFS``::
+
+ host1 # cd /sys/kernel/config/thunderbolt/stream
+ host1 # mkdir -p 0-1.0/data
+ host1 # cd 0-1.0
+ host1 # echo -1 > data/in_hopid
+ host1 # echo -1 > data/out_hopid
+
+This information is automatically announced to the other side via
+XDomain properties so if you have cable connected the other side knows
+that there is a stream named ``data`` available and can configure it for
+you automatically::
+
+ host2 # cd /sys/kernel/config/thunderbolt/stream
+ host2 # mkdir -p 0-3.0/data
+
+Here we used auto-configuration but you can configure it manually too.
+In that case you need to fill ``in_hopid`` and ``out_hopid`` accordingly.
+If you set them to ``-1`` the next available HopID is used which is
+typically what we want.
+
+Once they are configured you can use ``/dev/tbstreamX`` on both sides to
+transfer data::
+
+ host2 # cat /dev/tbstream0
+ host1 # dmesg > /dev/tbstream0
+
+Once you are done with the stream you can remove them::
+
+ host2 # cd /sys/kernel/config/thunderbolt/stream
+ host2 # rmdir -p 0-1.0/data
+ host1 # cd /sys/kernel/config/thunderbolt/stream
+ host1 # rmdir -p 0-3.0/data
+
+Since streams are essentially files you can use any existing application
+that supports ``read(2)`` and ``write(2)`` in some form.
+
+It is possible to have more than one stream and you can have both stream
+and ``thunderbolt-net`` in use simultaneously. For example we can create
+two streams with name ``control`` and ``data`` like this::
+
+ host1 # cd /sys/kernel/config/thunderbolt/stream
+ host1 # mkdir 0-1.0
+ host1 # cd 0-1.0
+ host1 # mkdir control
+ host1 # mkdir data
+
+Then you have ``/dev/tbstream0`` for ``control`` and ``/dev/tbstream1``
+for ``data``. Before you can use them you need to configure them as
+shown above for the one stream case.
+
Forcing power
-------------
Many OEMs include a method that can be used to force the power of a
--
2.50.1
prev parent reply other threads:[~2026-05-11 10:27 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-11 10:27 [PATCH v2 00/10] thunderbolt: Introduce USB4STREAM Mika Westerberg
2026-05-11 10:27 ` [PATCH v2 01/10] thunderbolt: Add tb_property_merge_dir() Mika Westerberg
2026-05-11 10:27 ` [PATCH v2 02/10] thunderbolt: Add KUnit test for tb_property_merge_dir() Mika Westerberg
2026-05-11 10:27 ` [PATCH v2 03/10] thunderbolt: Allow service drivers to specify their own properties Mika Westerberg
2026-05-11 10:27 ` [PATCH v2 04/10] thunderbolt / net: Move ring_frame_size() to thunderbolt.h Mika Westerberg
2026-05-11 10:27 ` [PATCH v2 05/10] thunderbolt / net: Let the service drivers configure interrupt throttling Mika Westerberg
2026-05-11 10:27 ` [PATCH v2 06/10] thunderbolt: Add helper to figure size of the ring Mika Westerberg
2026-05-11 10:27 ` [PATCH v2 07/10] thunderbolt: Add tb_ring_flush() Mika Westerberg
2026-05-11 10:27 ` [PATCH v2 08/10] thunderbolt: Add support for ConfigFS Mika Westerberg
2026-05-11 10:27 ` [PATCH v2 09/10] thunderbolt: Add support for USB4STREAM Mika Westerberg
2026-05-11 10:27 ` Mika Westerberg [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260511102744.1867485-11-mika.westerberg@linux.intel.com \
--to=mika.westerberg@linux.intel.com \
--cc=YehezkelShB@gmail.com \
--cc=alan.borzeszkowski@linux.intel.com \
--cc=andreas.noever@gmail.com \
--cc=andrew+netdev@lunn.ch \
--cc=corbet@lwn.net \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=gregkh@linuxfoundation.org \
--cc=kuba@kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=lukas@wunner.de \
--cc=pabeni@redhat.com \
--cc=skhan@linuxfoundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox