Lines Matching full:tunnel
13 #include "tunnel.h"
1341 * Create PCIe tunnel between host and two devices. in tb_test_tunnel_pcie()
1393 struct tb_tunnel *tunnel; in tb_test_tunnel_dp() local
1396 * Create DP tunnel between Host and Device in tb_test_tunnel_dp()
1409 tunnel = tb_tunnel_alloc_dp(NULL, in, out, 1, 0, 0); in tb_test_tunnel_dp()
1410 KUNIT_ASSERT_NOT_NULL(test, tunnel); in tb_test_tunnel_dp()
1411 KUNIT_EXPECT_EQ(test, tunnel->type, TB_TUNNEL_DP); in tb_test_tunnel_dp()
1412 KUNIT_EXPECT_PTR_EQ(test, tunnel->src_port, in); in tb_test_tunnel_dp()
1413 KUNIT_EXPECT_PTR_EQ(test, tunnel->dst_port, out); in tb_test_tunnel_dp()
1414 KUNIT_ASSERT_EQ(test, tunnel->npaths, 3); in tb_test_tunnel_dp()
1415 KUNIT_ASSERT_EQ(test, tunnel->paths[0]->path_length, 2); in tb_test_tunnel_dp()
1416 KUNIT_EXPECT_PTR_EQ(test, tunnel->paths[0]->hops[0].in_port, in); in tb_test_tunnel_dp()
1417 KUNIT_EXPECT_PTR_EQ(test, tunnel->paths[0]->hops[1].out_port, out); in tb_test_tunnel_dp()
1418 KUNIT_ASSERT_EQ(test, tunnel->paths[1]->path_length, 2); in tb_test_tunnel_dp()
1419 KUNIT_EXPECT_PTR_EQ(test, tunnel->paths[1]->hops[0].in_port, in); in tb_test_tunnel_dp()
1420 KUNIT_EXPECT_PTR_EQ(test, tunnel->paths[1]->hops[1].out_port, out); in tb_test_tunnel_dp()
1421 KUNIT_ASSERT_EQ(test, tunnel->paths[2]->path_length, 2); in tb_test_tunnel_dp()
1422 KUNIT_EXPECT_PTR_EQ(test, tunnel->paths[2]->hops[0].in_port, out); in tb_test_tunnel_dp()
1423 KUNIT_EXPECT_PTR_EQ(test, tunnel->paths[2]->hops[1].out_port, in); in tb_test_tunnel_dp()
1424 tb_tunnel_free(tunnel); in tb_test_tunnel_dp()
1431 struct tb_tunnel *tunnel; in tb_test_tunnel_dp_chain() local
1434 * Create DP tunnel from Host DP IN to Device #4 DP OUT. in tb_test_tunnel_dp_chain()
1455 tunnel = tb_tunnel_alloc_dp(NULL, in, out, 1, 0, 0); in tb_test_tunnel_dp_chain()
1456 KUNIT_ASSERT_NOT_NULL(test, tunnel); in tb_test_tunnel_dp_chain()
1457 KUNIT_EXPECT_EQ(test, tunnel->type, TB_TUNNEL_DP); in tb_test_tunnel_dp_chain()
1458 KUNIT_EXPECT_PTR_EQ(test, tunnel->src_port, in); in tb_test_tunnel_dp_chain()
1459 KUNIT_EXPECT_PTR_EQ(test, tunnel->dst_port, out); in tb_test_tunnel_dp_chain()
1460 KUNIT_ASSERT_EQ(test, tunnel->npaths, 3); in tb_test_tunnel_dp_chain()
1461 KUNIT_ASSERT_EQ(test, tunnel->paths[0]->path_length, 3); in tb_test_tunnel_dp_chain()
1462 KUNIT_EXPECT_PTR_EQ(test, tunnel->paths[0]->hops[0].in_port, in); in tb_test_tunnel_dp_chain()
1463 KUNIT_EXPECT_PTR_EQ(test, tunnel->paths[0]->hops[2].out_port, out); in tb_test_tunnel_dp_chain()
1464 KUNIT_ASSERT_EQ(test, tunnel->paths[1]->path_length, 3); in tb_test_tunnel_dp_chain()
1465 KUNIT_EXPECT_PTR_EQ(test, tunnel->paths[1]->hops[0].in_port, in); in tb_test_tunnel_dp_chain()
1466 KUNIT_EXPECT_PTR_EQ(test, tunnel->paths[1]->hops[2].out_port, out); in tb_test_tunnel_dp_chain()
1467 KUNIT_ASSERT_EQ(test, tunnel->paths[2]->path_length, 3); in tb_test_tunnel_dp_chain()
1468 KUNIT_EXPECT_PTR_EQ(test, tunnel->paths[2]->hops[0].in_port, out); in tb_test_tunnel_dp_chain()
1469 KUNIT_EXPECT_PTR_EQ(test, tunnel->paths[2]->hops[2].out_port, in); in tb_test_tunnel_dp_chain()
1470 tb_tunnel_free(tunnel); in tb_test_tunnel_dp_chain()
1477 struct tb_tunnel *tunnel; in tb_test_tunnel_dp_tree() local
1480 * Create DP tunnel from Device #2 DP IN to Device #5 DP OUT. in tb_test_tunnel_dp_tree()
1505 tunnel = tb_tunnel_alloc_dp(NULL, in, out, 1, 0, 0); in tb_test_tunnel_dp_tree()
1506 KUNIT_ASSERT_NOT_NULL(test, tunnel); in tb_test_tunnel_dp_tree()
1507 KUNIT_EXPECT_EQ(test, tunnel->type, TB_TUNNEL_DP); in tb_test_tunnel_dp_tree()
1508 KUNIT_EXPECT_PTR_EQ(test, tunnel->src_port, in); in tb_test_tunnel_dp_tree()
1509 KUNIT_EXPECT_PTR_EQ(test, tunnel->dst_port, out); in tb_test_tunnel_dp_tree()
1510 KUNIT_ASSERT_EQ(test, tunnel->npaths, 3); in tb_test_tunnel_dp_tree()
1511 KUNIT_ASSERT_EQ(test, tunnel->paths[0]->path_length, 4); in tb_test_tunnel_dp_tree()
1512 KUNIT_EXPECT_PTR_EQ(test, tunnel->paths[0]->hops[0].in_port, in); in tb_test_tunnel_dp_tree()
1513 KUNIT_EXPECT_PTR_EQ(test, tunnel->paths[0]->hops[3].out_port, out); in tb_test_tunnel_dp_tree()
1514 KUNIT_ASSERT_EQ(test, tunnel->paths[1]->path_length, 4); in tb_test_tunnel_dp_tree()
1515 KUNIT_EXPECT_PTR_EQ(test, tunnel->paths[1]->hops[0].in_port, in); in tb_test_tunnel_dp_tree()
1516 KUNIT_EXPECT_PTR_EQ(test, tunnel->paths[1]->hops[3].out_port, out); in tb_test_tunnel_dp_tree()
1517 KUNIT_ASSERT_EQ(test, tunnel->paths[2]->path_length, 4); in tb_test_tunnel_dp_tree()
1518 KUNIT_EXPECT_PTR_EQ(test, tunnel->paths[2]->hops[0].in_port, out); in tb_test_tunnel_dp_tree()
1519 KUNIT_EXPECT_PTR_EQ(test, tunnel->paths[2]->hops[3].out_port, in); in tb_test_tunnel_dp_tree()
1520 tb_tunnel_free(tunnel); in tb_test_tunnel_dp_tree()
1528 struct tb_tunnel *tunnel; in tb_test_tunnel_dp_max_length() local
1531 * Creates DP tunnel from Device #6 to Device #12. in tb_test_tunnel_dp_max_length()
1570 tunnel = tb_tunnel_alloc_dp(NULL, in, out, 1, 0, 0); in tb_test_tunnel_dp_max_length()
1571 KUNIT_ASSERT_NOT_NULL(test, tunnel); in tb_test_tunnel_dp_max_length()
1572 KUNIT_EXPECT_EQ(test, tunnel->type, TB_TUNNEL_DP); in tb_test_tunnel_dp_max_length()
1573 KUNIT_EXPECT_PTR_EQ(test, tunnel->src_port, in); in tb_test_tunnel_dp_max_length()
1574 KUNIT_EXPECT_PTR_EQ(test, tunnel->dst_port, out); in tb_test_tunnel_dp_max_length()
1575 KUNIT_ASSERT_EQ(test, tunnel->npaths, 3); in tb_test_tunnel_dp_max_length()
1576 KUNIT_ASSERT_EQ(test, tunnel->paths[0]->path_length, 13); in tb_test_tunnel_dp_max_length()
1578 KUNIT_EXPECT_PTR_EQ(test, tunnel->paths[0]->hops[0].in_port, in); in tb_test_tunnel_dp_max_length()
1580 KUNIT_EXPECT_PTR_EQ(test, tunnel->paths[0]->hops[6].in_port, in tb_test_tunnel_dp_max_length()
1582 KUNIT_EXPECT_PTR_EQ(test, tunnel->paths[0]->hops[6].out_port, in tb_test_tunnel_dp_max_length()
1585 KUNIT_EXPECT_PTR_EQ(test, tunnel->paths[0]->hops[12].out_port, out); in tb_test_tunnel_dp_max_length()
1586 KUNIT_ASSERT_EQ(test, tunnel->paths[1]->path_length, 13); in tb_test_tunnel_dp_max_length()
1587 KUNIT_EXPECT_PTR_EQ(test, tunnel->paths[1]->hops[0].in_port, in); in tb_test_tunnel_dp_max_length()
1588 KUNIT_EXPECT_PTR_EQ(test, tunnel->paths[1]->hops[6].in_port, in tb_test_tunnel_dp_max_length()
1590 KUNIT_EXPECT_PTR_EQ(test, tunnel->paths[1]->hops[6].out_port, in tb_test_tunnel_dp_max_length()
1592 KUNIT_EXPECT_PTR_EQ(test, tunnel->paths[1]->hops[12].out_port, out); in tb_test_tunnel_dp_max_length()
1593 KUNIT_ASSERT_EQ(test, tunnel->paths[2]->path_length, 13); in tb_test_tunnel_dp_max_length()
1594 KUNIT_EXPECT_PTR_EQ(test, tunnel->paths[2]->hops[0].in_port, out); in tb_test_tunnel_dp_max_length()
1595 KUNIT_EXPECT_PTR_EQ(test, tunnel->paths[2]->hops[6].in_port, in tb_test_tunnel_dp_max_length()
1597 KUNIT_EXPECT_PTR_EQ(test, tunnel->paths[2]->hops[6].out_port, in tb_test_tunnel_dp_max_length()
1599 KUNIT_EXPECT_PTR_EQ(test, tunnel->paths[2]->hops[12].out_port, in); in tb_test_tunnel_dp_max_length()
1600 tb_tunnel_free(tunnel); in tb_test_tunnel_dp_max_length()
1675 * Create USB3 tunnel between host and two devices. in tb_test_tunnel_usb3()
1792 struct tb_tunnel *tunnel; in tb_test_tunnel_dma() local
1796 * Create DMA tunnel from NHI to port 1 and back. in tb_test_tunnel_dma()
1810 tunnel = tb_tunnel_alloc_dma(NULL, nhi, port, 8, 1, 8, 1); in tb_test_tunnel_dma()
1811 KUNIT_ASSERT_NOT_NULL(test, tunnel); in tb_test_tunnel_dma()
1812 KUNIT_EXPECT_EQ(test, tunnel->type, TB_TUNNEL_DMA); in tb_test_tunnel_dma()
1813 KUNIT_EXPECT_PTR_EQ(test, tunnel->src_port, nhi); in tb_test_tunnel_dma()
1814 KUNIT_EXPECT_PTR_EQ(test, tunnel->dst_port, port); in tb_test_tunnel_dma()
1815 KUNIT_ASSERT_EQ(test, tunnel->npaths, 2); in tb_test_tunnel_dma()
1817 KUNIT_ASSERT_EQ(test, tunnel->paths[0]->path_length, 1); in tb_test_tunnel_dma()
1818 KUNIT_EXPECT_PTR_EQ(test, tunnel->paths[0]->hops[0].in_port, port); in tb_test_tunnel_dma()
1819 KUNIT_EXPECT_EQ(test, tunnel->paths[0]->hops[0].in_hop_index, 8); in tb_test_tunnel_dma()
1820 KUNIT_EXPECT_PTR_EQ(test, tunnel->paths[0]->hops[0].out_port, nhi); in tb_test_tunnel_dma()
1821 KUNIT_EXPECT_EQ(test, tunnel->paths[0]->hops[0].next_hop_index, 1); in tb_test_tunnel_dma()
1823 KUNIT_ASSERT_EQ(test, tunnel->paths[1]->path_length, 1); in tb_test_tunnel_dma()
1824 KUNIT_EXPECT_PTR_EQ(test, tunnel->paths[1]->hops[0].in_port, nhi); in tb_test_tunnel_dma()
1825 KUNIT_EXPECT_EQ(test, tunnel->paths[1]->hops[0].in_hop_index, 1); in tb_test_tunnel_dma()
1826 KUNIT_EXPECT_PTR_EQ(test, tunnel->paths[1]->hops[0].out_port, port); in tb_test_tunnel_dma()
1827 KUNIT_EXPECT_EQ(test, tunnel->paths[1]->hops[0].next_hop_index, 8); in tb_test_tunnel_dma()
1829 tb_tunnel_free(tunnel); in tb_test_tunnel_dma()
1835 struct tb_tunnel *tunnel; in tb_test_tunnel_dma_rx() local
1839 * Create DMA RX tunnel from port 1 to NHI. in tb_test_tunnel_dma_rx()
1853 tunnel = tb_tunnel_alloc_dma(NULL, nhi, port, -1, -1, 15, 2); in tb_test_tunnel_dma_rx()
1854 KUNIT_ASSERT_NOT_NULL(test, tunnel); in tb_test_tunnel_dma_rx()
1855 KUNIT_EXPECT_EQ(test, tunnel->type, TB_TUNNEL_DMA); in tb_test_tunnel_dma_rx()
1856 KUNIT_EXPECT_PTR_EQ(test, tunnel->src_port, nhi); in tb_test_tunnel_dma_rx()
1857 KUNIT_EXPECT_PTR_EQ(test, tunnel->dst_port, port); in tb_test_tunnel_dma_rx()
1858 KUNIT_ASSERT_EQ(test, tunnel->npaths, 1); in tb_test_tunnel_dma_rx()
1860 KUNIT_ASSERT_EQ(test, tunnel->paths[0]->path_length, 1); in tb_test_tunnel_dma_rx()
1861 KUNIT_EXPECT_PTR_EQ(test, tunnel->paths[0]->hops[0].in_port, port); in tb_test_tunnel_dma_rx()
1862 KUNIT_EXPECT_EQ(test, tunnel->paths[0]->hops[0].in_hop_index, 15); in tb_test_tunnel_dma_rx()
1863 KUNIT_EXPECT_PTR_EQ(test, tunnel->paths[0]->hops[0].out_port, nhi); in tb_test_tunnel_dma_rx()
1864 KUNIT_EXPECT_EQ(test, tunnel->paths[0]->hops[0].next_hop_index, 2); in tb_test_tunnel_dma_rx()
1866 tb_tunnel_free(tunnel); in tb_test_tunnel_dma_rx()
1872 struct tb_tunnel *tunnel; in tb_test_tunnel_dma_tx() local
1876 * Create DMA TX tunnel from NHI to port 1. in tb_test_tunnel_dma_tx()
1890 tunnel = tb_tunnel_alloc_dma(NULL, nhi, port, 15, 2, -1, -1); in tb_test_tunnel_dma_tx()
1891 KUNIT_ASSERT_NOT_NULL(test, tunnel); in tb_test_tunnel_dma_tx()
1892 KUNIT_EXPECT_EQ(test, tunnel->type, TB_TUNNEL_DMA); in tb_test_tunnel_dma_tx()
1893 KUNIT_EXPECT_PTR_EQ(test, tunnel->src_port, nhi); in tb_test_tunnel_dma_tx()
1894 KUNIT_EXPECT_PTR_EQ(test, tunnel->dst_port, port); in tb_test_tunnel_dma_tx()
1895 KUNIT_ASSERT_EQ(test, tunnel->npaths, 1); in tb_test_tunnel_dma_tx()
1897 KUNIT_ASSERT_EQ(test, tunnel->paths[0]->path_length, 1); in tb_test_tunnel_dma_tx()
1898 KUNIT_EXPECT_PTR_EQ(test, tunnel->paths[0]->hops[0].in_port, nhi); in tb_test_tunnel_dma_tx()
1899 KUNIT_EXPECT_EQ(test, tunnel->paths[0]->hops[0].in_hop_index, 2); in tb_test_tunnel_dma_tx()
1900 KUNIT_EXPECT_PTR_EQ(test, tunnel->paths[0]->hops[0].out_port, port); in tb_test_tunnel_dma_tx()
1901 KUNIT_EXPECT_EQ(test, tunnel->paths[0]->hops[0].next_hop_index, 15); in tb_test_tunnel_dma_tx()
1903 tb_tunnel_free(tunnel); in tb_test_tunnel_dma_tx()
1910 struct tb_tunnel *tunnel; in tb_test_tunnel_dma_chain() local
1913 * Create DMA tunnel from NHI to Device #2 port 3 and back. in tb_test_tunnel_dma_chain()
1936 tunnel = tb_tunnel_alloc_dma(NULL, nhi, port, 8, 1, 8, 1); in tb_test_tunnel_dma_chain()
1937 KUNIT_ASSERT_NOT_NULL(test, tunnel); in tb_test_tunnel_dma_chain()
1938 KUNIT_EXPECT_EQ(test, tunnel->type, TB_TUNNEL_DMA); in tb_test_tunnel_dma_chain()
1939 KUNIT_EXPECT_PTR_EQ(test, tunnel->src_port, nhi); in tb_test_tunnel_dma_chain()
1940 KUNIT_EXPECT_PTR_EQ(test, tunnel->dst_port, port); in tb_test_tunnel_dma_chain()
1941 KUNIT_ASSERT_EQ(test, tunnel->npaths, 2); in tb_test_tunnel_dma_chain()
1943 KUNIT_ASSERT_EQ(test, tunnel->paths[0]->path_length, 3); in tb_test_tunnel_dma_chain()
1944 KUNIT_EXPECT_PTR_EQ(test, tunnel->paths[0]->hops[0].in_port, port); in tb_test_tunnel_dma_chain()
1945 KUNIT_EXPECT_EQ(test, tunnel->paths[0]->hops[0].in_hop_index, 8); in tb_test_tunnel_dma_chain()
1946 KUNIT_EXPECT_PTR_EQ(test, tunnel->paths[0]->hops[0].out_port, in tb_test_tunnel_dma_chain()
1948 KUNIT_EXPECT_PTR_EQ(test, tunnel->paths[0]->hops[1].in_port, in tb_test_tunnel_dma_chain()
1950 KUNIT_EXPECT_PTR_EQ(test, tunnel->paths[0]->hops[1].out_port, in tb_test_tunnel_dma_chain()
1952 KUNIT_EXPECT_PTR_EQ(test, tunnel->paths[0]->hops[2].in_port, in tb_test_tunnel_dma_chain()
1954 KUNIT_EXPECT_PTR_EQ(test, tunnel->paths[0]->hops[2].out_port, nhi); in tb_test_tunnel_dma_chain()
1955 KUNIT_EXPECT_EQ(test, tunnel->paths[0]->hops[2].next_hop_index, 1); in tb_test_tunnel_dma_chain()
1957 KUNIT_ASSERT_EQ(test, tunnel->paths[1]->path_length, 3); in tb_test_tunnel_dma_chain()
1958 KUNIT_EXPECT_PTR_EQ(test, tunnel->paths[1]->hops[0].in_port, nhi); in tb_test_tunnel_dma_chain()
1959 KUNIT_EXPECT_EQ(test, tunnel->paths[1]->hops[0].in_hop_index, 1); in tb_test_tunnel_dma_chain()
1960 KUNIT_EXPECT_PTR_EQ(test, tunnel->paths[1]->hops[1].in_port, in tb_test_tunnel_dma_chain()
1962 KUNIT_EXPECT_PTR_EQ(test, tunnel->paths[1]->hops[1].out_port, in tb_test_tunnel_dma_chain()
1964 KUNIT_EXPECT_PTR_EQ(test, tunnel->paths[1]->hops[2].in_port, in tb_test_tunnel_dma_chain()
1966 KUNIT_EXPECT_PTR_EQ(test, tunnel->paths[1]->hops[2].out_port, port); in tb_test_tunnel_dma_chain()
1967 KUNIT_EXPECT_EQ(test, tunnel->paths[1]->hops[2].next_hop_index, 8); in tb_test_tunnel_dma_chain()
1969 tb_tunnel_free(tunnel); in tb_test_tunnel_dma_chain()
1975 struct tb_tunnel *tunnel; in tb_test_tunnel_dma_match() local
1982 tunnel = tb_tunnel_alloc_dma(NULL, nhi, port, 15, 1, 15, 1); in tb_test_tunnel_dma_match()
1983 KUNIT_ASSERT_NOT_NULL(test, tunnel); in tb_test_tunnel_dma_match()
1985 KUNIT_ASSERT_TRUE(test, tb_tunnel_match_dma(tunnel, 15, 1, 15, 1)); in tb_test_tunnel_dma_match()
1986 KUNIT_ASSERT_FALSE(test, tb_tunnel_match_dma(tunnel, 8, 1, 15, 1)); in tb_test_tunnel_dma_match()
1987 KUNIT_ASSERT_TRUE(test, tb_tunnel_match_dma(tunnel, -1, -1, 15, 1)); in tb_test_tunnel_dma_match()
1988 KUNIT_ASSERT_TRUE(test, tb_tunnel_match_dma(tunnel, 15, 1, -1, -1)); in tb_test_tunnel_dma_match()
1989 KUNIT_ASSERT_TRUE(test, tb_tunnel_match_dma(tunnel, 15, -1, -1, -1)); in tb_test_tunnel_dma_match()
1990 KUNIT_ASSERT_TRUE(test, tb_tunnel_match_dma(tunnel, -1, 1, -1, -1)); in tb_test_tunnel_dma_match()
1991 KUNIT_ASSERT_TRUE(test, tb_tunnel_match_dma(tunnel, -1, -1, 15, -1)); in tb_test_tunnel_dma_match()
1992 KUNIT_ASSERT_TRUE(test, tb_tunnel_match_dma(tunnel, -1, -1, -1, 1)); in tb_test_tunnel_dma_match()
1993 KUNIT_ASSERT_TRUE(test, tb_tunnel_match_dma(tunnel, -1, -1, -1, -1)); in tb_test_tunnel_dma_match()
1994 KUNIT_ASSERT_FALSE(test, tb_tunnel_match_dma(tunnel, 8, -1, 8, -1)); in tb_test_tunnel_dma_match()
1996 tb_tunnel_free(tunnel); in tb_test_tunnel_dma_match()
1998 tunnel = tb_tunnel_alloc_dma(NULL, nhi, port, 15, 1, -1, -1); in tb_test_tunnel_dma_match()
1999 KUNIT_ASSERT_NOT_NULL(test, tunnel); in tb_test_tunnel_dma_match()
2000 KUNIT_ASSERT_TRUE(test, tb_tunnel_match_dma(tunnel, 15, 1, -1, -1)); in tb_test_tunnel_dma_match()
2001 KUNIT_ASSERT_TRUE(test, tb_tunnel_match_dma(tunnel, 15, -1, -1, -1)); in tb_test_tunnel_dma_match()
2002 KUNIT_ASSERT_TRUE(test, tb_tunnel_match_dma(tunnel, -1, 1, -1, -1)); in tb_test_tunnel_dma_match()
2003 KUNIT_ASSERT_TRUE(test, tb_tunnel_match_dma(tunnel, -1, -1, -1, -1)); in tb_test_tunnel_dma_match()
2004 KUNIT_ASSERT_FALSE(test, tb_tunnel_match_dma(tunnel, 15, 1, 15, 1)); in tb_test_tunnel_dma_match()
2005 KUNIT_ASSERT_FALSE(test, tb_tunnel_match_dma(tunnel, -1, -1, 15, 1)); in tb_test_tunnel_dma_match()
2006 KUNIT_ASSERT_FALSE(test, tb_tunnel_match_dma(tunnel, 15, 11, -1, -1)); in tb_test_tunnel_dma_match()
2008 tb_tunnel_free(tunnel); in tb_test_tunnel_dma_match()
2010 tunnel = tb_tunnel_alloc_dma(NULL, nhi, port, -1, -1, 15, 11); in tb_test_tunnel_dma_match()
2011 KUNIT_ASSERT_NOT_NULL(test, tunnel); in tb_test_tunnel_dma_match()
2012 KUNIT_ASSERT_TRUE(test, tb_tunnel_match_dma(tunnel, -1, -1, 15, 11)); in tb_test_tunnel_dma_match()
2013 KUNIT_ASSERT_TRUE(test, tb_tunnel_match_dma(tunnel, -1, -1, 15, -1)); in tb_test_tunnel_dma_match()
2014 KUNIT_ASSERT_TRUE(test, tb_tunnel_match_dma(tunnel, -1, -1, -1, 11)); in tb_test_tunnel_dma_match()
2015 KUNIT_ASSERT_TRUE(test, tb_tunnel_match_dma(tunnel, -1, -1, -1, -1)); in tb_test_tunnel_dma_match()
2016 KUNIT_ASSERT_FALSE(test, tb_tunnel_match_dma(tunnel, -1, -1, 15, 1)); in tb_test_tunnel_dma_match()
2017 KUNIT_ASSERT_FALSE(test, tb_tunnel_match_dma(tunnel, -1, -1, 10, 11)); in tb_test_tunnel_dma_match()
2018 KUNIT_ASSERT_FALSE(test, tb_tunnel_match_dma(tunnel, 15, 11, -1, -1)); in tb_test_tunnel_dma_match()
2020 tb_tunnel_free(tunnel); in tb_test_tunnel_dma_match()
2027 struct tb_tunnel *tunnel; in tb_test_credit_alloc_legacy_not_bonded() local
2035 tunnel = tb_tunnel_alloc_pci(NULL, up, down); in tb_test_credit_alloc_legacy_not_bonded()
2036 KUNIT_ASSERT_NOT_NULL(test, tunnel); in tb_test_credit_alloc_legacy_not_bonded()
2037 KUNIT_ASSERT_EQ(test, tunnel->npaths, (size_t)2); in tb_test_credit_alloc_legacy_not_bonded()
2039 path = tunnel->paths[0]; in tb_test_credit_alloc_legacy_not_bonded()
2046 path = tunnel->paths[1]; in tb_test_credit_alloc_legacy_not_bonded()
2053 tb_tunnel_free(tunnel); in tb_test_credit_alloc_legacy_not_bonded()
2060 struct tb_tunnel *tunnel; in tb_test_credit_alloc_legacy_bonded() local
2068 tunnel = tb_tunnel_alloc_pci(NULL, up, down); in tb_test_credit_alloc_legacy_bonded()
2069 KUNIT_ASSERT_NOT_NULL(test, tunnel); in tb_test_credit_alloc_legacy_bonded()
2070 KUNIT_ASSERT_EQ(test, tunnel->npaths, (size_t)2); in tb_test_credit_alloc_legacy_bonded()
2072 path = tunnel->paths[0]; in tb_test_credit_alloc_legacy_bonded()
2079 path = tunnel->paths[1]; in tb_test_credit_alloc_legacy_bonded()
2086 tb_tunnel_free(tunnel); in tb_test_credit_alloc_legacy_bonded()
2093 struct tb_tunnel *tunnel; in tb_test_credit_alloc_pcie() local
2101 tunnel = tb_tunnel_alloc_pci(NULL, up, down); in tb_test_credit_alloc_pcie()
2102 KUNIT_ASSERT_NOT_NULL(test, tunnel); in tb_test_credit_alloc_pcie()
2103 KUNIT_ASSERT_EQ(test, tunnel->npaths, (size_t)2); in tb_test_credit_alloc_pcie()
2105 path = tunnel->paths[0]; in tb_test_credit_alloc_pcie()
2112 path = tunnel->paths[1]; in tb_test_credit_alloc_pcie()
2119 tb_tunnel_free(tunnel); in tb_test_credit_alloc_pcie()
2126 struct tb_tunnel *tunnel; in tb_test_credit_alloc_without_dp() local
2149 tunnel = tb_tunnel_alloc_pci(NULL, up, down); in tb_test_credit_alloc_without_dp()
2150 KUNIT_ASSERT_TRUE(test, tunnel != NULL); in tb_test_credit_alloc_without_dp()
2151 KUNIT_ASSERT_EQ(test, tunnel->npaths, (size_t)2); in tb_test_credit_alloc_without_dp()
2154 path = tunnel->paths[0]; in tb_test_credit_alloc_without_dp()
2162 path = tunnel->paths[1]; in tb_test_credit_alloc_without_dp()
2169 tb_tunnel_free(tunnel); in tb_test_credit_alloc_without_dp()
2176 struct tb_tunnel *tunnel; in tb_test_credit_alloc_dp() local
2185 tunnel = tb_tunnel_alloc_dp(NULL, in, out, 1, 0, 0); in tb_test_credit_alloc_dp()
2186 KUNIT_ASSERT_NOT_NULL(test, tunnel); in tb_test_credit_alloc_dp()
2187 KUNIT_ASSERT_EQ(test, tunnel->npaths, (size_t)3); in tb_test_credit_alloc_dp()
2190 path = tunnel->paths[0]; in tb_test_credit_alloc_dp()
2198 path = tunnel->paths[1]; in tb_test_credit_alloc_dp()
2206 path = tunnel->paths[2]; in tb_test_credit_alloc_dp()
2213 tb_tunnel_free(tunnel); in tb_test_credit_alloc_dp()
2220 struct tb_tunnel *tunnel; in tb_test_credit_alloc_usb3() local
2228 tunnel = tb_tunnel_alloc_usb3(NULL, up, down, 0, 0); in tb_test_credit_alloc_usb3()
2229 KUNIT_ASSERT_NOT_NULL(test, tunnel); in tb_test_credit_alloc_usb3()
2230 KUNIT_ASSERT_EQ(test, tunnel->npaths, (size_t)2); in tb_test_credit_alloc_usb3()
2232 path = tunnel->paths[0]; in tb_test_credit_alloc_usb3()
2239 path = tunnel->paths[1]; in tb_test_credit_alloc_usb3()
2246 tb_tunnel_free(tunnel); in tb_test_credit_alloc_usb3()
2253 struct tb_tunnel *tunnel; in tb_test_credit_alloc_dma() local
2262 tunnel = tb_tunnel_alloc_dma(NULL, nhi, port, 8, 1, 8, 1); in tb_test_credit_alloc_dma()
2263 KUNIT_ASSERT_NOT_NULL(test, tunnel); in tb_test_credit_alloc_dma()
2264 KUNIT_ASSERT_EQ(test, tunnel->npaths, (size_t)2); in tb_test_credit_alloc_dma()
2267 path = tunnel->paths[0]; in tb_test_credit_alloc_dma()
2275 path = tunnel->paths[1]; in tb_test_credit_alloc_dma()
2282 tb_tunnel_free(tunnel); in tb_test_credit_alloc_dma()
2313 * So on host the first tunnel gets 14 and the second gets the in tb_test_credit_alloc_dma_multiple()
2356 * Release the first DMA tunnel. That should make 14 buffers in tb_test_credit_alloc_dma_multiple()
2357 * available for the next tunnel. in tb_test_credit_alloc_dma_multiple()