Skip to content

Commit e69b6c0

Browse files
levy-amirdavem330
authored andcommitted
net: Add support for networking over Thunderbolt cable
ThunderboltIP is a protocol created by Apple to tunnel IP/ethernet traffic over a Thunderbolt cable. The protocol consists of configuration phase where each side sends ThunderboltIP login packets (the protocol is determined by UUID in the XDomain packet header) over the configuration channel. Once both sides get positive acknowledgment to their login packet, they configure high-speed DMA path accordingly. This DMA path is then used to transmit and receive networking traffic. This patch creates a virtual ethernet interface the host software can use in the same way as any other networking interface. Once the interface is brought up successfully network packets get tunneled over the Thunderbolt cable to the remote host and back. The connection is terminated by sending a ThunderboltIP logout packet over the configuration channel. We do this when the network interface is brought down by user or the driver is unloaded. Signed-off-by: Amir Levy <[email protected]> Signed-off-by: Michael Jamet <[email protected]> Signed-off-by: Mika Westerberg <[email protected]> Reviewed-by: Yehezkel Bernat <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 467cd25 commit e69b6c0

File tree

4 files changed

+1401
-0
lines changed

4 files changed

+1401
-0
lines changed

Documentation/admin-guide/thunderbolt.rst

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,3 +197,27 @@ information is missing.
197197

198198
To recover from this mode, one needs to flash a valid NVM image to the
199199
host host controller in the same way it is done in the previous chapter.
200+
201+
Networking over Thunderbolt cable
202+
---------------------------------
203+
Thunderbolt technology allows software communication across two hosts
204+
connected by a Thunderbolt cable.
205+
206+
It is possible to tunnel any kind of traffic over Thunderbolt link but
207+
currently we only support Apple ThunderboltIP protocol.
208+
209+
If the other host is running Windows or macOS only thing you need to
210+
do is to connect Thunderbolt cable between the two hosts, the
211+
``thunderbolt-net`` is loaded automatically. If the other host is also
212+
Linux you should load ``thunderbolt-net`` manually on one host (it does
213+
not matter which one)::
214+
215+
# modprobe thunderbolt-net
216+
217+
This triggers module load on the other host automatically. If the driver
218+
is built-in to the kernel image, there is no need to do anything.
219+
220+
The driver will create one virtual ethernet interface per Thunderbolt
221+
port which are named like ``thunderbolt0`` and so on. From this point
222+
you can either use standard userspace tools like ``ifconfig`` to
223+
configure the interface or let your GUI to handle it automatically.

drivers/net/Kconfig

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -483,6 +483,18 @@ config FUJITSU_ES
483483
This driver provides support for Extended Socket network device
484484
on Extended Partitioning of FUJITSU PRIMEQUEST 2000 E2 series.
485485

486+
config THUNDERBOLT_NET
487+
tristate "Networking over Thunderbolt cable"
488+
depends on THUNDERBOLT && INET
489+
help
490+
Select this if you want to create network between two
491+
computers over a Thunderbolt cable. The driver supports Apple
492+
ThunderboltIP protocol and allows communication with any host
493+
supporting the same protocol including Windows and macOS.
494+
495+
To compile this driver a module, choose M here. The module will be
496+
called thunderbolt-net.
497+
486498
source "drivers/net/hyperv/Kconfig"
487499

488500
endif # NETDEVICES

drivers/net/Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,3 +74,6 @@ obj-$(CONFIG_HYPERV_NET) += hyperv/
7474
obj-$(CONFIG_NTB_NETDEV) += ntb_netdev.o
7575

7676
obj-$(CONFIG_FUJITSU_ES) += fjes/
77+
78+
thunderbolt-net-y += thunderbolt.o
79+
obj-$(CONFIG_THUNDERBOLT_NET) += thunderbolt-net.o

0 commit comments

Comments
 (0)