Lines Matching +full:in +full:- +full:ports

1 // SPDX-License-Identifier: GPL-2.0
20 res->data = ida; in __ida_init()
26 struct ida *ida = res->data; in __ida_destroy()
47 sw->config.upstream_port_number = upstream_port; in alloc_switch()
48 sw->config.depth = tb_route_length(route); in alloc_switch()
49 sw->config.route_hi = upper_32_bits(route); in alloc_switch()
50 sw->config.route_lo = lower_32_bits(route); in alloc_switch()
51 sw->config.enabled = 0; in alloc_switch()
52 sw->config.max_port_number = max_port_number; in alloc_switch()
54 size = (sw->config.max_port_number + 1) * sizeof(*sw->ports); in alloc_switch()
55 sw->ports = kunit_kzalloc(test, size, GFP_KERNEL); in alloc_switch()
56 if (!sw->ports) in alloc_switch()
59 for (i = 0; i <= sw->config.max_port_number; i++) { in alloc_switch()
60 sw->ports[i].sw = sw; in alloc_switch()
61 sw->ports[i].port = i; in alloc_switch()
62 sw->ports[i].config.port_number = i; in alloc_switch()
64 kunit_ida_init(test, &sw->ports[i].in_hopids); in alloc_switch()
65 kunit_ida_init(test, &sw->ports[i].out_hopids); in alloc_switch()
80 sw->config.vendor_id = 0x8086; in alloc_host()
81 sw->config.device_id = 0x9a1b; in alloc_host()
83 sw->ports[0].config.type = TB_TYPE_PORT; in alloc_host()
84 sw->ports[0].config.max_in_hop_id = 7; in alloc_host()
85 sw->ports[0].config.max_out_hop_id = 7; in alloc_host()
87 sw->ports[1].config.type = TB_TYPE_PORT; in alloc_host()
88 sw->ports[1].config.max_in_hop_id = 19; in alloc_host()
89 sw->ports[1].config.max_out_hop_id = 19; in alloc_host()
90 sw->ports[1].total_credits = 60; in alloc_host()
91 sw->ports[1].ctl_credits = 2; in alloc_host()
92 sw->ports[1].dual_link_port = &sw->ports[2]; in alloc_host()
94 sw->ports[2].config.type = TB_TYPE_PORT; in alloc_host()
95 sw->ports[2].config.max_in_hop_id = 19; in alloc_host()
96 sw->ports[2].config.max_out_hop_id = 19; in alloc_host()
97 sw->ports[2].total_credits = 60; in alloc_host()
98 sw->ports[2].ctl_credits = 2; in alloc_host()
99 sw->ports[2].dual_link_port = &sw->ports[1]; in alloc_host()
100 sw->ports[2].link_nr = 1; in alloc_host()
102 sw->ports[3].config.type = TB_TYPE_PORT; in alloc_host()
103 sw->ports[3].config.max_in_hop_id = 19; in alloc_host()
104 sw->ports[3].config.max_out_hop_id = 19; in alloc_host()
105 sw->ports[3].total_credits = 60; in alloc_host()
106 sw->ports[3].ctl_credits = 2; in alloc_host()
107 sw->ports[3].dual_link_port = &sw->ports[4]; in alloc_host()
109 sw->ports[4].config.type = TB_TYPE_PORT; in alloc_host()
110 sw->ports[4].config.max_in_hop_id = 19; in alloc_host()
111 sw->ports[4].config.max_out_hop_id = 19; in alloc_host()
112 sw->ports[4].total_credits = 60; in alloc_host()
113 sw->ports[4].ctl_credits = 2; in alloc_host()
114 sw->ports[4].dual_link_port = &sw->ports[3]; in alloc_host()
115 sw->ports[4].link_nr = 1; in alloc_host()
117 sw->ports[5].config.type = TB_TYPE_DP_HDMI_IN; in alloc_host()
118 sw->ports[5].config.max_in_hop_id = 9; in alloc_host()
119 sw->ports[5].config.max_out_hop_id = 9; in alloc_host()
120 sw->ports[5].cap_adap = -1; in alloc_host()
122 sw->ports[6].config.type = TB_TYPE_DP_HDMI_IN; in alloc_host()
123 sw->ports[6].config.max_in_hop_id = 9; in alloc_host()
124 sw->ports[6].config.max_out_hop_id = 9; in alloc_host()
125 sw->ports[6].cap_adap = -1; in alloc_host()
127 sw->ports[7].config.type = TB_TYPE_NHI; in alloc_host()
128 sw->ports[7].config.max_in_hop_id = 11; in alloc_host()
129 sw->ports[7].config.max_out_hop_id = 11; in alloc_host()
130 sw->ports[7].config.nfc_credits = 0x41800000; in alloc_host()
132 sw->ports[8].config.type = TB_TYPE_PCIE_DOWN; in alloc_host()
133 sw->ports[8].config.max_in_hop_id = 8; in alloc_host()
134 sw->ports[8].config.max_out_hop_id = 8; in alloc_host()
136 sw->ports[9].config.type = TB_TYPE_PCIE_DOWN; in alloc_host()
137 sw->ports[9].config.max_in_hop_id = 8; in alloc_host()
138 sw->ports[9].config.max_out_hop_id = 8; in alloc_host()
140 sw->ports[10].disabled = true; in alloc_host()
141 sw->ports[11].disabled = true; in alloc_host()
143 sw->ports[12].config.type = TB_TYPE_USB3_DOWN; in alloc_host()
144 sw->ports[12].config.max_in_hop_id = 8; in alloc_host()
145 sw->ports[12].config.max_out_hop_id = 8; in alloc_host()
147 sw->ports[13].config.type = TB_TYPE_USB3_DOWN; in alloc_host()
148 sw->ports[13].config.max_in_hop_id = 8; in alloc_host()
149 sw->ports[13].config.max_out_hop_id = 8; in alloc_host()
162 sw->generation = 4; in alloc_host_usb4()
163 sw->credit_allocation = true; in alloc_host_usb4()
164 sw->max_usb3_credits = 32; in alloc_host_usb4()
165 sw->min_dp_aux_credits = 1; in alloc_host_usb4()
166 sw->min_dp_main_credits = 0; in alloc_host_usb4()
167 sw->max_pcie_credits = 64; in alloc_host_usb4()
168 sw->max_dma_credits = 14; in alloc_host_usb4()
181 sw->ports[10].config.type = TB_TYPE_DP_HDMI_IN; in alloc_host_br()
182 sw->ports[10].config.max_in_hop_id = 9; in alloc_host_br()
183 sw->ports[10].config.max_out_hop_id = 9; in alloc_host_br()
184 sw->ports[10].cap_adap = -1; in alloc_host_br()
185 sw->ports[10].disabled = false; in alloc_host_br()
201 sw->config.vendor_id = 0x8086; in alloc_dev_default()
202 sw->config.device_id = 0x15ef; in alloc_dev_default()
204 sw->ports[0].config.type = TB_TYPE_PORT; in alloc_dev_default()
205 sw->ports[0].config.max_in_hop_id = 8; in alloc_dev_default()
206 sw->ports[0].config.max_out_hop_id = 8; in alloc_dev_default()
208 sw->ports[1].config.type = TB_TYPE_PORT; in alloc_dev_default()
209 sw->ports[1].config.max_in_hop_id = 19; in alloc_dev_default()
210 sw->ports[1].config.max_out_hop_id = 19; in alloc_dev_default()
211 sw->ports[1].total_credits = 60; in alloc_dev_default()
212 sw->ports[1].ctl_credits = 2; in alloc_dev_default()
213 sw->ports[1].dual_link_port = &sw->ports[2]; in alloc_dev_default()
215 sw->ports[2].config.type = TB_TYPE_PORT; in alloc_dev_default()
216 sw->ports[2].config.max_in_hop_id = 19; in alloc_dev_default()
217 sw->ports[2].config.max_out_hop_id = 19; in alloc_dev_default()
218 sw->ports[2].total_credits = 60; in alloc_dev_default()
219 sw->ports[2].ctl_credits = 2; in alloc_dev_default()
220 sw->ports[2].dual_link_port = &sw->ports[1]; in alloc_dev_default()
221 sw->ports[2].link_nr = 1; in alloc_dev_default()
223 sw->ports[3].config.type = TB_TYPE_PORT; in alloc_dev_default()
224 sw->ports[3].config.max_in_hop_id = 19; in alloc_dev_default()
225 sw->ports[3].config.max_out_hop_id = 19; in alloc_dev_default()
226 sw->ports[3].total_credits = 60; in alloc_dev_default()
227 sw->ports[3].ctl_credits = 2; in alloc_dev_default()
228 sw->ports[3].dual_link_port = &sw->ports[4]; in alloc_dev_default()
230 sw->ports[4].config.type = TB_TYPE_PORT; in alloc_dev_default()
231 sw->ports[4].config.max_in_hop_id = 19; in alloc_dev_default()
232 sw->ports[4].config.max_out_hop_id = 19; in alloc_dev_default()
233 sw->ports[4].total_credits = 60; in alloc_dev_default()
234 sw->ports[4].ctl_credits = 2; in alloc_dev_default()
235 sw->ports[4].dual_link_port = &sw->ports[3]; in alloc_dev_default()
236 sw->ports[4].link_nr = 1; in alloc_dev_default()
238 sw->ports[5].config.type = TB_TYPE_PORT; in alloc_dev_default()
239 sw->ports[5].config.max_in_hop_id = 19; in alloc_dev_default()
240 sw->ports[5].config.max_out_hop_id = 19; in alloc_dev_default()
241 sw->ports[5].total_credits = 60; in alloc_dev_default()
242 sw->ports[5].ctl_credits = 2; in alloc_dev_default()
243 sw->ports[5].dual_link_port = &sw->ports[6]; in alloc_dev_default()
245 sw->ports[6].config.type = TB_TYPE_PORT; in alloc_dev_default()
246 sw->ports[6].config.max_in_hop_id = 19; in alloc_dev_default()
247 sw->ports[6].config.max_out_hop_id = 19; in alloc_dev_default()
248 sw->ports[6].total_credits = 60; in alloc_dev_default()
249 sw->ports[6].ctl_credits = 2; in alloc_dev_default()
250 sw->ports[6].dual_link_port = &sw->ports[5]; in alloc_dev_default()
251 sw->ports[6].link_nr = 1; in alloc_dev_default()
253 sw->ports[7].config.type = TB_TYPE_PORT; in alloc_dev_default()
254 sw->ports[7].config.max_in_hop_id = 19; in alloc_dev_default()
255 sw->ports[7].config.max_out_hop_id = 19; in alloc_dev_default()
256 sw->ports[7].total_credits = 60; in alloc_dev_default()
257 sw->ports[7].ctl_credits = 2; in alloc_dev_default()
258 sw->ports[7].dual_link_port = &sw->ports[8]; in alloc_dev_default()
260 sw->ports[8].config.type = TB_TYPE_PORT; in alloc_dev_default()
261 sw->ports[8].config.max_in_hop_id = 19; in alloc_dev_default()
262 sw->ports[8].config.max_out_hop_id = 19; in alloc_dev_default()
263 sw->ports[8].total_credits = 60; in alloc_dev_default()
264 sw->ports[8].ctl_credits = 2; in alloc_dev_default()
265 sw->ports[8].dual_link_port = &sw->ports[7]; in alloc_dev_default()
266 sw->ports[8].link_nr = 1; in alloc_dev_default()
268 sw->ports[9].config.type = TB_TYPE_PCIE_UP; in alloc_dev_default()
269 sw->ports[9].config.max_in_hop_id = 8; in alloc_dev_default()
270 sw->ports[9].config.max_out_hop_id = 8; in alloc_dev_default()
272 sw->ports[10].config.type = TB_TYPE_PCIE_DOWN; in alloc_dev_default()
273 sw->ports[10].config.max_in_hop_id = 8; in alloc_dev_default()
274 sw->ports[10].config.max_out_hop_id = 8; in alloc_dev_default()
276 sw->ports[11].config.type = TB_TYPE_PCIE_DOWN; in alloc_dev_default()
277 sw->ports[11].config.max_in_hop_id = 8; in alloc_dev_default()
278 sw->ports[11].config.max_out_hop_id = 8; in alloc_dev_default()
280 sw->ports[12].config.type = TB_TYPE_PCIE_DOWN; in alloc_dev_default()
281 sw->ports[12].config.max_in_hop_id = 8; in alloc_dev_default()
282 sw->ports[12].config.max_out_hop_id = 8; in alloc_dev_default()
284 sw->ports[13].config.type = TB_TYPE_DP_HDMI_OUT; in alloc_dev_default()
285 sw->ports[13].config.max_in_hop_id = 9; in alloc_dev_default()
286 sw->ports[13].config.max_out_hop_id = 9; in alloc_dev_default()
287 sw->ports[13].cap_adap = -1; in alloc_dev_default()
289 sw->ports[14].config.type = TB_TYPE_DP_HDMI_OUT; in alloc_dev_default()
290 sw->ports[14].config.max_in_hop_id = 9; in alloc_dev_default()
291 sw->ports[14].config.max_out_hop_id = 9; in alloc_dev_default()
292 sw->ports[14].cap_adap = -1; in alloc_dev_default()
294 sw->ports[15].disabled = true; in alloc_dev_default()
296 sw->ports[16].config.type = TB_TYPE_USB3_UP; in alloc_dev_default()
297 sw->ports[16].config.max_in_hop_id = 8; in alloc_dev_default()
298 sw->ports[16].config.max_out_hop_id = 8; in alloc_dev_default()
300 sw->ports[17].config.type = TB_TYPE_USB3_DOWN; in alloc_dev_default()
301 sw->ports[17].config.max_in_hop_id = 8; in alloc_dev_default()
302 sw->ports[17].config.max_out_hop_id = 8; in alloc_dev_default()
304 sw->ports[18].config.type = TB_TYPE_USB3_DOWN; in alloc_dev_default()
305 sw->ports[18].config.max_in_hop_id = 8; in alloc_dev_default()
306 sw->ports[18].config.max_out_hop_id = 8; in alloc_dev_default()
308 sw->ports[19].config.type = TB_TYPE_USB3_DOWN; in alloc_dev_default()
309 sw->ports[19].config.max_in_hop_id = 8; in alloc_dev_default()
310 sw->ports[19].config.max_out_hop_id = 8; in alloc_dev_default()
318 port->remote = upstream_port; in alloc_dev_default()
319 upstream_port->remote = port; in alloc_dev_default()
320 if (port->dual_link_port && upstream_port->dual_link_port) { in alloc_dev_default()
321 port->dual_link_port->remote = upstream_port->dual_link_port; in alloc_dev_default()
322 upstream_port->dual_link_port->remote = port->dual_link_port; in alloc_dev_default()
326 port->bonded = true; in alloc_dev_default()
327 port->total_credits *= 2; in alloc_dev_default()
328 port->dual_link_port->bonded = true; in alloc_dev_default()
329 port->dual_link_port->total_credits = 0; in alloc_dev_default()
330 upstream_port->bonded = true; in alloc_dev_default()
331 upstream_port->total_credits *= 2; in alloc_dev_default()
332 upstream_port->dual_link_port->bonded = true; in alloc_dev_default()
333 upstream_port->dual_link_port->total_credits = 0; in alloc_dev_default()
350 sw->ports[13].config.type = TB_TYPE_DP_HDMI_IN; in alloc_dev_with_dpin()
351 sw->ports[13].config.max_in_hop_id = 9; in alloc_dev_with_dpin()
352 sw->ports[13].config.max_out_hop_id = 9; in alloc_dev_with_dpin()
354 sw->ports[14].config.type = TB_TYPE_DP_HDMI_IN; in alloc_dev_with_dpin()
355 sw->ports[14].config.max_in_hop_id = 9; in alloc_dev_with_dpin()
356 sw->ports[14].config.max_out_hop_id = 9; in alloc_dev_with_dpin()
380 sw->ports[i].disabled = true; in alloc_dev_without_dp()
383 sw->ports[i].disabled = true; in alloc_dev_without_dp()
385 sw->ports[13].cap_adap = 0; in alloc_dev_without_dp()
386 sw->ports[14].cap_adap = 0; in alloc_dev_without_dp()
389 sw->ports[i].disabled = true; in alloc_dev_without_dp()
391 sw->generation = 4; in alloc_dev_without_dp()
392 sw->credit_allocation = true; in alloc_dev_without_dp()
393 sw->max_usb3_credits = 109; in alloc_dev_without_dp()
394 sw->min_dp_aux_credits = 0; in alloc_dev_without_dp()
395 sw->min_dp_main_credits = 0; in alloc_dev_without_dp()
396 sw->max_pcie_credits = 30; in alloc_dev_without_dp()
397 sw->max_dma_credits = 1; in alloc_dev_without_dp()
412 sw->generation = 4; in alloc_dev_usb4()
413 sw->credit_allocation = true; in alloc_dev_usb4()
414 sw->max_usb3_credits = 14; in alloc_dev_usb4()
415 sw->min_dp_aux_credits = 1; in alloc_dev_usb4()
416 sw->min_dp_main_credits = 18; in alloc_dev_usb4()
417 sw->max_pcie_credits = 32; in alloc_dev_usb4()
418 sw->max_dma_credits = 14; in alloc_dev_usb4()
430 src_port = &host->ports[5]; in tb_test_path_basic()
449 src_port = &host->ports[12]; in tb_test_path_not_connected_walk()
450 dst_port = &dev->ports[16]; in tb_test_path_not_connected_walk()
456 KUNIT_EXPECT_PTR_EQ(test, p, &host->ports[3]); in tb_test_path_not_connected_walk()
467 KUNIT_EXPECT_PTR_EQ(test, p, &dev->ports[1]); in tb_test_path_not_connected_walk()
503 src_port = &host->ports[8]; in tb_test_path_single_hop_walk()
504 dst_port = &dev->ports[9]; in tb_test_path_single_hop_walk()
511 KUNIT_EXPECT_EQ(test, tb_route(p->sw), test_data[i].route); in tb_test_path_single_hop_walk()
512 KUNIT_EXPECT_EQ(test, p->port, test_data[i].port); in tb_test_path_single_hop_walk()
513 KUNIT_EXPECT_EQ(test, (enum tb_port_type)p->config.type, in tb_test_path_single_hop_walk()
520 i = ARRAY_SIZE(test_data) - 1; in tb_test_path_single_hop_walk()
523 KUNIT_EXPECT_EQ(test, tb_route(p->sw), test_data[i].route); in tb_test_path_single_hop_walk()
524 KUNIT_EXPECT_EQ(test, p->port, test_data[i].port); in tb_test_path_single_hop_walk()
525 KUNIT_EXPECT_EQ(test, (enum tb_port_type)p->config.type, in tb_test_path_single_hop_walk()
527 i--; in tb_test_path_single_hop_walk()
530 KUNIT_EXPECT_EQ(test, i, -1); in tb_test_path_single_hop_walk()
536 * Walks from Host DP IN to Device #2 DP OUT. in tb_test_path_daisy_chain_walk()
562 src_port = &host->ports[5]; in tb_test_path_daisy_chain_walk()
563 dst_port = &dev2->ports[13]; in tb_test_path_daisy_chain_walk()
570 KUNIT_EXPECT_EQ(test, tb_route(p->sw), test_data[i].route); in tb_test_path_daisy_chain_walk()
571 KUNIT_EXPECT_EQ(test, p->port, test_data[i].port); in tb_test_path_daisy_chain_walk()
572 KUNIT_EXPECT_EQ(test, (enum tb_port_type)p->config.type, in tb_test_path_daisy_chain_walk()
579 i = ARRAY_SIZE(test_data) - 1; in tb_test_path_daisy_chain_walk()
582 KUNIT_EXPECT_EQ(test, tb_route(p->sw), test_data[i].route); in tb_test_path_daisy_chain_walk()
583 KUNIT_EXPECT_EQ(test, p->port, test_data[i].port); in tb_test_path_daisy_chain_walk()
584 KUNIT_EXPECT_EQ(test, (enum tb_port_type)p->config.type, in tb_test_path_daisy_chain_walk()
586 i--; in tb_test_path_daisy_chain_walk()
589 KUNIT_EXPECT_EQ(test, i, -1); in tb_test_path_daisy_chain_walk()
595 * Walks from Host DP IN to Device #3 DP OUT. in tb_test_path_simple_tree_walk()
625 src_port = &host->ports[5]; in tb_test_path_simple_tree_walk()
626 dst_port = &dev3->ports[13]; in tb_test_path_simple_tree_walk()
633 KUNIT_EXPECT_EQ(test, tb_route(p->sw), test_data[i].route); in tb_test_path_simple_tree_walk()
634 KUNIT_EXPECT_EQ(test, p->port, test_data[i].port); in tb_test_path_simple_tree_walk()
635 KUNIT_EXPECT_EQ(test, (enum tb_port_type)p->config.type, in tb_test_path_simple_tree_walk()
642 i = ARRAY_SIZE(test_data) - 1; in tb_test_path_simple_tree_walk()
645 KUNIT_EXPECT_EQ(test, tb_route(p->sw), test_data[i].route); in tb_test_path_simple_tree_walk()
646 KUNIT_EXPECT_EQ(test, p->port, test_data[i].port); in tb_test_path_simple_tree_walk()
647 KUNIT_EXPECT_EQ(test, (enum tb_port_type)p->config.type, in tb_test_path_simple_tree_walk()
649 i--; in tb_test_path_simple_tree_walk()
652 KUNIT_EXPECT_EQ(test, i, -1); in tb_test_path_simple_tree_walk()
658 * Walks from Device #3 DP IN to Device #9 DP OUT. in tb_test_path_complex_tree_walk()
709 src_port = &dev3->ports[13]; in tb_test_path_complex_tree_walk()
710 dst_port = &dev9->ports[14]; in tb_test_path_complex_tree_walk()
717 KUNIT_EXPECT_EQ(test, tb_route(p->sw), test_data[i].route); in tb_test_path_complex_tree_walk()
718 KUNIT_EXPECT_EQ(test, p->port, test_data[i].port); in tb_test_path_complex_tree_walk()
719 KUNIT_EXPECT_EQ(test, (enum tb_port_type)p->config.type, in tb_test_path_complex_tree_walk()
726 i = ARRAY_SIZE(test_data) - 1; in tb_test_path_complex_tree_walk()
729 KUNIT_EXPECT_EQ(test, tb_route(p->sw), test_data[i].route); in tb_test_path_complex_tree_walk()
730 KUNIT_EXPECT_EQ(test, p->port, test_data[i].port); in tb_test_path_complex_tree_walk()
731 KUNIT_EXPECT_EQ(test, (enum tb_port_type)p->config.type, in tb_test_path_complex_tree_walk()
733 i--; in tb_test_path_complex_tree_walk()
736 KUNIT_EXPECT_EQ(test, i, -1); in tb_test_path_complex_tree_walk()
747 * Walks from Device #6 DP IN to Device #12 DP OUT. in tb_test_path_max_length_walk()
812 src_port = &dev6->ports[13]; in tb_test_path_max_length_walk()
813 dst_port = &dev12->ports[13]; in tb_test_path_max_length_walk()
820 KUNIT_EXPECT_EQ(test, tb_route(p->sw), test_data[i].route); in tb_test_path_max_length_walk()
821 KUNIT_EXPECT_EQ(test, p->port, test_data[i].port); in tb_test_path_max_length_walk()
822 KUNIT_EXPECT_EQ(test, (enum tb_port_type)p->config.type, in tb_test_path_max_length_walk()
829 i = ARRAY_SIZE(test_data) - 1; in tb_test_path_max_length_walk()
832 KUNIT_EXPECT_EQ(test, tb_route(p->sw), test_data[i].route); in tb_test_path_max_length_walk()
833 KUNIT_EXPECT_EQ(test, p->port, test_data[i].port); in tb_test_path_max_length_walk()
834 KUNIT_EXPECT_EQ(test, (enum tb_port_type)p->config.type, in tb_test_path_max_length_walk()
836 i--; in tb_test_path_max_length_walk()
839 KUNIT_EXPECT_EQ(test, i, -1); in tb_test_path_max_length_walk()
853 down = &dev1->ports[10]; in tb_test_path_not_connected()
854 up = &dev2->ports[9]; in tb_test_path_not_connected()
904 down = &host->ports[9]; in tb_test_path_not_bonded_lane0()
905 up = &dev->ports[9]; in tb_test_path_not_bonded_lane0()
909 KUNIT_ASSERT_EQ(test, path->path_length, ARRAY_SIZE(test_data)); in tb_test_path_not_bonded_lane0()
913 in_port = path->hops[i].in_port; in tb_test_path_not_bonded_lane0()
914 out_port = path->hops[i].out_port; in tb_test_path_not_bonded_lane0()
916 KUNIT_EXPECT_EQ(test, tb_route(in_port->sw), test_data[i].route); in tb_test_path_not_bonded_lane0()
917 KUNIT_EXPECT_EQ(test, in_port->port, test_data[i].in_port); in tb_test_path_not_bonded_lane0()
918 KUNIT_EXPECT_EQ(test, (enum tb_port_type)in_port->config.type, in tb_test_path_not_bonded_lane0()
920 KUNIT_EXPECT_EQ(test, tb_route(out_port->sw), test_data[i].route); in tb_test_path_not_bonded_lane0()
921 KUNIT_EXPECT_EQ(test, out_port->port, test_data[i].out_port); in tb_test_path_not_bonded_lane0()
922 KUNIT_EXPECT_EQ(test, (enum tb_port_type)out_port->config.type, in tb_test_path_not_bonded_lane0()
959 struct tb_port *in, *out; in tb_test_path_not_bonded_lane1() local
966 in = &host->ports[5]; in tb_test_path_not_bonded_lane1()
967 out = &dev->ports[13]; in tb_test_path_not_bonded_lane1()
969 path = tb_path_alloc(NULL, in, 9, out, 9, 1, "Video"); in tb_test_path_not_bonded_lane1()
971 KUNIT_ASSERT_EQ(test, path->path_length, ARRAY_SIZE(test_data)); in tb_test_path_not_bonded_lane1()
975 in_port = path->hops[i].in_port; in tb_test_path_not_bonded_lane1()
976 out_port = path->hops[i].out_port; in tb_test_path_not_bonded_lane1()
978 KUNIT_EXPECT_EQ(test, tb_route(in_port->sw), test_data[i].route); in tb_test_path_not_bonded_lane1()
979 KUNIT_EXPECT_EQ(test, in_port->port, test_data[i].in_port); in tb_test_path_not_bonded_lane1()
980 KUNIT_EXPECT_EQ(test, (enum tb_port_type)in_port->config.type, in tb_test_path_not_bonded_lane1()
982 KUNIT_EXPECT_EQ(test, tb_route(out_port->sw), test_data[i].route); in tb_test_path_not_bonded_lane1()
983 KUNIT_EXPECT_EQ(test, out_port->port, test_data[i].out_port); in tb_test_path_not_bonded_lane1()
984 KUNIT_EXPECT_EQ(test, (enum tb_port_type)out_port->config.type, in tb_test_path_not_bonded_lane1()
1037 struct tb_port *in, *out; in tb_test_path_not_bonded_lane1_chain() local
1046 in = &host->ports[5]; in tb_test_path_not_bonded_lane1_chain()
1047 out = &dev3->ports[13]; in tb_test_path_not_bonded_lane1_chain()
1049 path = tb_path_alloc(NULL, in, 9, out, 9, 1, "Video"); in tb_test_path_not_bonded_lane1_chain()
1051 KUNIT_ASSERT_EQ(test, path->path_length, ARRAY_SIZE(test_data)); in tb_test_path_not_bonded_lane1_chain()
1055 in_port = path->hops[i].in_port; in tb_test_path_not_bonded_lane1_chain()
1056 out_port = path->hops[i].out_port; in tb_test_path_not_bonded_lane1_chain()
1058 KUNIT_EXPECT_EQ(test, tb_route(in_port->sw), test_data[i].route); in tb_test_path_not_bonded_lane1_chain()
1059 KUNIT_EXPECT_EQ(test, in_port->port, test_data[i].in_port); in tb_test_path_not_bonded_lane1_chain()
1060 KUNIT_EXPECT_EQ(test, (enum tb_port_type)in_port->config.type, in tb_test_path_not_bonded_lane1_chain()
1062 KUNIT_EXPECT_EQ(test, tb_route(out_port->sw), test_data[i].route); in tb_test_path_not_bonded_lane1_chain()
1063 KUNIT_EXPECT_EQ(test, out_port->port, test_data[i].out_port); in tb_test_path_not_bonded_lane1_chain()
1064 KUNIT_EXPECT_EQ(test, (enum tb_port_type)out_port->config.type, in tb_test_path_not_bonded_lane1_chain()
1117 struct tb_port *in, *out; in tb_test_path_not_bonded_lane1_chain_reverse() local
1126 in = &dev3->ports[13]; in tb_test_path_not_bonded_lane1_chain_reverse()
1127 out = &host->ports[5]; in tb_test_path_not_bonded_lane1_chain_reverse()
1129 path = tb_path_alloc(NULL, in, 9, out, 9, 1, "Video"); in tb_test_path_not_bonded_lane1_chain_reverse()
1131 KUNIT_ASSERT_EQ(test, path->path_length, ARRAY_SIZE(test_data)); in tb_test_path_not_bonded_lane1_chain_reverse()
1135 in_port = path->hops[i].in_port; in tb_test_path_not_bonded_lane1_chain_reverse()
1136 out_port = path->hops[i].out_port; in tb_test_path_not_bonded_lane1_chain_reverse()
1138 KUNIT_EXPECT_EQ(test, tb_route(in_port->sw), test_data[i].route); in tb_test_path_not_bonded_lane1_chain_reverse()
1139 KUNIT_EXPECT_EQ(test, in_port->port, test_data[i].in_port); in tb_test_path_not_bonded_lane1_chain_reverse()
1140 KUNIT_EXPECT_EQ(test, (enum tb_port_type)in_port->config.type, in tb_test_path_not_bonded_lane1_chain_reverse()
1142 KUNIT_EXPECT_EQ(test, tb_route(out_port->sw), test_data[i].route); in tb_test_path_not_bonded_lane1_chain_reverse()
1143 KUNIT_EXPECT_EQ(test, out_port->port, test_data[i].out_port); in tb_test_path_not_bonded_lane1_chain_reverse()
1144 KUNIT_EXPECT_EQ(test, (enum tb_port_type)out_port->config.type, in tb_test_path_not_bonded_lane1_chain_reverse()
1208 struct tb_port *in, *out; in tb_test_path_mixed_chain() local
1218 in = &host->ports[5]; in tb_test_path_mixed_chain()
1219 out = &dev4->ports[13]; in tb_test_path_mixed_chain()
1221 path = tb_path_alloc(NULL, in, 9, out, 9, 1, "Video"); in tb_test_path_mixed_chain()
1223 KUNIT_ASSERT_EQ(test, path->path_length, ARRAY_SIZE(test_data)); in tb_test_path_mixed_chain()
1227 in_port = path->hops[i].in_port; in tb_test_path_mixed_chain()
1228 out_port = path->hops[i].out_port; in tb_test_path_mixed_chain()
1230 KUNIT_EXPECT_EQ(test, tb_route(in_port->sw), test_data[i].route); in tb_test_path_mixed_chain()
1231 KUNIT_EXPECT_EQ(test, in_port->port, test_data[i].in_port); in tb_test_path_mixed_chain()
1232 KUNIT_EXPECT_EQ(test, (enum tb_port_type)in_port->config.type, in tb_test_path_mixed_chain()
1234 KUNIT_EXPECT_EQ(test, tb_route(out_port->sw), test_data[i].route); in tb_test_path_mixed_chain()
1235 KUNIT_EXPECT_EQ(test, out_port->port, test_data[i].out_port); in tb_test_path_mixed_chain()
1236 KUNIT_EXPECT_EQ(test, (enum tb_port_type)out_port->config.type, in tb_test_path_mixed_chain()
1300 struct tb_port *in, *out; in tb_test_path_mixed_chain_reverse() local
1310 in = &dev4->ports[13]; in tb_test_path_mixed_chain_reverse()
1311 out = &host->ports[5]; in tb_test_path_mixed_chain_reverse()
1313 path = tb_path_alloc(NULL, in, 9, out, 9, 1, "Video"); in tb_test_path_mixed_chain_reverse()
1315 KUNIT_ASSERT_EQ(test, path->path_length, ARRAY_SIZE(test_data)); in tb_test_path_mixed_chain_reverse()
1319 in_port = path->hops[i].in_port; in tb_test_path_mixed_chain_reverse()
1320 out_port = path->hops[i].out_port; in tb_test_path_mixed_chain_reverse()
1322 KUNIT_EXPECT_EQ(test, tb_route(in_port->sw), test_data[i].route); in tb_test_path_mixed_chain_reverse()
1323 KUNIT_EXPECT_EQ(test, in_port->port, test_data[i].in_port); in tb_test_path_mixed_chain_reverse()
1324 KUNIT_EXPECT_EQ(test, (enum tb_port_type)in_port->config.type, in tb_test_path_mixed_chain_reverse()
1326 KUNIT_EXPECT_EQ(test, tb_route(out_port->sw), test_data[i].route); in tb_test_path_mixed_chain_reverse()
1327 KUNIT_EXPECT_EQ(test, out_port->port, test_data[i].out_port); in tb_test_path_mixed_chain_reverse()
1328 KUNIT_EXPECT_EQ(test, (enum tb_port_type)out_port->config.type, in tb_test_path_mixed_chain_reverse()
1355 down = &host->ports[8]; in tb_test_tunnel_pcie()
1356 up = &dev1->ports[9]; in tb_test_tunnel_pcie()
1359 KUNIT_EXPECT_EQ(test, tunnel1->type, TB_TUNNEL_PCI); in tb_test_tunnel_pcie()
1360 KUNIT_EXPECT_PTR_EQ(test, tunnel1->src_port, down); in tb_test_tunnel_pcie()
1361 KUNIT_EXPECT_PTR_EQ(test, tunnel1->dst_port, up); in tb_test_tunnel_pcie()
1362 KUNIT_ASSERT_EQ(test, tunnel1->npaths, 2); in tb_test_tunnel_pcie()
1363 KUNIT_ASSERT_EQ(test, tunnel1->paths[0]->path_length, 2); in tb_test_tunnel_pcie()
1364 KUNIT_EXPECT_PTR_EQ(test, tunnel1->paths[0]->hops[0].in_port, down); in tb_test_tunnel_pcie()
1365 KUNIT_EXPECT_PTR_EQ(test, tunnel1->paths[0]->hops[1].out_port, up); in tb_test_tunnel_pcie()
1366 KUNIT_ASSERT_EQ(test, tunnel1->paths[1]->path_length, 2); in tb_test_tunnel_pcie()
1367 KUNIT_EXPECT_PTR_EQ(test, tunnel1->paths[1]->hops[0].in_port, up); in tb_test_tunnel_pcie()
1368 KUNIT_EXPECT_PTR_EQ(test, tunnel1->paths[1]->hops[1].out_port, down); in tb_test_tunnel_pcie()
1370 down = &dev1->ports[10]; in tb_test_tunnel_pcie()
1371 up = &dev2->ports[9]; in tb_test_tunnel_pcie()
1374 KUNIT_EXPECT_EQ(test, tunnel2->type, TB_TUNNEL_PCI); in tb_test_tunnel_pcie()
1375 KUNIT_EXPECT_PTR_EQ(test, tunnel2->src_port, down); in tb_test_tunnel_pcie()
1376 KUNIT_EXPECT_PTR_EQ(test, tunnel2->dst_port, up); in tb_test_tunnel_pcie()
1377 KUNIT_ASSERT_EQ(test, tunnel2->npaths, 2); in tb_test_tunnel_pcie()
1378 KUNIT_ASSERT_EQ(test, tunnel2->paths[0]->path_length, 2); in tb_test_tunnel_pcie()
1379 KUNIT_EXPECT_PTR_EQ(test, tunnel2->paths[0]->hops[0].in_port, down); in tb_test_tunnel_pcie()
1380 KUNIT_EXPECT_PTR_EQ(test, tunnel2->paths[0]->hops[1].out_port, up); in tb_test_tunnel_pcie()
1381 KUNIT_ASSERT_EQ(test, tunnel2->paths[1]->path_length, 2); in tb_test_tunnel_pcie()
1382 KUNIT_EXPECT_PTR_EQ(test, tunnel2->paths[1]->hops[0].in_port, up); in tb_test_tunnel_pcie()
1383 KUNIT_EXPECT_PTR_EQ(test, tunnel2->paths[1]->hops[1].out_port, down); in tb_test_tunnel_pcie()
1392 struct tb_port *in, *out; in tb_test_tunnel_dp() local
1406 in = &host->ports[5]; in tb_test_tunnel_dp()
1407 out = &dev->ports[13]; in tb_test_tunnel_dp()
1409 tunnel = tb_tunnel_alloc_dp(NULL, in, out, 1, 0, 0); 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()
1430 struct tb_port *in, *out; 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()
1452 in = &host->ports[5]; in tb_test_tunnel_dp_chain()
1453 out = &dev4->ports[14]; in tb_test_tunnel_dp_chain()
1455 tunnel = tb_tunnel_alloc_dp(NULL, in, out, 1, 0, 0); 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()
1476 struct tb_port *in, *out; 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()
1502 in = &dev2->ports[13]; in tb_test_tunnel_dp_tree()
1503 out = &dev5->ports[13]; in tb_test_tunnel_dp_tree()
1505 tunnel = tb_tunnel_alloc_dp(NULL, in, out, 1, 0, 0); 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()
1527 struct tb_port *in, *out; in tb_test_tunnel_dp_max_length() local
1567 in = &dev6->ports[13]; in tb_test_tunnel_dp_max_length()
1568 out = &dev12->ports[13]; 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()
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()
1581 &host->ports[1]); 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()
1583 &host->ports[3]); 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()
1589 &host->ports[1]); 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()
1591 &host->ports[3]); 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()
1596 &host->ports[3]); 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()
1598 &host->ports[1]); 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()
1632 in1 = &host->ports[5]; in tb_test_tunnel_3dp()
1633 in2 = &host->ports[6]; in tb_test_tunnel_3dp()
1634 in3 = &host->ports[10]; in tb_test_tunnel_3dp()
1636 out1 = &dev2->ports[13]; in tb_test_tunnel_3dp()
1637 out2 = &dev5->ports[13]; in tb_test_tunnel_3dp()
1638 out3 = &dev4->ports[14]; in tb_test_tunnel_3dp()
1642 KUNIT_EXPECT_EQ(test, tunnel1->type, TB_TUNNEL_DP); in tb_test_tunnel_3dp()
1643 KUNIT_EXPECT_PTR_EQ(test, tunnel1->src_port, in1); in tb_test_tunnel_3dp()
1644 KUNIT_EXPECT_PTR_EQ(test, tunnel1->dst_port, out1); in tb_test_tunnel_3dp()
1645 KUNIT_ASSERT_EQ(test, tunnel1->npaths, 3); in tb_test_tunnel_3dp()
1646 KUNIT_ASSERT_EQ(test, tunnel1->paths[0]->path_length, 3); in tb_test_tunnel_3dp()
1650 KUNIT_EXPECT_EQ(test, tunnel2->type, TB_TUNNEL_DP); in tb_test_tunnel_3dp()
1651 KUNIT_EXPECT_PTR_EQ(test, tunnel2->src_port, in2); in tb_test_tunnel_3dp()
1652 KUNIT_EXPECT_PTR_EQ(test, tunnel2->dst_port, out2); in tb_test_tunnel_3dp()
1653 KUNIT_ASSERT_EQ(test, tunnel2->npaths, 3); in tb_test_tunnel_3dp()
1654 KUNIT_ASSERT_EQ(test, tunnel2->paths[0]->path_length, 4); in tb_test_tunnel_3dp()
1658 KUNIT_EXPECT_EQ(test, tunnel3->type, TB_TUNNEL_DP); in tb_test_tunnel_3dp()
1659 KUNIT_EXPECT_PTR_EQ(test, tunnel3->src_port, in3); in tb_test_tunnel_3dp()
1660 KUNIT_EXPECT_PTR_EQ(test, tunnel3->dst_port, out3); in tb_test_tunnel_3dp()
1661 KUNIT_ASSERT_EQ(test, tunnel3->npaths, 3); in tb_test_tunnel_3dp()
1662 KUNIT_ASSERT_EQ(test, tunnel3->paths[0]->path_length, 3); in tb_test_tunnel_3dp()
1689 down = &host->ports[12]; in tb_test_tunnel_usb3()
1690 up = &dev1->ports[16]; in tb_test_tunnel_usb3()
1693 KUNIT_EXPECT_EQ(test, tunnel1->type, TB_TUNNEL_USB3); in tb_test_tunnel_usb3()
1694 KUNIT_EXPECT_PTR_EQ(test, tunnel1->src_port, down); in tb_test_tunnel_usb3()
1695 KUNIT_EXPECT_PTR_EQ(test, tunnel1->dst_port, up); in tb_test_tunnel_usb3()
1696 KUNIT_ASSERT_EQ(test, tunnel1->npaths, 2); in tb_test_tunnel_usb3()
1697 KUNIT_ASSERT_EQ(test, tunnel1->paths[0]->path_length, 2); in tb_test_tunnel_usb3()
1698 KUNIT_EXPECT_PTR_EQ(test, tunnel1->paths[0]->hops[0].in_port, down); in tb_test_tunnel_usb3()
1699 KUNIT_EXPECT_PTR_EQ(test, tunnel1->paths[0]->hops[1].out_port, up); in tb_test_tunnel_usb3()
1700 KUNIT_ASSERT_EQ(test, tunnel1->paths[1]->path_length, 2); in tb_test_tunnel_usb3()
1701 KUNIT_EXPECT_PTR_EQ(test, tunnel1->paths[1]->hops[0].in_port, up); in tb_test_tunnel_usb3()
1702 KUNIT_EXPECT_PTR_EQ(test, tunnel1->paths[1]->hops[1].out_port, down); in tb_test_tunnel_usb3()
1704 down = &dev1->ports[17]; in tb_test_tunnel_usb3()
1705 up = &dev2->ports[16]; in tb_test_tunnel_usb3()
1708 KUNIT_EXPECT_EQ(test, tunnel2->type, TB_TUNNEL_USB3); in tb_test_tunnel_usb3()
1709 KUNIT_EXPECT_PTR_EQ(test, tunnel2->src_port, down); in tb_test_tunnel_usb3()
1710 KUNIT_EXPECT_PTR_EQ(test, tunnel2->dst_port, up); in tb_test_tunnel_usb3()
1711 KUNIT_ASSERT_EQ(test, tunnel2->npaths, 2); in tb_test_tunnel_usb3()
1712 KUNIT_ASSERT_EQ(test, tunnel2->paths[0]->path_length, 2); in tb_test_tunnel_usb3()
1713 KUNIT_EXPECT_PTR_EQ(test, tunnel2->paths[0]->hops[0].in_port, down); in tb_test_tunnel_usb3()
1714 KUNIT_EXPECT_PTR_EQ(test, tunnel2->paths[0]->hops[1].out_port, up); in tb_test_tunnel_usb3()
1715 KUNIT_ASSERT_EQ(test, tunnel2->paths[1]->path_length, 2); in tb_test_tunnel_usb3()
1716 KUNIT_EXPECT_PTR_EQ(test, tunnel2->paths[1]->hops[0].in_port, up); in tb_test_tunnel_usb3()
1717 KUNIT_EXPECT_PTR_EQ(test, tunnel2->paths[1]->hops[1].out_port, down); in tb_test_tunnel_usb3()
1726 struct tb_port *in, *out, *port; in tb_test_tunnel_port_on_path() local
1750 in = &dev2->ports[13]; in tb_test_tunnel_port_on_path()
1751 out = &dev5->ports[13]; in tb_test_tunnel_port_on_path()
1753 dp_tunnel = tb_tunnel_alloc_dp(NULL, in, out, 1, 0, 0); in tb_test_tunnel_port_on_path()
1756 KUNIT_EXPECT_TRUE(test, tb_tunnel_port_on_path(dp_tunnel, in)); in tb_test_tunnel_port_on_path()
1759 port = &host->ports[8]; in tb_test_tunnel_port_on_path()
1762 port = &host->ports[3]; in tb_test_tunnel_port_on_path()
1765 port = &dev1->ports[1]; in tb_test_tunnel_port_on_path()
1768 port = &dev1->ports[3]; in tb_test_tunnel_port_on_path()
1771 port = &dev1->ports[5]; in tb_test_tunnel_port_on_path()
1774 port = &dev1->ports[7]; in tb_test_tunnel_port_on_path()
1777 port = &dev3->ports[1]; in tb_test_tunnel_port_on_path()
1780 port = &dev5->ports[1]; in tb_test_tunnel_port_on_path()
1783 port = &dev4->ports[1]; in tb_test_tunnel_port_on_path()
1799 * 1 ^ In HopID 1 -> Out HopID 8 in tb_test_tunnel_dma()
1801 * v In HopID 8 -> Out HopID 1 in tb_test_tunnel_dma()
1807 nhi = &host->ports[7]; in tb_test_tunnel_dma()
1808 port = &host->ports[1]; 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()
1844 * | In HopID 15 -> Out HopID 2 in tb_test_tunnel_dma_rx()
1850 nhi = &host->ports[7]; in tb_test_tunnel_dma_rx()
1851 port = &host->ports[1]; 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()
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()
1879 * 1 | In HopID 2 -> Out HopID 15 in tb_test_tunnel_dma_tx()
1887 nhi = &host->ports[7]; in tb_test_tunnel_dma_tx()
1888 port = &host->ports[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()
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()
1916 * 1 ^ In HopID 1 -> Out HopID x in tb_test_tunnel_dma_chain()
1918 * 1 | In HopID x -> Out HopID 1 in tb_test_tunnel_dma_chain()
1923 * 3 | In HopID x -> Out HopID 8 in tb_test_tunnel_dma_chain()
1925 * v In HopID 8 -> Out HopID x in tb_test_tunnel_dma_chain()
1934 nhi = &host->ports[7]; in tb_test_tunnel_dma_chain()
1935 port = &dev2->ports[3]; 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()
1947 &dev2->ports[1]); 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()
1949 &dev1->ports[7]); 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()
1951 &dev1->ports[1]); 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()
1953 &host->ports[1]); 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()
1961 &dev1->ports[1]); 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()
1963 &dev1->ports[7]); 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()
1965 &dev2->ports[1]); 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()
1979 nhi = &host->ports[7]; in tb_test_tunnel_dma_match()
1980 port = &host->ports[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()
1998 tunnel = tb_tunnel_alloc_dma(NULL, nhi, port, 15, 1, -1, -1); 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()
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()
2010 tunnel = tb_tunnel_alloc_dma(NULL, nhi, port, -1, -1, 15, 11); 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()
2033 down = &host->ports[8]; in tb_test_credit_alloc_legacy_not_bonded()
2034 up = &dev->ports[9]; 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()
2040 KUNIT_ASSERT_EQ(test, path->path_length, 2); in tb_test_credit_alloc_legacy_not_bonded()
2041 KUNIT_EXPECT_EQ(test, path->hops[0].nfc_credits, 0U); in tb_test_credit_alloc_legacy_not_bonded()
2042 KUNIT_EXPECT_EQ(test, path->hops[0].initial_credits, 7U); in tb_test_credit_alloc_legacy_not_bonded()
2043 KUNIT_EXPECT_EQ(test, path->hops[1].nfc_credits, 0U); in tb_test_credit_alloc_legacy_not_bonded()
2044 KUNIT_EXPECT_EQ(test, path->hops[1].initial_credits, 16U); in tb_test_credit_alloc_legacy_not_bonded()
2046 path = tunnel->paths[1]; in tb_test_credit_alloc_legacy_not_bonded()
2047 KUNIT_ASSERT_EQ(test, path->path_length, 2); in tb_test_credit_alloc_legacy_not_bonded()
2048 KUNIT_EXPECT_EQ(test, path->hops[0].nfc_credits, 0U); in tb_test_credit_alloc_legacy_not_bonded()
2049 KUNIT_EXPECT_EQ(test, path->hops[0].initial_credits, 7U); in tb_test_credit_alloc_legacy_not_bonded()
2050 KUNIT_EXPECT_EQ(test, path->hops[1].nfc_credits, 0U); in tb_test_credit_alloc_legacy_not_bonded()
2051 KUNIT_EXPECT_EQ(test, path->hops[1].initial_credits, 16U); in tb_test_credit_alloc_legacy_not_bonded()
2066 down = &host->ports[8]; in tb_test_credit_alloc_legacy_bonded()
2067 up = &dev->ports[9]; 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()
2073 KUNIT_ASSERT_EQ(test, path->path_length, 2); in tb_test_credit_alloc_legacy_bonded()
2074 KUNIT_EXPECT_EQ(test, path->hops[0].nfc_credits, 0U); in tb_test_credit_alloc_legacy_bonded()
2075 KUNIT_EXPECT_EQ(test, path->hops[0].initial_credits, 7U); in tb_test_credit_alloc_legacy_bonded()
2076 KUNIT_EXPECT_EQ(test, path->hops[1].nfc_credits, 0U); in tb_test_credit_alloc_legacy_bonded()
2077 KUNIT_EXPECT_EQ(test, path->hops[1].initial_credits, 32U); in tb_test_credit_alloc_legacy_bonded()
2079 path = tunnel->paths[1]; in tb_test_credit_alloc_legacy_bonded()
2080 KUNIT_ASSERT_EQ(test, path->path_length, 2); in tb_test_credit_alloc_legacy_bonded()
2081 KUNIT_EXPECT_EQ(test, path->hops[0].nfc_credits, 0U); in tb_test_credit_alloc_legacy_bonded()
2082 KUNIT_EXPECT_EQ(test, path->hops[0].initial_credits, 7U); in tb_test_credit_alloc_legacy_bonded()
2083 KUNIT_EXPECT_EQ(test, path->hops[1].nfc_credits, 0U); in tb_test_credit_alloc_legacy_bonded()
2084 KUNIT_EXPECT_EQ(test, path->hops[1].initial_credits, 32U); in tb_test_credit_alloc_legacy_bonded()
2099 down = &host->ports[8]; in tb_test_credit_alloc_pcie()
2100 up = &dev->ports[9]; 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()
2106 KUNIT_ASSERT_EQ(test, path->path_length, 2); in tb_test_credit_alloc_pcie()
2107 KUNIT_EXPECT_EQ(test, path->hops[0].nfc_credits, 0U); in tb_test_credit_alloc_pcie()
2108 KUNIT_EXPECT_EQ(test, path->hops[0].initial_credits, 7U); in tb_test_credit_alloc_pcie()
2109 KUNIT_EXPECT_EQ(test, path->hops[1].nfc_credits, 0U); in tb_test_credit_alloc_pcie()
2110 KUNIT_EXPECT_EQ(test, path->hops[1].initial_credits, 32U); in tb_test_credit_alloc_pcie()
2112 path = tunnel->paths[1]; in tb_test_credit_alloc_pcie()
2113 KUNIT_ASSERT_EQ(test, path->path_length, 2); in tb_test_credit_alloc_pcie()
2114 KUNIT_EXPECT_EQ(test, path->hops[0].nfc_credits, 0U); in tb_test_credit_alloc_pcie()
2115 KUNIT_EXPECT_EQ(test, path->hops[0].initial_credits, 7U); in tb_test_credit_alloc_pcie()
2116 KUNIT_EXPECT_EQ(test, path->hops[1].nfc_credits, 0U); in tb_test_credit_alloc_pcie()
2117 KUNIT_EXPECT_EQ(test, path->hops[1].initial_credits, 64U); in tb_test_credit_alloc_pcie()
2143 * Remaining Buffers = Total - (CP + DP) = 120 - (2 + 0) = 118 in tb_test_credit_alloc_without_dp()
2144 * PCIe Credits = Max(6, Min(baMaxPCIe, Remaining Buffers - baMaxUSB3) in tb_test_credit_alloc_without_dp()
2147 down = &host->ports[8]; in tb_test_credit_alloc_without_dp()
2148 up = &dev->ports[9]; 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()
2155 KUNIT_ASSERT_EQ(test, path->path_length, 2); in tb_test_credit_alloc_without_dp()
2156 KUNIT_EXPECT_EQ(test, path->hops[0].nfc_credits, 0U); in tb_test_credit_alloc_without_dp()
2157 KUNIT_EXPECT_EQ(test, path->hops[0].initial_credits, 7U); in tb_test_credit_alloc_without_dp()
2158 KUNIT_EXPECT_EQ(test, path->hops[1].nfc_credits, 0U); in tb_test_credit_alloc_without_dp()
2159 KUNIT_EXPECT_EQ(test, path->hops[1].initial_credits, 9U); in tb_test_credit_alloc_without_dp()
2162 path = tunnel->paths[1]; in tb_test_credit_alloc_without_dp()
2163 KUNIT_ASSERT_EQ(test, path->path_length, 2); in tb_test_credit_alloc_without_dp()
2164 KUNIT_EXPECT_EQ(test, path->hops[0].nfc_credits, 0U); in tb_test_credit_alloc_without_dp()
2165 KUNIT_EXPECT_EQ(test, path->hops[0].initial_credits, 7U); in tb_test_credit_alloc_without_dp()
2166 KUNIT_EXPECT_EQ(test, path->hops[1].nfc_credits, 0U); in tb_test_credit_alloc_without_dp()
2167 KUNIT_EXPECT_EQ(test, path->hops[1].initial_credits, 64U); in tb_test_credit_alloc_without_dp()
2175 struct tb_port *in, *out; in tb_test_credit_alloc_dp() local
2182 in = &host->ports[5]; in tb_test_credit_alloc_dp()
2183 out = &dev->ports[14]; in tb_test_credit_alloc_dp()
2185 tunnel = tb_tunnel_alloc_dp(NULL, in, out, 1, 0, 0); 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()
2191 KUNIT_ASSERT_EQ(test, path->path_length, 2); in tb_test_credit_alloc_dp()
2192 KUNIT_EXPECT_EQ(test, path->hops[0].nfc_credits, 12U); in tb_test_credit_alloc_dp()
2193 KUNIT_EXPECT_EQ(test, path->hops[0].initial_credits, 0U); in tb_test_credit_alloc_dp()
2194 KUNIT_EXPECT_EQ(test, path->hops[1].nfc_credits, 18U); in tb_test_credit_alloc_dp()
2195 KUNIT_EXPECT_EQ(test, path->hops[1].initial_credits, 0U); in tb_test_credit_alloc_dp()
2198 path = tunnel->paths[1]; in tb_test_credit_alloc_dp()
2199 KUNIT_ASSERT_EQ(test, path->path_length, 2); in tb_test_credit_alloc_dp()
2200 KUNIT_EXPECT_EQ(test, path->hops[0].nfc_credits, 0U); in tb_test_credit_alloc_dp()
2201 KUNIT_EXPECT_EQ(test, path->hops[0].initial_credits, 1U); in tb_test_credit_alloc_dp()
2202 KUNIT_EXPECT_EQ(test, path->hops[1].nfc_credits, 0U); in tb_test_credit_alloc_dp()
2203 KUNIT_EXPECT_EQ(test, path->hops[1].initial_credits, 1U); in tb_test_credit_alloc_dp()
2206 path = tunnel->paths[2]; in tb_test_credit_alloc_dp()
2207 KUNIT_ASSERT_EQ(test, path->path_length, 2); in tb_test_credit_alloc_dp()
2208 KUNIT_EXPECT_EQ(test, path->hops[0].nfc_credits, 0U); in tb_test_credit_alloc_dp()
2209 KUNIT_EXPECT_EQ(test, path->hops[0].initial_credits, 1U); in tb_test_credit_alloc_dp()
2210 KUNIT_EXPECT_EQ(test, path->hops[1].nfc_credits, 0U); in tb_test_credit_alloc_dp()
2211 KUNIT_EXPECT_EQ(test, path->hops[1].initial_credits, 1U); in tb_test_credit_alloc_dp()
2226 down = &host->ports[12]; in tb_test_credit_alloc_usb3()
2227 up = &dev->ports[16]; 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()
2233 KUNIT_ASSERT_EQ(test, path->path_length, 2); in tb_test_credit_alloc_usb3()
2234 KUNIT_EXPECT_EQ(test, path->hops[0].nfc_credits, 0U); in tb_test_credit_alloc_usb3()
2235 KUNIT_EXPECT_EQ(test, path->hops[0].initial_credits, 7U); in tb_test_credit_alloc_usb3()
2236 KUNIT_EXPECT_EQ(test, path->hops[1].nfc_credits, 0U); in tb_test_credit_alloc_usb3()
2237 KUNIT_EXPECT_EQ(test, path->hops[1].initial_credits, 14U); in tb_test_credit_alloc_usb3()
2239 path = tunnel->paths[1]; in tb_test_credit_alloc_usb3()
2240 KUNIT_ASSERT_EQ(test, path->path_length, 2); in tb_test_credit_alloc_usb3()
2241 KUNIT_EXPECT_EQ(test, path->hops[0].nfc_credits, 0U); in tb_test_credit_alloc_usb3()
2242 KUNIT_EXPECT_EQ(test, path->hops[0].initial_credits, 7U); in tb_test_credit_alloc_usb3()
2243 KUNIT_EXPECT_EQ(test, path->hops[1].nfc_credits, 0U); in tb_test_credit_alloc_usb3()
2244 KUNIT_EXPECT_EQ(test, path->hops[1].initial_credits, 32U); in tb_test_credit_alloc_usb3()
2259 nhi = &host->ports[7]; in tb_test_credit_alloc_dma()
2260 port = &dev->ports[3]; 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()
2268 KUNIT_ASSERT_EQ(test, path->path_length, 2); in tb_test_credit_alloc_dma()
2269 KUNIT_EXPECT_EQ(test, path->hops[0].nfc_credits, 0U); in tb_test_credit_alloc_dma()
2270 KUNIT_EXPECT_EQ(test, path->hops[0].initial_credits, 14U); in tb_test_credit_alloc_dma()
2271 KUNIT_EXPECT_EQ(test, path->hops[1].nfc_credits, 0U); in tb_test_credit_alloc_dma()
2272 KUNIT_EXPECT_EQ(test, path->hops[1].initial_credits, 14U); in tb_test_credit_alloc_dma()
2275 path = tunnel->paths[1]; in tb_test_credit_alloc_dma()
2276 KUNIT_ASSERT_EQ(test, path->path_length, 2); in tb_test_credit_alloc_dma()
2277 KUNIT_EXPECT_EQ(test, path->hops[0].nfc_credits, 0U); in tb_test_credit_alloc_dma()
2278 KUNIT_EXPECT_EQ(test, path->hops[0].initial_credits, 0U); in tb_test_credit_alloc_dma()
2279 KUNIT_EXPECT_EQ(test, path->hops[1].nfc_credits, 0U); in tb_test_credit_alloc_dma()
2280 KUNIT_EXPECT_EQ(test, path->hops[1].initial_credits, 14U); in tb_test_credit_alloc_dma()
2295 nhi = &host->ports[7]; in tb_test_credit_alloc_dma_multiple()
2296 port = &dev->ports[3]; in tb_test_credit_alloc_dma_multiple()
2299 * Create three DMA tunnels through the same ports. With the in tb_test_credit_alloc_dma_multiple()
2305 * 120 - (2 + 2 * (1 + 0) + 32 + 64 + spare) = 20 in tb_test_credit_alloc_dma_multiple()
2309 * 120 - (2 + 2 * (1 + 18) + 14 + 32 + spare) = 34 in tb_test_credit_alloc_dma_multiple()
2318 KUNIT_ASSERT_EQ(test, tunnel1->npaths, (size_t)2); in tb_test_credit_alloc_dma_multiple()
2320 path = tunnel1->paths[0]; in tb_test_credit_alloc_dma_multiple()
2321 KUNIT_ASSERT_EQ(test, path->path_length, 2); in tb_test_credit_alloc_dma_multiple()
2322 KUNIT_EXPECT_EQ(test, path->hops[0].nfc_credits, 0U); in tb_test_credit_alloc_dma_multiple()
2323 KUNIT_EXPECT_EQ(test, path->hops[0].initial_credits, 14U); in tb_test_credit_alloc_dma_multiple()
2324 KUNIT_EXPECT_EQ(test, path->hops[1].nfc_credits, 0U); in tb_test_credit_alloc_dma_multiple()
2325 KUNIT_EXPECT_EQ(test, path->hops[1].initial_credits, 14U); in tb_test_credit_alloc_dma_multiple()
2327 path = tunnel1->paths[1]; in tb_test_credit_alloc_dma_multiple()
2328 KUNIT_ASSERT_EQ(test, path->path_length, 2); in tb_test_credit_alloc_dma_multiple()
2329 KUNIT_EXPECT_EQ(test, path->hops[0].nfc_credits, 0U); in tb_test_credit_alloc_dma_multiple()
2330 KUNIT_EXPECT_EQ(test, path->hops[0].initial_credits, 0U); in tb_test_credit_alloc_dma_multiple()
2331 KUNIT_EXPECT_EQ(test, path->hops[1].nfc_credits, 0U); in tb_test_credit_alloc_dma_multiple()
2332 KUNIT_EXPECT_EQ(test, path->hops[1].initial_credits, 14U); in tb_test_credit_alloc_dma_multiple()
2336 KUNIT_ASSERT_EQ(test, tunnel2->npaths, (size_t)2); in tb_test_credit_alloc_dma_multiple()
2338 path = tunnel2->paths[0]; in tb_test_credit_alloc_dma_multiple()
2339 KUNIT_ASSERT_EQ(test, path->path_length, 2); in tb_test_credit_alloc_dma_multiple()
2340 KUNIT_EXPECT_EQ(test, path->hops[0].nfc_credits, 0U); in tb_test_credit_alloc_dma_multiple()
2341 KUNIT_EXPECT_EQ(test, path->hops[0].initial_credits, 14U); in tb_test_credit_alloc_dma_multiple()
2342 KUNIT_EXPECT_EQ(test, path->hops[1].nfc_credits, 0U); in tb_test_credit_alloc_dma_multiple()
2343 KUNIT_EXPECT_EQ(test, path->hops[1].initial_credits, 1U); in tb_test_credit_alloc_dma_multiple()
2345 path = tunnel2->paths[1]; in tb_test_credit_alloc_dma_multiple()
2346 KUNIT_ASSERT_EQ(test, path->path_length, 2); in tb_test_credit_alloc_dma_multiple()
2347 KUNIT_EXPECT_EQ(test, path->hops[0].nfc_credits, 0U); in tb_test_credit_alloc_dma_multiple()
2348 KUNIT_EXPECT_EQ(test, path->hops[0].initial_credits, 0U); in tb_test_credit_alloc_dma_multiple()
2349 KUNIT_EXPECT_EQ(test, path->hops[1].nfc_credits, 0U); in tb_test_credit_alloc_dma_multiple()
2350 KUNIT_EXPECT_EQ(test, path->hops[1].initial_credits, 1U); in tb_test_credit_alloc_dma_multiple()
2364 path = tunnel3->paths[0]; in tb_test_credit_alloc_dma_multiple()
2365 KUNIT_ASSERT_EQ(test, path->path_length, 2); in tb_test_credit_alloc_dma_multiple()
2366 KUNIT_EXPECT_EQ(test, path->hops[0].nfc_credits, 0U); in tb_test_credit_alloc_dma_multiple()
2367 KUNIT_EXPECT_EQ(test, path->hops[0].initial_credits, 14U); in tb_test_credit_alloc_dma_multiple()
2368 KUNIT_EXPECT_EQ(test, path->hops[1].nfc_credits, 0U); in tb_test_credit_alloc_dma_multiple()
2369 KUNIT_EXPECT_EQ(test, path->hops[1].initial_credits, 14U); in tb_test_credit_alloc_dma_multiple()
2371 path = tunnel3->paths[1]; in tb_test_credit_alloc_dma_multiple()
2372 KUNIT_ASSERT_EQ(test, path->path_length, 2); in tb_test_credit_alloc_dma_multiple()
2373 KUNIT_EXPECT_EQ(test, path->hops[0].nfc_credits, 0U); in tb_test_credit_alloc_dma_multiple()
2374 KUNIT_EXPECT_EQ(test, path->hops[0].initial_credits, 0U); in tb_test_credit_alloc_dma_multiple()
2375 KUNIT_EXPECT_EQ(test, path->hops[1].nfc_credits, 0U); in tb_test_credit_alloc_dma_multiple()
2376 KUNIT_EXPECT_EQ(test, path->hops[1].initial_credits, 14U); in tb_test_credit_alloc_dma_multiple()
2389 down = &host->ports[8]; in TB_TEST_PCIE_TUNNEL()
2390 up = &dev->ports[9]; in TB_TEST_PCIE_TUNNEL()
2393 KUNIT_ASSERT_EQ(test, pcie_tunnel->npaths, (size_t)2); in TB_TEST_PCIE_TUNNEL()
2395 path = pcie_tunnel->paths[0]; in TB_TEST_PCIE_TUNNEL()
2396 KUNIT_ASSERT_EQ(test, path->path_length, 2); in TB_TEST_PCIE_TUNNEL()
2397 KUNIT_EXPECT_EQ(test, path->hops[0].nfc_credits, 0U); in TB_TEST_PCIE_TUNNEL()
2398 KUNIT_EXPECT_EQ(test, path->hops[0].initial_credits, 7U); in TB_TEST_PCIE_TUNNEL()
2399 KUNIT_EXPECT_EQ(test, path->hops[1].nfc_credits, 0U); in TB_TEST_PCIE_TUNNEL()
2400 KUNIT_EXPECT_EQ(test, path->hops[1].initial_credits, 32U); in TB_TEST_PCIE_TUNNEL()
2402 path = pcie_tunnel->paths[1]; in TB_TEST_PCIE_TUNNEL()
2403 KUNIT_ASSERT_EQ(test, path->path_length, 2); in TB_TEST_PCIE_TUNNEL()
2404 KUNIT_EXPECT_EQ(test, path->hops[0].nfc_credits, 0U); in TB_TEST_PCIE_TUNNEL()
2405 KUNIT_EXPECT_EQ(test, path->hops[0].initial_credits, 7U); in TB_TEST_PCIE_TUNNEL()
2406 KUNIT_EXPECT_EQ(test, path->hops[1].nfc_credits, 0U); in TB_TEST_PCIE_TUNNEL()
2407 KUNIT_EXPECT_EQ(test, path->hops[1].initial_credits, 64U); in TB_TEST_PCIE_TUNNEL()
2415 struct tb_port *in, *out; in TB_TEST_DP_TUNNEL1() local
2419 in = &host->ports[5]; in TB_TEST_DP_TUNNEL1()
2420 out = &dev->ports[13]; in TB_TEST_DP_TUNNEL1()
2421 dp_tunnel1 = tb_tunnel_alloc_dp(NULL, in, out, 1, 0, 0); in TB_TEST_DP_TUNNEL1()
2423 KUNIT_ASSERT_EQ(test, dp_tunnel1->npaths, (size_t)3); in TB_TEST_DP_TUNNEL1()
2425 path = dp_tunnel1->paths[0]; in TB_TEST_DP_TUNNEL1()
2426 KUNIT_ASSERT_EQ(test, path->path_length, 2); in TB_TEST_DP_TUNNEL1()
2427 KUNIT_EXPECT_EQ(test, path->hops[0].nfc_credits, 12U); in TB_TEST_DP_TUNNEL1()
2428 KUNIT_EXPECT_EQ(test, path->hops[0].initial_credits, 0U); in TB_TEST_DP_TUNNEL1()
2429 KUNIT_EXPECT_EQ(test, path->hops[1].nfc_credits, 18U); in TB_TEST_DP_TUNNEL1()
2430 KUNIT_EXPECT_EQ(test, path->hops[1].initial_credits, 0U); in TB_TEST_DP_TUNNEL1()
2432 path = dp_tunnel1->paths[1]; in TB_TEST_DP_TUNNEL1()
2433 KUNIT_ASSERT_EQ(test, path->path_length, 2); in TB_TEST_DP_TUNNEL1()
2434 KUNIT_EXPECT_EQ(test, path->hops[0].nfc_credits, 0U); in TB_TEST_DP_TUNNEL1()
2435 KUNIT_EXPECT_EQ(test, path->hops[0].initial_credits, 1U); in TB_TEST_DP_TUNNEL1()
2436 KUNIT_EXPECT_EQ(test, path->hops[1].nfc_credits, 0U); in TB_TEST_DP_TUNNEL1()
2437 KUNIT_EXPECT_EQ(test, path->hops[1].initial_credits, 1U); in TB_TEST_DP_TUNNEL1()
2439 path = dp_tunnel1->paths[2]; in TB_TEST_DP_TUNNEL1()
2440 KUNIT_ASSERT_EQ(test, path->path_length, 2); in TB_TEST_DP_TUNNEL1()
2441 KUNIT_EXPECT_EQ(test, path->hops[0].nfc_credits, 0U); in TB_TEST_DP_TUNNEL1()
2442 KUNIT_EXPECT_EQ(test, path->hops[0].initial_credits, 1U); in TB_TEST_DP_TUNNEL1()
2443 KUNIT_EXPECT_EQ(test, path->hops[1].nfc_credits, 0U); in TB_TEST_DP_TUNNEL1()
2444 KUNIT_EXPECT_EQ(test, path->hops[1].initial_credits, 1U); in TB_TEST_DP_TUNNEL1()
2452 struct tb_port *in, *out; in TB_TEST_DP_TUNNEL2() local
2456 in = &host->ports[6]; in TB_TEST_DP_TUNNEL2()
2457 out = &dev->ports[14]; in TB_TEST_DP_TUNNEL2()
2458 dp_tunnel2 = tb_tunnel_alloc_dp(NULL, in, out, 1, 0, 0); in TB_TEST_DP_TUNNEL2()
2460 KUNIT_ASSERT_EQ(test, dp_tunnel2->npaths, (size_t)3); in TB_TEST_DP_TUNNEL2()
2462 path = dp_tunnel2->paths[0]; in TB_TEST_DP_TUNNEL2()
2463 KUNIT_ASSERT_EQ(test, path->path_length, 2); in TB_TEST_DP_TUNNEL2()
2464 KUNIT_EXPECT_EQ(test, path->hops[0].nfc_credits, 12U); in TB_TEST_DP_TUNNEL2()
2465 KUNIT_EXPECT_EQ(test, path->hops[0].initial_credits, 0U); in TB_TEST_DP_TUNNEL2()
2466 KUNIT_EXPECT_EQ(test, path->hops[1].nfc_credits, 18U); in TB_TEST_DP_TUNNEL2()
2467 KUNIT_EXPECT_EQ(test, path->hops[1].initial_credits, 0U); in TB_TEST_DP_TUNNEL2()
2469 path = dp_tunnel2->paths[1]; in TB_TEST_DP_TUNNEL2()
2470 KUNIT_ASSERT_EQ(test, path->path_length, 2); in TB_TEST_DP_TUNNEL2()
2471 KUNIT_EXPECT_EQ(test, path->hops[0].nfc_credits, 0U); in TB_TEST_DP_TUNNEL2()
2472 KUNIT_EXPECT_EQ(test, path->hops[0].initial_credits, 1U); in TB_TEST_DP_TUNNEL2()
2473 KUNIT_EXPECT_EQ(test, path->hops[1].nfc_credits, 0U); in TB_TEST_DP_TUNNEL2()
2474 KUNIT_EXPECT_EQ(test, path->hops[1].initial_credits, 1U); in TB_TEST_DP_TUNNEL2()
2476 path = dp_tunnel2->paths[2]; in TB_TEST_DP_TUNNEL2()
2477 KUNIT_ASSERT_EQ(test, path->path_length, 2); in TB_TEST_DP_TUNNEL2()
2478 KUNIT_EXPECT_EQ(test, path->hops[0].nfc_credits, 0U); in TB_TEST_DP_TUNNEL2()
2479 KUNIT_EXPECT_EQ(test, path->hops[0].initial_credits, 1U); in TB_TEST_DP_TUNNEL2()
2480 KUNIT_EXPECT_EQ(test, path->hops[1].nfc_credits, 0U); in TB_TEST_DP_TUNNEL2()
2481 KUNIT_EXPECT_EQ(test, path->hops[1].initial_credits, 1U); in TB_TEST_DP_TUNNEL2()
2493 down = &host->ports[12]; in TB_TEST_USB3_TUNNEL()
2494 up = &dev->ports[16]; in TB_TEST_USB3_TUNNEL()
2497 KUNIT_ASSERT_EQ(test, usb3_tunnel->npaths, (size_t)2); in TB_TEST_USB3_TUNNEL()
2499 path = usb3_tunnel->paths[0]; in TB_TEST_USB3_TUNNEL()
2500 KUNIT_ASSERT_EQ(test, path->path_length, 2); in TB_TEST_USB3_TUNNEL()
2501 KUNIT_EXPECT_EQ(test, path->hops[0].nfc_credits, 0U); in TB_TEST_USB3_TUNNEL()
2502 KUNIT_EXPECT_EQ(test, path->hops[0].initial_credits, 7U); in TB_TEST_USB3_TUNNEL()
2503 KUNIT_EXPECT_EQ(test, path->hops[1].nfc_credits, 0U); in TB_TEST_USB3_TUNNEL()
2504 KUNIT_EXPECT_EQ(test, path->hops[1].initial_credits, 14U); in TB_TEST_USB3_TUNNEL()
2506 path = usb3_tunnel->paths[1]; in TB_TEST_USB3_TUNNEL()
2507 KUNIT_ASSERT_EQ(test, path->path_length, 2); in TB_TEST_USB3_TUNNEL()
2508 KUNIT_EXPECT_EQ(test, path->hops[0].nfc_credits, 0U); in TB_TEST_USB3_TUNNEL()
2509 KUNIT_EXPECT_EQ(test, path->hops[0].initial_credits, 7U); in TB_TEST_USB3_TUNNEL()
2510 KUNIT_EXPECT_EQ(test, path->hops[1].nfc_credits, 0U); in TB_TEST_USB3_TUNNEL()
2511 KUNIT_EXPECT_EQ(test, path->hops[1].initial_credits, 32U); in TB_TEST_USB3_TUNNEL()
2523 nhi = &host->ports[7]; in TB_TEST_DMA_TUNNEL1()
2524 port = &dev->ports[3]; in TB_TEST_DMA_TUNNEL1()
2527 KUNIT_ASSERT_EQ(test, dma_tunnel1->npaths, (size_t)2); in TB_TEST_DMA_TUNNEL1()
2529 path = dma_tunnel1->paths[0]; in TB_TEST_DMA_TUNNEL1()
2530 KUNIT_ASSERT_EQ(test, path->path_length, 2); in TB_TEST_DMA_TUNNEL1()
2531 KUNIT_EXPECT_EQ(test, path->hops[0].nfc_credits, 0U); in TB_TEST_DMA_TUNNEL1()
2532 KUNIT_EXPECT_EQ(test, path->hops[0].initial_credits, 14U); in TB_TEST_DMA_TUNNEL1()
2533 KUNIT_EXPECT_EQ(test, path->hops[1].nfc_credits, 0U); in TB_TEST_DMA_TUNNEL1()
2534 KUNIT_EXPECT_EQ(test, path->hops[1].initial_credits, 14U); in TB_TEST_DMA_TUNNEL1()
2536 path = dma_tunnel1->paths[1]; in TB_TEST_DMA_TUNNEL1()
2537 KUNIT_ASSERT_EQ(test, path->path_length, 2); in TB_TEST_DMA_TUNNEL1()
2538 KUNIT_EXPECT_EQ(test, path->hops[0].nfc_credits, 0U); in TB_TEST_DMA_TUNNEL1()
2539 KUNIT_EXPECT_EQ(test, path->hops[0].initial_credits, 0U); in TB_TEST_DMA_TUNNEL1()
2540 KUNIT_EXPECT_EQ(test, path->hops[1].nfc_credits, 0U); in TB_TEST_DMA_TUNNEL1()
2541 KUNIT_EXPECT_EQ(test, path->hops[1].initial_credits, 14U); in TB_TEST_DMA_TUNNEL1()
2553 nhi = &host->ports[7]; in TB_TEST_DMA_TUNNEL2()
2554 port = &dev->ports[3]; in TB_TEST_DMA_TUNNEL2()
2557 KUNIT_ASSERT_EQ(test, dma_tunnel2->npaths, (size_t)2); in TB_TEST_DMA_TUNNEL2()
2559 path = dma_tunnel2->paths[0]; in TB_TEST_DMA_TUNNEL2()
2560 KUNIT_ASSERT_EQ(test, path->path_length, 2); in TB_TEST_DMA_TUNNEL2()
2561 KUNIT_EXPECT_EQ(test, path->hops[0].nfc_credits, 0U); in TB_TEST_DMA_TUNNEL2()
2562 KUNIT_EXPECT_EQ(test, path->hops[0].initial_credits, 14U); in TB_TEST_DMA_TUNNEL2()
2563 KUNIT_EXPECT_EQ(test, path->hops[1].nfc_credits, 0U); in TB_TEST_DMA_TUNNEL2()
2564 KUNIT_EXPECT_EQ(test, path->hops[1].initial_credits, 1U); in TB_TEST_DMA_TUNNEL2()
2566 path = dma_tunnel2->paths[1]; in TB_TEST_DMA_TUNNEL2()
2567 KUNIT_ASSERT_EQ(test, path->path_length, 2); in TB_TEST_DMA_TUNNEL2()
2568 KUNIT_EXPECT_EQ(test, path->hops[0].nfc_credits, 0U); in TB_TEST_DMA_TUNNEL2()
2569 KUNIT_EXPECT_EQ(test, path->hops[0].initial_credits, 0U); in TB_TEST_DMA_TUNNEL2()
2570 KUNIT_EXPECT_EQ(test, path->hops[1].nfc_credits, 0U); in TB_TEST_DMA_TUNNEL2()
2571 KUNIT_EXPECT_EQ(test, path->hops[1].initial_credits, 1U); in TB_TEST_DMA_TUNNEL2()
2585 * the default credit allocation found in Intel hardware. in tb_test_credit_alloc_all()
2634 0x6520496e, /* "e In" */
2679 KUNIT_EXPECT_STREQ(test, p->value.text, "Apple Inc."); in tb_test_property_parse()
2683 KUNIT_EXPECT_EQ(test, p->value.immediate, 0xa27); in tb_test_property_parse()
2687 KUNIT_EXPECT_STREQ(test, p->value.text, "Macintosh"); in tb_test_property_parse()
2691 KUNIT_EXPECT_EQ(test, p->value.immediate, 0xa); in tb_test_property_parse()
2699 network_dir = p->value.dir; in tb_test_property_parse()
2700 KUNIT_EXPECT_TRUE(test, uuid_equal(network_dir->uuid, &network_dir_uuid)); in tb_test_property_parse()
2704 KUNIT_EXPECT_EQ(test, p->value.immediate, 0x1); in tb_test_property_parse()
2708 KUNIT_EXPECT_EQ(test, p->value.immediate, 0x1); in tb_test_property_parse()
2712 KUNIT_EXPECT_EQ(test, p->value.immediate, 0x1); in tb_test_property_parse()
2716 KUNIT_EXPECT_EQ(test, p->value.immediate, 0x0); in tb_test_property_parse()
2759 if (d1->uuid) { in compare_dirs()
2760 KUNIT_ASSERT_NOT_NULL(test, d2->uuid); in compare_dirs()
2761 KUNIT_ASSERT_TRUE(test, uuid_equal(d1->uuid, d2->uuid)); in compare_dirs()
2763 KUNIT_ASSERT_NULL(test, d2->uuid); in compare_dirs()
2786 KUNIT_ASSERT_STREQ(test, &p1->key[0], &p2->key[0]); in compare_dirs()
2787 KUNIT_ASSERT_EQ(test, p1->type, p2->type); in compare_dirs()
2788 KUNIT_ASSERT_EQ(test, p1->length, p2->length); in compare_dirs()
2790 switch (p1->type) { in compare_dirs()
2792 KUNIT_ASSERT_NOT_NULL(test, p1->value.dir); in compare_dirs()
2793 KUNIT_ASSERT_NOT_NULL(test, p2->value.dir); in compare_dirs()
2794 compare_dirs(test, p1->value.dir, p2->value.dir); in compare_dirs()
2798 KUNIT_ASSERT_NOT_NULL(test, p1->value.data); in compare_dirs()
2799 KUNIT_ASSERT_NOT_NULL(test, p2->value.data); in compare_dirs()
2801 !memcmp(p1->value.data, p2->value.data, in compare_dirs()
2802 p1->length * 4) in compare_dirs()
2807 KUNIT_ASSERT_NOT_NULL(test, p1->value.text); in compare_dirs()
2808 KUNIT_ASSERT_NOT_NULL(test, p2->value.text); in compare_dirs()
2809 KUNIT_ASSERT_STREQ(test, p1->value.text, p2->value.text); in compare_dirs()
2813 KUNIT_ASSERT_EQ(test, p1->value.immediate, in compare_dirs()
2814 p2->value.immediate); in compare_dirs()