History log of /linux-master/drivers/thunderbolt/dma_test.c
Revision Date Author Comments
# 7b304040 18-Sep-2023 Mika Westerberg <mika.westerberg@linux.intel.com>

thunderbolt: dma_test: Use enum tb_link_width

Since we have it, use it in the DMA test driver as well.

Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>


# e111fb92 29-Sep-2022 Gil Fine <gil.fine@intel.com>

thunderbolt: Add support for USB4 v2 80 Gb/s link

USB4 v2 bumps the per-lane speed up to 40 Gb/s. Also the lanes are
always bonded which gives 80 Gb/s symmetric link (and 120/40 Gb/s
asymmetric). This updates the speed and width of routers and XDomain
connections to support the Gen 4 link. For now we keep the link as is
even if it is already asymmetric.

While there make tb_port_set_link_width() static.

Signed-off-by: Gil Fine <gil.fine@intel.com>
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>


# 88a9ded9 24-Mar-2023 Mika Westerberg <mika.westerberg@linux.intel.com>

thunderbolt: dma_test: Update MODULE_DESCRIPTION

Make the description match the core driver and the networking with
Thunderbolt/USB4 prefix. No functional changes.

Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>


# 70c2e03e 29-Mar-2023 Mika Westerberg <mika.westerberg@linux.intel.com>

thunderbolt: dma_test: Use correct value for absent rings when creating paths

Both tb_xdomain_enable_paths() and tb_xdomain_disable_paths() expect -1,
not 0, if the corresponding ring is not needed. For this reason change
the driver to use correct value for the rings that are not needed.

Fixes: 180b0689425c ("thunderbolt: Allow multiple DMA tunnels over a single XDomain connection")
Cc: stable@vger.kernel.org
Reported-by: Pengfei Xu <pengfei.xu@intel.com>
Tested-by: Pengfei Xu <pengfei.xu@intel.com>
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>


# 180b0689 08-Jan-2021 Mika Westerberg <mika.westerberg@linux.intel.com>

thunderbolt: Allow multiple DMA tunnels over a single XDomain connection

Currently we have had an artificial limitation of a single DMA tunnel
per XDomain connection. However, hardware wise there is no such limit
and software based connection manager can take advantage of all the DMA
rings available on the host to establish tunnels.

For this reason make the tb_xdomain_[enable|disable]_paths() to take the
DMA ring and HopID as parameter instead of storing them in the struct
tb_xdomain. We also add API functions to allocate input and output
HopIDs of the XDomain connection that the service drivers can use
instead of hard-coding.

Also convert the two existing service drivers over to this API.

Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>


# 8b0ab503 15-Jan-2021 Mika Westerberg <mika.westerberg@linux.intel.com>

thunderbolt: dma_test: Drop unnecessary include

It seems <linux/acpi.h> is not actually needed in this driver so we can
drop it.

Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>


# 82096ecf 22-Dec-2020 Tian Tao <tiantao6@hisilicon.com>

thunderbolt: Use kmemdup instead of kzalloc and memcpy

Fixes coccicheck warning:
drivers/thunderbolt/dma_test.c:302:13-20: WARNING opportunity for kmemdup.

Signed-off-by: Tian Tao <tiantao6@hisilicon.com>
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>


# edc0f494 24-Sep-2020 Isaac Hazan <isaac.hazan@intel.com>

thunderbolt: Add DMA traffic test driver

This driver allows sending DMA traffic over XDomain connection.
Specifically over a loopback connection using either a Thunderbolt/USB4
cable that is connected back to the host router port, or a special
loopback dongle that has RX and TX lines crossed. This can be useful at
manufacturing floor to check whether Thunderbolt/USB4 ports are
functional.

The driver exposes debugfs directory under the XDomain service that can
be used to configure the driver, start the test and check the results.

If a loopback dongle is used the steps to send and receive 1000 packets
can be done like:

# modprobe thunderbolt_dma_test
# echo 1000 > /sys/kernel/debug/thunderbolt/<service_id>/dma_test/packets_to_receive
# echo 1000 > /sys/kernel/debug/thunderbolt/<service_id>/dma_test/packets_to_send
# echo 1 > /sys/kernel/debug/thunderbolt/<service_id>/dma_test/test
# cat /sys/kernel/debug/thunderbolt/<service_id>/dma_test/status

When a cable is connected back to host then there are two Thunderbolt
services, one is configured for receiving (does not matter which one):

# modprobe thunderbolt_dma_test
# echo 1000 > /sys/kernel/debug/thunderbolt/<service_a>/dma_test/packets_to_receive
# echo 1 > /sys/kernel/debug/thunderbolt/<service_a>/dma_test/test

The other one for sending:

# echo 1000 > /sys/kernel/debug/thunderbolt/<service_b>/dma_test/packets_to_send
# echo 1 > /sys/kernel/debug/thunderbolt/<service_b>/dma_test/test

Results can be read from both services status attributes.

Signed-off-by: Isaac Hazan <isaac.hazan@intel.com>
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Acked-by: Yehezkel Bernat <YehezkelShB@gmail.com>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>