Lines Matching full:tunnel

13 #include "tunnel.h"
1324 * Create PCIe tunnel between host and two devices. in tb_test_tunnel_pcie()
1376 struct tb_tunnel *tunnel; in tb_test_tunnel_dp() local
1379 * Create DP tunnel between Host and Device in tb_test_tunnel_dp()
1392 tunnel = tb_tunnel_alloc_dp(NULL, in, out, 1, 0, 0); in tb_test_tunnel_dp()
1393 KUNIT_ASSERT_NOT_NULL(test, tunnel); in tb_test_tunnel_dp()
1394 KUNIT_EXPECT_EQ(test, tunnel->type, TB_TUNNEL_DP); in tb_test_tunnel_dp()
1395 KUNIT_EXPECT_PTR_EQ(test, tunnel->src_port, in); in tb_test_tunnel_dp()
1396 KUNIT_EXPECT_PTR_EQ(test, tunnel->dst_port, out); in tb_test_tunnel_dp()
1397 KUNIT_ASSERT_EQ(test, tunnel->npaths, 3); in tb_test_tunnel_dp()
1398 KUNIT_ASSERT_EQ(test, tunnel->paths[0]->path_length, 2); in tb_test_tunnel_dp()
1399 KUNIT_EXPECT_PTR_EQ(test, tunnel->paths[0]->hops[0].in_port, in); in tb_test_tunnel_dp()
1400 KUNIT_EXPECT_PTR_EQ(test, tunnel->paths[0]->hops[1].out_port, out); in tb_test_tunnel_dp()
1401 KUNIT_ASSERT_EQ(test, tunnel->paths[1]->path_length, 2); in tb_test_tunnel_dp()
1402 KUNIT_EXPECT_PTR_EQ(test, tunnel->paths[1]->hops[0].in_port, in); in tb_test_tunnel_dp()
1403 KUNIT_EXPECT_PTR_EQ(test, tunnel->paths[1]->hops[1].out_port, out); in tb_test_tunnel_dp()
1404 KUNIT_ASSERT_EQ(test, tunnel->paths[2]->path_length, 2); in tb_test_tunnel_dp()
1405 KUNIT_EXPECT_PTR_EQ(test, tunnel->paths[2]->hops[0].in_port, out); in tb_test_tunnel_dp()
1406 KUNIT_EXPECT_PTR_EQ(test, tunnel->paths[2]->hops[1].out_port, in); in tb_test_tunnel_dp()
1407 tb_tunnel_free(tunnel); in tb_test_tunnel_dp()
1414 struct tb_tunnel *tunnel; in tb_test_tunnel_dp_chain() local
1417 * Create DP tunnel from Host DP IN to Device #4 DP OUT. in tb_test_tunnel_dp_chain()
1438 tunnel = tb_tunnel_alloc_dp(NULL, in, out, 1, 0, 0); in tb_test_tunnel_dp_chain()
1439 KUNIT_ASSERT_NOT_NULL(test, tunnel); in tb_test_tunnel_dp_chain()
1440 KUNIT_EXPECT_EQ(test, tunnel->type, TB_TUNNEL_DP); in tb_test_tunnel_dp_chain()
1441 KUNIT_EXPECT_PTR_EQ(test, tunnel->src_port, in); in tb_test_tunnel_dp_chain()
1442 KUNIT_EXPECT_PTR_EQ(test, tunnel->dst_port, out); in tb_test_tunnel_dp_chain()
1443 KUNIT_ASSERT_EQ(test, tunnel->npaths, 3); in tb_test_tunnel_dp_chain()
1444 KUNIT_ASSERT_EQ(test, tunnel->paths[0]->path_length, 3); in tb_test_tunnel_dp_chain()
1445 KUNIT_EXPECT_PTR_EQ(test, tunnel->paths[0]->hops[0].in_port, in); in tb_test_tunnel_dp_chain()
1446 KUNIT_EXPECT_PTR_EQ(test, tunnel->paths[0]->hops[2].out_port, out); in tb_test_tunnel_dp_chain()
1447 KUNIT_ASSERT_EQ(test, tunnel->paths[1]->path_length, 3); in tb_test_tunnel_dp_chain()
1448 KUNIT_EXPECT_PTR_EQ(test, tunnel->paths[1]->hops[0].in_port, in); in tb_test_tunnel_dp_chain()
1449 KUNIT_EXPECT_PTR_EQ(test, tunnel->paths[1]->hops[2].out_port, out); in tb_test_tunnel_dp_chain()
1450 KUNIT_ASSERT_EQ(test, tunnel->paths[2]->path_length, 3); in tb_test_tunnel_dp_chain()
1451 KUNIT_EXPECT_PTR_EQ(test, tunnel->paths[2]->hops[0].in_port, out); in tb_test_tunnel_dp_chain()
1452 KUNIT_EXPECT_PTR_EQ(test, tunnel->paths[2]->hops[2].out_port, in); in tb_test_tunnel_dp_chain()
1453 tb_tunnel_free(tunnel); in tb_test_tunnel_dp_chain()
1460 struct tb_tunnel *tunnel; in tb_test_tunnel_dp_tree() local
1463 * Create DP tunnel from Device #2 DP IN to Device #5 DP OUT. in tb_test_tunnel_dp_tree()
1488 tunnel = tb_tunnel_alloc_dp(NULL, in, out, 1, 0, 0); in tb_test_tunnel_dp_tree()
1489 KUNIT_ASSERT_NOT_NULL(test, tunnel); in tb_test_tunnel_dp_tree()
1490 KUNIT_EXPECT_EQ(test, tunnel->type, TB_TUNNEL_DP); in tb_test_tunnel_dp_tree()
1491 KUNIT_EXPECT_PTR_EQ(test, tunnel->src_port, in); in tb_test_tunnel_dp_tree()
1492 KUNIT_EXPECT_PTR_EQ(test, tunnel->dst_port, out); in tb_test_tunnel_dp_tree()
1493 KUNIT_ASSERT_EQ(test, tunnel->npaths, 3); in tb_test_tunnel_dp_tree()
1494 KUNIT_ASSERT_EQ(test, tunnel->paths[0]->path_length, 4); in tb_test_tunnel_dp_tree()
1495 KUNIT_EXPECT_PTR_EQ(test, tunnel->paths[0]->hops[0].in_port, in); in tb_test_tunnel_dp_tree()
1496 KUNIT_EXPECT_PTR_EQ(test, tunnel->paths[0]->hops[3].out_port, out); in tb_test_tunnel_dp_tree()
1497 KUNIT_ASSERT_EQ(test, tunnel->paths[1]->path_length, 4); in tb_test_tunnel_dp_tree()
1498 KUNIT_EXPECT_PTR_EQ(test, tunnel->paths[1]->hops[0].in_port, in); in tb_test_tunnel_dp_tree()
1499 KUNIT_EXPECT_PTR_EQ(test, tunnel->paths[1]->hops[3].out_port, out); in tb_test_tunnel_dp_tree()
1500 KUNIT_ASSERT_EQ(test, tunnel->paths[2]->path_length, 4); in tb_test_tunnel_dp_tree()
1501 KUNIT_EXPECT_PTR_EQ(test, tunnel->paths[2]->hops[0].in_port, out); in tb_test_tunnel_dp_tree()
1502 KUNIT_EXPECT_PTR_EQ(test, tunnel->paths[2]->hops[3].out_port, in); in tb_test_tunnel_dp_tree()
1503 tb_tunnel_free(tunnel); in tb_test_tunnel_dp_tree()
1511 struct tb_tunnel *tunnel; in tb_test_tunnel_dp_max_length() local
1514 * Creates DP tunnel from Device #6 to Device #12. in tb_test_tunnel_dp_max_length()
1553 tunnel = tb_tunnel_alloc_dp(NULL, in, out, 1, 0, 0); in tb_test_tunnel_dp_max_length()
1554 KUNIT_ASSERT_NOT_NULL(test, tunnel); in tb_test_tunnel_dp_max_length()
1555 KUNIT_EXPECT_EQ(test, tunnel->type, TB_TUNNEL_DP); in tb_test_tunnel_dp_max_length()
1556 KUNIT_EXPECT_PTR_EQ(test, tunnel->src_port, in); in tb_test_tunnel_dp_max_length()
1557 KUNIT_EXPECT_PTR_EQ(test, tunnel->dst_port, out); in tb_test_tunnel_dp_max_length()
1558 KUNIT_ASSERT_EQ(test, tunnel->npaths, 3); in tb_test_tunnel_dp_max_length()
1559 KUNIT_ASSERT_EQ(test, tunnel->paths[0]->path_length, 13); in tb_test_tunnel_dp_max_length()
1561 KUNIT_EXPECT_PTR_EQ(test, tunnel->paths[0]->hops[0].in_port, in); in tb_test_tunnel_dp_max_length()
1563 KUNIT_EXPECT_PTR_EQ(test, tunnel->paths[0]->hops[6].in_port, in tb_test_tunnel_dp_max_length()
1565 KUNIT_EXPECT_PTR_EQ(test, tunnel->paths[0]->hops[6].out_port, in tb_test_tunnel_dp_max_length()
1568 KUNIT_EXPECT_PTR_EQ(test, tunnel->paths[0]->hops[12].out_port, out); in tb_test_tunnel_dp_max_length()
1569 KUNIT_ASSERT_EQ(test, tunnel->paths[1]->path_length, 13); in tb_test_tunnel_dp_max_length()
1570 KUNIT_EXPECT_PTR_EQ(test, tunnel->paths[1]->hops[0].in_port, in); in tb_test_tunnel_dp_max_length()
1571 KUNIT_EXPECT_PTR_EQ(test, tunnel->paths[1]->hops[6].in_port, in tb_test_tunnel_dp_max_length()
1573 KUNIT_EXPECT_PTR_EQ(test, tunnel->paths[1]->hops[6].out_port, in tb_test_tunnel_dp_max_length()
1575 KUNIT_EXPECT_PTR_EQ(test, tunnel->paths[1]->hops[12].out_port, out); in tb_test_tunnel_dp_max_length()
1576 KUNIT_ASSERT_EQ(test, tunnel->paths[2]->path_length, 13); in tb_test_tunnel_dp_max_length()
1577 KUNIT_EXPECT_PTR_EQ(test, tunnel->paths[2]->hops[0].in_port, out); in tb_test_tunnel_dp_max_length()
1578 KUNIT_EXPECT_PTR_EQ(test, tunnel->paths[2]->hops[6].in_port, in tb_test_tunnel_dp_max_length()
1580 KUNIT_EXPECT_PTR_EQ(test, tunnel->paths[2]->hops[6].out_port, in tb_test_tunnel_dp_max_length()
1582 KUNIT_EXPECT_PTR_EQ(test, tunnel->paths[2]->hops[12].out_port, in); in tb_test_tunnel_dp_max_length()
1583 tb_tunnel_free(tunnel); in tb_test_tunnel_dp_max_length()
1593 * Create USB3 tunnel between host and two devices. in tb_test_tunnel_usb3()
1710 struct tb_tunnel *tunnel; in tb_test_tunnel_dma() local
1714 * Create DMA tunnel from NHI to port 1 and back. in tb_test_tunnel_dma()
1728 tunnel = tb_tunnel_alloc_dma(NULL, nhi, port, 8, 1, 8, 1); in tb_test_tunnel_dma()
1729 KUNIT_ASSERT_NOT_NULL(test, tunnel); in tb_test_tunnel_dma()
1730 KUNIT_EXPECT_EQ(test, tunnel->type, TB_TUNNEL_DMA); in tb_test_tunnel_dma()
1731 KUNIT_EXPECT_PTR_EQ(test, tunnel->src_port, nhi); in tb_test_tunnel_dma()
1732 KUNIT_EXPECT_PTR_EQ(test, tunnel->dst_port, port); in tb_test_tunnel_dma()
1733 KUNIT_ASSERT_EQ(test, tunnel->npaths, 2); in tb_test_tunnel_dma()
1735 KUNIT_ASSERT_EQ(test, tunnel->paths[0]->path_length, 1); in tb_test_tunnel_dma()
1736 KUNIT_EXPECT_PTR_EQ(test, tunnel->paths[0]->hops[0].in_port, port); in tb_test_tunnel_dma()
1737 KUNIT_EXPECT_EQ(test, tunnel->paths[0]->hops[0].in_hop_index, 8); in tb_test_tunnel_dma()
1738 KUNIT_EXPECT_PTR_EQ(test, tunnel->paths[0]->hops[0].out_port, nhi); in tb_test_tunnel_dma()
1739 KUNIT_EXPECT_EQ(test, tunnel->paths[0]->hops[0].next_hop_index, 1); in tb_test_tunnel_dma()
1741 KUNIT_ASSERT_EQ(test, tunnel->paths[1]->path_length, 1); in tb_test_tunnel_dma()
1742 KUNIT_EXPECT_PTR_EQ(test, tunnel->paths[1]->hops[0].in_port, nhi); in tb_test_tunnel_dma()
1743 KUNIT_EXPECT_EQ(test, tunnel->paths[1]->hops[0].in_hop_index, 1); in tb_test_tunnel_dma()
1744 KUNIT_EXPECT_PTR_EQ(test, tunnel->paths[1]->hops[0].out_port, port); in tb_test_tunnel_dma()
1745 KUNIT_EXPECT_EQ(test, tunnel->paths[1]->hops[0].next_hop_index, 8); in tb_test_tunnel_dma()
1747 tb_tunnel_free(tunnel); in tb_test_tunnel_dma()
1753 struct tb_tunnel *tunnel; in tb_test_tunnel_dma_rx() local
1757 * Create DMA RX tunnel from port 1 to NHI. in tb_test_tunnel_dma_rx()
1771 tunnel = tb_tunnel_alloc_dma(NULL, nhi, port, -1, -1, 15, 2); in tb_test_tunnel_dma_rx()
1772 KUNIT_ASSERT_NOT_NULL(test, tunnel); in tb_test_tunnel_dma_rx()
1773 KUNIT_EXPECT_EQ(test, tunnel->type, TB_TUNNEL_DMA); in tb_test_tunnel_dma_rx()
1774 KUNIT_EXPECT_PTR_EQ(test, tunnel->src_port, nhi); in tb_test_tunnel_dma_rx()
1775 KUNIT_EXPECT_PTR_EQ(test, tunnel->dst_port, port); in tb_test_tunnel_dma_rx()
1776 KUNIT_ASSERT_EQ(test, tunnel->npaths, 1); in tb_test_tunnel_dma_rx()
1778 KUNIT_ASSERT_EQ(test, tunnel->paths[0]->path_length, 1); in tb_test_tunnel_dma_rx()
1779 KUNIT_EXPECT_PTR_EQ(test, tunnel->paths[0]->hops[0].in_port, port); in tb_test_tunnel_dma_rx()
1780 KUNIT_EXPECT_EQ(test, tunnel->paths[0]->hops[0].in_hop_index, 15); in tb_test_tunnel_dma_rx()
1781 KUNIT_EXPECT_PTR_EQ(test, tunnel->paths[0]->hops[0].out_port, nhi); in tb_test_tunnel_dma_rx()
1782 KUNIT_EXPECT_EQ(test, tunnel->paths[0]->hops[0].next_hop_index, 2); in tb_test_tunnel_dma_rx()
1784 tb_tunnel_free(tunnel); in tb_test_tunnel_dma_rx()
1790 struct tb_tunnel *tunnel; in tb_test_tunnel_dma_tx() local
1794 * Create DMA TX tunnel from NHI to port 1. in tb_test_tunnel_dma_tx()
1808 tunnel = tb_tunnel_alloc_dma(NULL, nhi, port, 15, 2, -1, -1); in tb_test_tunnel_dma_tx()
1809 KUNIT_ASSERT_NOT_NULL(test, tunnel); in tb_test_tunnel_dma_tx()
1810 KUNIT_EXPECT_EQ(test, tunnel->type, TB_TUNNEL_DMA); in tb_test_tunnel_dma_tx()
1811 KUNIT_EXPECT_PTR_EQ(test, tunnel->src_port, nhi); in tb_test_tunnel_dma_tx()
1812 KUNIT_EXPECT_PTR_EQ(test, tunnel->dst_port, port); in tb_test_tunnel_dma_tx()
1813 KUNIT_ASSERT_EQ(test, tunnel->npaths, 1); in tb_test_tunnel_dma_tx()
1815 KUNIT_ASSERT_EQ(test, tunnel->paths[0]->path_length, 1); in tb_test_tunnel_dma_tx()
1816 KUNIT_EXPECT_PTR_EQ(test, tunnel->paths[0]->hops[0].in_port, nhi); in tb_test_tunnel_dma_tx()
1817 KUNIT_EXPECT_EQ(test, tunnel->paths[0]->hops[0].in_hop_index, 2); in tb_test_tunnel_dma_tx()
1818 KUNIT_EXPECT_PTR_EQ(test, tunnel->paths[0]->hops[0].out_port, port); in tb_test_tunnel_dma_tx()
1819 KUNIT_EXPECT_EQ(test, tunnel->paths[0]->hops[0].next_hop_index, 15); in tb_test_tunnel_dma_tx()
1821 tb_tunnel_free(tunnel); in tb_test_tunnel_dma_tx()
1828 struct tb_tunnel *tunnel; in tb_test_tunnel_dma_chain() local
1831 * Create DMA tunnel from NHI to Device #2 port 3 and back. in tb_test_tunnel_dma_chain()
1854 tunnel = tb_tunnel_alloc_dma(NULL, nhi, port, 8, 1, 8, 1); in tb_test_tunnel_dma_chain()
1855 KUNIT_ASSERT_NOT_NULL(test, tunnel); in tb_test_tunnel_dma_chain()
1856 KUNIT_EXPECT_EQ(test, tunnel->type, TB_TUNNEL_DMA); in tb_test_tunnel_dma_chain()
1857 KUNIT_EXPECT_PTR_EQ(test, tunnel->src_port, nhi); in tb_test_tunnel_dma_chain()
1858 KUNIT_EXPECT_PTR_EQ(test, tunnel->dst_port, port); in tb_test_tunnel_dma_chain()
1859 KUNIT_ASSERT_EQ(test, tunnel->npaths, 2); in tb_test_tunnel_dma_chain()
1861 KUNIT_ASSERT_EQ(test, tunnel->paths[0]->path_length, 3); in tb_test_tunnel_dma_chain()
1862 KUNIT_EXPECT_PTR_EQ(test, tunnel->paths[0]->hops[0].in_port, port); in tb_test_tunnel_dma_chain()
1863 KUNIT_EXPECT_EQ(test, tunnel->paths[0]->hops[0].in_hop_index, 8); in tb_test_tunnel_dma_chain()
1864 KUNIT_EXPECT_PTR_EQ(test, tunnel->paths[0]->hops[0].out_port, in tb_test_tunnel_dma_chain()
1866 KUNIT_EXPECT_PTR_EQ(test, tunnel->paths[0]->hops[1].in_port, in tb_test_tunnel_dma_chain()
1868 KUNIT_EXPECT_PTR_EQ(test, tunnel->paths[0]->hops[1].out_port, in tb_test_tunnel_dma_chain()
1870 KUNIT_EXPECT_PTR_EQ(test, tunnel->paths[0]->hops[2].in_port, in tb_test_tunnel_dma_chain()
1872 KUNIT_EXPECT_PTR_EQ(test, tunnel->paths[0]->hops[2].out_port, nhi); in tb_test_tunnel_dma_chain()
1873 KUNIT_EXPECT_EQ(test, tunnel->paths[0]->hops[2].next_hop_index, 1); in tb_test_tunnel_dma_chain()
1875 KUNIT_ASSERT_EQ(test, tunnel->paths[1]->path_length, 3); in tb_test_tunnel_dma_chain()
1876 KUNIT_EXPECT_PTR_EQ(test, tunnel->paths[1]->hops[0].in_port, nhi); in tb_test_tunnel_dma_chain()
1877 KUNIT_EXPECT_EQ(test, tunnel->paths[1]->hops[0].in_hop_index, 1); in tb_test_tunnel_dma_chain()
1878 KUNIT_EXPECT_PTR_EQ(test, tunnel->paths[1]->hops[1].in_port, in tb_test_tunnel_dma_chain()
1880 KUNIT_EXPECT_PTR_EQ(test, tunnel->paths[1]->hops[1].out_port, in tb_test_tunnel_dma_chain()
1882 KUNIT_EXPECT_PTR_EQ(test, tunnel->paths[1]->hops[2].in_port, in tb_test_tunnel_dma_chain()
1884 KUNIT_EXPECT_PTR_EQ(test, tunnel->paths[1]->hops[2].out_port, port); in tb_test_tunnel_dma_chain()
1885 KUNIT_EXPECT_EQ(test, tunnel->paths[1]->hops[2].next_hop_index, 8); in tb_test_tunnel_dma_chain()
1887 tb_tunnel_free(tunnel); in tb_test_tunnel_dma_chain()
1893 struct tb_tunnel *tunnel; in tb_test_tunnel_dma_match() local
1900 tunnel = tb_tunnel_alloc_dma(NULL, nhi, port, 15, 1, 15, 1); in tb_test_tunnel_dma_match()
1901 KUNIT_ASSERT_NOT_NULL(test, tunnel); in tb_test_tunnel_dma_match()
1903 KUNIT_ASSERT_TRUE(test, tb_tunnel_match_dma(tunnel, 15, 1, 15, 1)); in tb_test_tunnel_dma_match()
1904 KUNIT_ASSERT_FALSE(test, tb_tunnel_match_dma(tunnel, 8, 1, 15, 1)); in tb_test_tunnel_dma_match()
1905 KUNIT_ASSERT_TRUE(test, tb_tunnel_match_dma(tunnel, -1, -1, 15, 1)); in tb_test_tunnel_dma_match()
1906 KUNIT_ASSERT_TRUE(test, tb_tunnel_match_dma(tunnel, 15, 1, -1, -1)); in tb_test_tunnel_dma_match()
1907 KUNIT_ASSERT_TRUE(test, tb_tunnel_match_dma(tunnel, 15, -1, -1, -1)); in tb_test_tunnel_dma_match()
1908 KUNIT_ASSERT_TRUE(test, tb_tunnel_match_dma(tunnel, -1, 1, -1, -1)); in tb_test_tunnel_dma_match()
1909 KUNIT_ASSERT_TRUE(test, tb_tunnel_match_dma(tunnel, -1, -1, 15, -1)); in tb_test_tunnel_dma_match()
1910 KUNIT_ASSERT_TRUE(test, tb_tunnel_match_dma(tunnel, -1, -1, -1, 1)); in tb_test_tunnel_dma_match()
1911 KUNIT_ASSERT_TRUE(test, tb_tunnel_match_dma(tunnel, -1, -1, -1, -1)); in tb_test_tunnel_dma_match()
1912 KUNIT_ASSERT_FALSE(test, tb_tunnel_match_dma(tunnel, 8, -1, 8, -1)); in tb_test_tunnel_dma_match()
1914 tb_tunnel_free(tunnel); in tb_test_tunnel_dma_match()
1916 tunnel = tb_tunnel_alloc_dma(NULL, nhi, port, 15, 1, -1, -1); in tb_test_tunnel_dma_match()
1917 KUNIT_ASSERT_NOT_NULL(test, tunnel); in tb_test_tunnel_dma_match()
1918 KUNIT_ASSERT_TRUE(test, tb_tunnel_match_dma(tunnel, 15, 1, -1, -1)); in tb_test_tunnel_dma_match()
1919 KUNIT_ASSERT_TRUE(test, tb_tunnel_match_dma(tunnel, 15, -1, -1, -1)); in tb_test_tunnel_dma_match()
1920 KUNIT_ASSERT_TRUE(test, tb_tunnel_match_dma(tunnel, -1, 1, -1, -1)); in tb_test_tunnel_dma_match()
1921 KUNIT_ASSERT_TRUE(test, tb_tunnel_match_dma(tunnel, -1, -1, -1, -1)); in tb_test_tunnel_dma_match()
1922 KUNIT_ASSERT_FALSE(test, tb_tunnel_match_dma(tunnel, 15, 1, 15, 1)); in tb_test_tunnel_dma_match()
1923 KUNIT_ASSERT_FALSE(test, tb_tunnel_match_dma(tunnel, -1, -1, 15, 1)); in tb_test_tunnel_dma_match()
1924 KUNIT_ASSERT_FALSE(test, tb_tunnel_match_dma(tunnel, 15, 11, -1, -1)); in tb_test_tunnel_dma_match()
1926 tb_tunnel_free(tunnel); in tb_test_tunnel_dma_match()
1928 tunnel = tb_tunnel_alloc_dma(NULL, nhi, port, -1, -1, 15, 11); in tb_test_tunnel_dma_match()
1929 KUNIT_ASSERT_NOT_NULL(test, tunnel); in tb_test_tunnel_dma_match()
1930 KUNIT_ASSERT_TRUE(test, tb_tunnel_match_dma(tunnel, -1, -1, 15, 11)); in tb_test_tunnel_dma_match()
1931 KUNIT_ASSERT_TRUE(test, tb_tunnel_match_dma(tunnel, -1, -1, 15, -1)); in tb_test_tunnel_dma_match()
1932 KUNIT_ASSERT_TRUE(test, tb_tunnel_match_dma(tunnel, -1, -1, -1, 11)); in tb_test_tunnel_dma_match()
1933 KUNIT_ASSERT_TRUE(test, tb_tunnel_match_dma(tunnel, -1, -1, -1, -1)); in tb_test_tunnel_dma_match()
1934 KUNIT_ASSERT_FALSE(test, tb_tunnel_match_dma(tunnel, -1, -1, 15, 1)); in tb_test_tunnel_dma_match()
1935 KUNIT_ASSERT_FALSE(test, tb_tunnel_match_dma(tunnel, -1, -1, 10, 11)); in tb_test_tunnel_dma_match()
1936 KUNIT_ASSERT_FALSE(test, tb_tunnel_match_dma(tunnel, 15, 11, -1, -1)); in tb_test_tunnel_dma_match()
1938 tb_tunnel_free(tunnel); in tb_test_tunnel_dma_match()
1945 struct tb_tunnel *tunnel; in tb_test_credit_alloc_legacy_not_bonded() local
1953 tunnel = tb_tunnel_alloc_pci(NULL, up, down); in tb_test_credit_alloc_legacy_not_bonded()
1954 KUNIT_ASSERT_NOT_NULL(test, tunnel); in tb_test_credit_alloc_legacy_not_bonded()
1955 KUNIT_ASSERT_EQ(test, tunnel->npaths, (size_t)2); in tb_test_credit_alloc_legacy_not_bonded()
1957 path = tunnel->paths[0]; in tb_test_credit_alloc_legacy_not_bonded()
1964 path = tunnel->paths[1]; in tb_test_credit_alloc_legacy_not_bonded()
1971 tb_tunnel_free(tunnel); in tb_test_credit_alloc_legacy_not_bonded()
1978 struct tb_tunnel *tunnel; in tb_test_credit_alloc_legacy_bonded() local
1986 tunnel = tb_tunnel_alloc_pci(NULL, up, down); in tb_test_credit_alloc_legacy_bonded()
1987 KUNIT_ASSERT_NOT_NULL(test, tunnel); in tb_test_credit_alloc_legacy_bonded()
1988 KUNIT_ASSERT_EQ(test, tunnel->npaths, (size_t)2); in tb_test_credit_alloc_legacy_bonded()
1990 path = tunnel->paths[0]; in tb_test_credit_alloc_legacy_bonded()
1997 path = tunnel->paths[1]; in tb_test_credit_alloc_legacy_bonded()
2004 tb_tunnel_free(tunnel); in tb_test_credit_alloc_legacy_bonded()
2011 struct tb_tunnel *tunnel; in tb_test_credit_alloc_pcie() local
2019 tunnel = tb_tunnel_alloc_pci(NULL, up, down); in tb_test_credit_alloc_pcie()
2020 KUNIT_ASSERT_NOT_NULL(test, tunnel); in tb_test_credit_alloc_pcie()
2021 KUNIT_ASSERT_EQ(test, tunnel->npaths, (size_t)2); in tb_test_credit_alloc_pcie()
2023 path = tunnel->paths[0]; in tb_test_credit_alloc_pcie()
2030 path = tunnel->paths[1]; in tb_test_credit_alloc_pcie()
2037 tb_tunnel_free(tunnel); in tb_test_credit_alloc_pcie()
2044 struct tb_tunnel *tunnel; in tb_test_credit_alloc_without_dp() local
2067 tunnel = tb_tunnel_alloc_pci(NULL, up, down); in tb_test_credit_alloc_without_dp()
2068 KUNIT_ASSERT_TRUE(test, tunnel != NULL); in tb_test_credit_alloc_without_dp()
2069 KUNIT_ASSERT_EQ(test, tunnel->npaths, (size_t)2); in tb_test_credit_alloc_without_dp()
2072 path = tunnel->paths[0]; in tb_test_credit_alloc_without_dp()
2080 path = tunnel->paths[1]; in tb_test_credit_alloc_without_dp()
2087 tb_tunnel_free(tunnel); in tb_test_credit_alloc_without_dp()
2094 struct tb_tunnel *tunnel; in tb_test_credit_alloc_dp() local
2103 tunnel = tb_tunnel_alloc_dp(NULL, in, out, 1, 0, 0); in tb_test_credit_alloc_dp()
2104 KUNIT_ASSERT_NOT_NULL(test, tunnel); in tb_test_credit_alloc_dp()
2105 KUNIT_ASSERT_EQ(test, tunnel->npaths, (size_t)3); in tb_test_credit_alloc_dp()
2108 path = tunnel->paths[0]; in tb_test_credit_alloc_dp()
2116 path = tunnel->paths[1]; in tb_test_credit_alloc_dp()
2124 path = tunnel->paths[2]; in tb_test_credit_alloc_dp()
2131 tb_tunnel_free(tunnel); in tb_test_credit_alloc_dp()
2138 struct tb_tunnel *tunnel; in tb_test_credit_alloc_usb3() local
2146 tunnel = tb_tunnel_alloc_usb3(NULL, up, down, 0, 0); in tb_test_credit_alloc_usb3()
2147 KUNIT_ASSERT_NOT_NULL(test, tunnel); in tb_test_credit_alloc_usb3()
2148 KUNIT_ASSERT_EQ(test, tunnel->npaths, (size_t)2); in tb_test_credit_alloc_usb3()
2150 path = tunnel->paths[0]; in tb_test_credit_alloc_usb3()
2157 path = tunnel->paths[1]; in tb_test_credit_alloc_usb3()
2164 tb_tunnel_free(tunnel); in tb_test_credit_alloc_usb3()
2171 struct tb_tunnel *tunnel; in tb_test_credit_alloc_dma() local
2180 tunnel = tb_tunnel_alloc_dma(NULL, nhi, port, 8, 1, 8, 1); in tb_test_credit_alloc_dma()
2181 KUNIT_ASSERT_NOT_NULL(test, tunnel); in tb_test_credit_alloc_dma()
2182 KUNIT_ASSERT_EQ(test, tunnel->npaths, (size_t)2); in tb_test_credit_alloc_dma()
2185 path = tunnel->paths[0]; in tb_test_credit_alloc_dma()
2193 path = tunnel->paths[1]; in tb_test_credit_alloc_dma()
2200 tb_tunnel_free(tunnel); in tb_test_credit_alloc_dma()
2231 * So on host the first tunnel gets 14 and the second gets the in tb_test_credit_alloc_dma_multiple()
2274 * Release the first DMA tunnel. That should make 14 buffers in tb_test_credit_alloc_dma_multiple()
2275 * available for the next tunnel. in tb_test_credit_alloc_dma_multiple()