Lines Matching refs:hops
163 path->hops = kcalloc(num_hops, sizeof(*path->hops), GFP_KERNEL); in tb_path_discover()
164 if (!path->hops) { in tb_path_discover()
195 path->hops[i].in_port = p; in tb_path_discover()
196 path->hops[i].in_hop_index = h; in tb_path_discover()
197 path->hops[i].in_counter_index = -1; in tb_path_discover()
198 path->hops[i].out_port = out_port; in tb_path_discover()
199 path->hops[i].next_hop_index = next_hop; in tb_path_discover()
264 path->hops = kcalloc(num_hops, sizeof(*path->hops), GFP_KERNEL); in tb_path_alloc()
265 if (!path->hops) { in tb_path_alloc()
326 path->hops[i].in_hop_index = in_hopid; in tb_path_alloc()
327 path->hops[i].in_port = in_port; in tb_path_alloc()
328 path->hops[i].in_counter_index = -1; in tb_path_alloc()
329 path->hops[i].out_port = out_port; in tb_path_alloc()
330 path->hops[i].next_hop_index = out_hopid; in tb_path_alloc()
358 const struct tb_path_hop *hop = &path->hops[i]; in tb_path_free()
369 kfree(path->hops); in tb_path_free()
377 res = tb_port_add_nfc_credits(path->hops[i].in_port, in __tb_path_deallocate_nfc()
378 -path->hops[i].nfc_credits); in __tb_path_deallocate_nfc()
380 tb_port_warn(path->hops[i].in_port, in __tb_path_deallocate_nfc()
448 res = __tb_path_deactivate_hop(path->hops[i].in_port, in __tb_path_deactivate_hops()
449 path->hops[i].in_hop_index, in __tb_path_deactivate_hops()
452 tb_port_warn(path->hops[i].in_port, in __tb_path_deactivate_hops()
454 i, path->hops[i].in_hop_index); in __tb_path_deactivate_hops()
466 path->name, tb_route(path->hops[0].in_port->sw), in tb_path_deactivate()
467 path->hops[0].in_port->port, in tb_path_deactivate()
468 tb_route(path->hops[path->path_length - 1].out_port->sw), in tb_path_deactivate()
469 path->hops[path->path_length - 1].out_port->port); in tb_path_deactivate()
495 path->name, tb_route(path->hops[0].in_port->sw), in tb_path_activate()
496 path->hops[0].in_port->port, in tb_path_activate()
497 tb_route(path->hops[path->path_length - 1].out_port->sw), in tb_path_activate()
498 path->hops[path->path_length - 1].out_port->port); in tb_path_activate()
502 if (path->hops[i].in_counter_index == -1) in tb_path_activate()
504 res = tb_port_clear_counter(path->hops[i].in_port, in tb_path_activate()
505 path->hops[i].in_counter_index); in tb_path_activate()
512 res = tb_port_add_nfc_credits(path->hops[i].in_port, in tb_path_activate()
513 path->hops[i].nfc_credits); in tb_path_activate()
525 __tb_path_deactivate_hop(path->hops[i].in_port, in tb_path_activate()
526 path->hops[i].in_hop_index, path->clear_fc); in tb_path_activate()
529 hop.next_hop = path->hops[i].next_hop_index; in tb_path_activate()
530 hop.out_port = path->hops[i].out_port->port; in tb_path_activate()
531 hop.initial_credits = path->hops[i].initial_credits; in tb_path_activate()
543 hop.counter = path->hops[i].in_counter_index; in tb_path_activate()
544 hop.counter_enable = path->hops[i].in_counter_index != -1; in tb_path_activate()
553 tb_port_dbg(path->hops[i].in_port, "Writing hop %d\n", i); in tb_path_activate()
554 tb_dump_hop(&path->hops[i], &hop); in tb_path_activate()
555 res = tb_port_write(path->hops[i].in_port, &hop, TB_CFG_HOPS, in tb_path_activate()
556 2 * path->hops[i].in_hop_index, 2); in tb_path_activate()
581 if (path->hops[i].in_port->sw->is_unplugged) in tb_path_is_invalid()
583 if (path->hops[i].out_port->sw->is_unplugged) in tb_path_is_invalid()
602 if (path->hops[i].in_port == port || in tb_path_port_on_path()
603 path->hops[i].out_port == port) in tb_path_port_on_path()