Lines Matching refs:i
40 int i, ret, hopid; in tb_path_find_dst_port() local
45 for (i = 0; port && i < TB_PATH_MAX_HOPS; i++) { in tb_path_find_dst_port()
69 int i; in tb_path_find_src_hopid() local
71 for (i = TB_PATH_MIN_HOPID; i <= src->config.max_in_hop_id; i++) { in tb_path_find_src_hopid()
72 out = tb_path_find_dst_port(src, i, dst_hopid); in tb_path_find_src_hopid()
74 return i; in tb_path_find_src_hopid()
110 int ret, i, h; in tb_path_discover() local
129 for (i = 0; p && i < TB_PATH_MAX_HOPS; i++) { in tb_path_discover()
169 for (i = 0; i < num_hops; i++) { in tb_path_discover()
191 path->hops[i].in_port = p; in tb_path_discover()
192 path->hops[i].in_hop_index = h; in tb_path_discover()
193 path->hops[i].in_counter_index = -1; in tb_path_discover()
194 path->hops[i].out_port = out_port; in tb_path_discover()
195 path->hops[i].next_hop_index = next_hop; in tb_path_discover()
236 int i, ret; in tb_path_alloc() local
243 i = 0; in tb_path_alloc()
248 i++; in tb_path_alloc()
258 num_hops = i / 2; in tb_path_alloc()
269 for (i = 0; i < num_hops; i++) { in tb_path_alloc()
310 if (i == num_hops - 1) in tb_path_alloc()
320 path->hops[i].in_hop_index = in_hopid; in tb_path_alloc()
321 path->hops[i].in_port = in_port; in tb_path_alloc()
322 path->hops[i].in_counter_index = -1; in tb_path_alloc()
323 path->hops[i].out_port = out_port; in tb_path_alloc()
324 path->hops[i].next_hop_index = out_hopid; in tb_path_alloc()
348 int i; in tb_path_free() local
350 for (i = 0; i < path->path_length; i++) { in tb_path_free()
351 const struct tb_path_hop *hop = &path->hops[i]; in tb_path_free()
367 int i, res; in __tb_path_deallocate_nfc() local
368 for (i = first_hop; i < path->path_length; i++) { in __tb_path_deallocate_nfc()
369 res = tb_port_add_nfc_credits(path->hops[i].in_port, in __tb_path_deallocate_nfc()
372 tb_port_warn(path->hops[i].in_port, in __tb_path_deallocate_nfc()
374 i); in __tb_path_deallocate_nfc()
430 int i, res; in __tb_path_deactivate_hops() local
432 for (i = first_hop; i < path->path_length; i++) { in __tb_path_deactivate_hops()
433 res = __tb_path_deactivate_hop(path->hops[i].in_port, in __tb_path_deactivate_hops()
434 path->hops[i].in_hop_index, in __tb_path_deactivate_hops()
437 tb_port_warn(path->hops[i].in_port, in __tb_path_deactivate_hops()
439 i, path->hops[i].in_hop_index); in __tb_path_deactivate_hops()
470 int i, res; in tb_path_activate() local
485 for (i = path->path_length - 1; i >= 0; i--) { in tb_path_activate()
486 if (path->hops[i].in_counter_index == -1) in tb_path_activate()
488 res = tb_port_clear_counter(path->hops[i].in_port, in tb_path_activate()
489 path->hops[i].in_counter_index); in tb_path_activate()
495 for (i = path->path_length - 1; i >= 0; i--) { in tb_path_activate()
496 res = tb_port_add_nfc_credits(path->hops[i].in_port, in tb_path_activate()
499 __tb_path_deallocate_nfc(path, i); in tb_path_activate()
505 for (i = path->path_length - 1; i >= 0; i--) { in tb_path_activate()
509 __tb_path_deactivate_hop(path->hops[i].in_port, in tb_path_activate()
510 path->hops[i].in_hop_index, path->clear_fc); in tb_path_activate()
513 hop.next_hop = path->hops[i].next_hop_index; in tb_path_activate()
514 hop.out_port = path->hops[i].out_port->port; in tb_path_activate()
515 hop.initial_credits = path->hops[i].initial_credits; in tb_path_activate()
520 out_mask = (i == path->path_length - 1) ? in tb_path_activate()
522 in_mask = (i == 0) ? TB_PATH_SOURCE : TB_PATH_INTERNAL; in tb_path_activate()
527 hop.counter = path->hops[i].in_counter_index; in tb_path_activate()
528 hop.counter_enable = path->hops[i].in_counter_index != -1; in tb_path_activate()
537 tb_port_dbg(path->hops[i].in_port, "Writing hop %d\n", i); in tb_path_activate()
538 tb_dump_hop(&path->hops[i], &hop); in tb_path_activate()
539 res = tb_port_write(path->hops[i].in_port, &hop, TB_CFG_HOPS, in tb_path_activate()
540 2 * path->hops[i].in_hop_index, 2); in tb_path_activate()
542 __tb_path_deactivate_hops(path, i); in tb_path_activate()
562 int i = 0; in tb_path_is_invalid() local
563 for (i = 0; i < path->path_length; i++) { in tb_path_is_invalid()
564 if (path->hops[i].in_port->sw->is_unplugged) in tb_path_is_invalid()
566 if (path->hops[i].out_port->sw->is_unplugged) in tb_path_is_invalid()
582 int i; in tb_path_port_on_path() local
584 for (i = 0; i < path->path_length; i++) { in tb_path_port_on_path()
585 if (path->hops[i].in_port == port || in tb_path_port_on_path()
586 path->hops[i].out_port == port) in tb_path_port_on_path()