Lines Matching full:hop

16 static void tb_dump_hop(const struct tb_path_hop *hop, const struct tb_regs_hop *regs)  in tb_dump_hop()  argument
18 const struct tb_port *port = hop->in_port; in tb_dump_hop()
21 hop->in_hop_index, regs->out_port, regs->next_hop); in tb_dump_hop()
38 struct tb_regs_hop hop; in tb_path_find_dst_port() local
48 ret = tb_port_read(port, &hop, TB_CFG_HOPS, 2 * hopid, 2); in tb_path_find_dst_port()
54 if (!hop.enable) in tb_path_find_dst_port()
57 out_port = &sw->ports[hop.out_port]; in tb_path_find_dst_port()
58 hopid = hop.next_hop; in tb_path_find_dst_port()
105 struct tb_regs_hop hop; in tb_path_discover() local
132 ret = tb_port_read(p, &hop, TB_CFG_HOPS, 2 * h, 2); in tb_path_discover()
138 /* If the hop is not enabled we got an incomplete path */ in tb_path_discover()
139 if (!hop.enable) in tb_path_discover()
142 out_port = &sw->ports[hop.out_port]; in tb_path_discover()
146 h = hop.next_hop; in tb_path_discover()
174 ret = tb_port_read(p, &hop, TB_CFG_HOPS, 2 * h, 2); in tb_path_discover()
183 out_port = &sw->ports[hop.out_port]; in tb_path_discover()
184 next_hop = hop.next_hop; in tb_path_discover()
257 /* Each hop takes two ports */ in tb_path_alloc()
351 const struct tb_path_hop *hop = &path->hops[i]; in tb_path_free() local
353 if (hop->in_port) in tb_path_free()
354 tb_port_release_in_hopid(hop->in_port, in tb_path_free()
355 hop->in_hop_index); in tb_path_free()
356 if (hop->out_port) in tb_path_free()
357 tb_port_release_out_hopid(hop->out_port, in tb_path_free()
358 hop->next_hop_index); in tb_path_free()
373 "nfc credits deallocation failed for hop %d\n", in __tb_path_deallocate_nfc()
381 struct tb_regs_hop hop; in __tb_path_deactivate_hop() local
386 ret = tb_port_read(port, &hop, TB_CFG_HOPS, 2 * hop_index, 2); in __tb_path_deactivate_hop()
391 if (!hop.enable) in __tb_path_deactivate_hop()
394 hop.enable = 0; in __tb_path_deactivate_hop()
396 ret = tb_port_write(port, &hop, TB_CFG_HOPS, 2 * hop_index, 2); in __tb_path_deactivate_hop()
403 ret = tb_port_read(port, &hop, TB_CFG_HOPS, 2 * hop_index, 2); in __tb_path_deactivate_hop()
407 if (!hop.pending) { in __tb_path_deactivate_hop()
416 hop.ingress_fc = 0; in __tb_path_deactivate_hop()
417 hop.ingress_shared_buffer = 0; in __tb_path_deactivate_hop()
419 hop.egress_fc = 0; in __tb_path_deactivate_hop()
420 hop.egress_shared_buffer = 0; in __tb_path_deactivate_hop()
422 return tb_port_write(port, &hop, TB_CFG_HOPS, in __tb_path_deactivate_hop()
445 "hop deactivation failed for hop %d, index %d\n", in __tb_path_deactivate_hops()
471 * Activate a path starting with the last hop and iterating backwards. The
514 struct tb_regs_hop hop = { 0 }; in tb_path_activate() local
521 hop.next_hop = path->hops[i].next_hop_index; in tb_path_activate()
522 hop.out_port = path->hops[i].out_port->port; in tb_path_activate()
523 hop.initial_credits = path->hops[i].initial_credits; in tb_path_activate()
524 hop.unknown1 = 0; in tb_path_activate()
525 hop.enable = 1; in tb_path_activate()
531 hop.weight = path->weight; in tb_path_activate()
532 hop.unknown2 = 0; in tb_path_activate()
533 hop.priority = path->priority; in tb_path_activate()
534 hop.drop_packages = path->drop_packages; in tb_path_activate()
535 hop.counter = path->hops[i].in_counter_index; in tb_path_activate()
536 hop.counter_enable = path->hops[i].in_counter_index != -1; in tb_path_activate()
537 hop.ingress_fc = path->ingress_fc_enable & in_mask; in tb_path_activate()
538 hop.egress_fc = path->egress_fc_enable & out_mask; in tb_path_activate()
539 hop.ingress_shared_buffer = path->ingress_shared_buffer in tb_path_activate()
541 hop.egress_shared_buffer = path->egress_shared_buffer in tb_path_activate()
543 hop.unknown3 = 0; in tb_path_activate()
545 tb_port_dbg(path->hops[i].in_port, "Writing hop %d\n", i); in tb_path_activate()
546 tb_dump_hop(&path->hops[i], &hop); in tb_path_activate()
547 res = tb_port_write(path->hops[i].in_port, &hop, TB_CFG_HOPS, in tb_path_activate()