Lines Matching refs: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()
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()
318 const struct tb_path_hop *hop = &path->hops[i]; in tb_path_free() local
320 if (hop->in_port) in tb_path_free()
321 tb_port_release_in_hopid(hop->in_port, in tb_path_free()
322 hop->in_hop_index); in tb_path_free()
323 if (hop->out_port) in tb_path_free()
324 tb_port_release_out_hopid(hop->out_port, in tb_path_free()
325 hop->next_hop_index); in tb_path_free()
348 struct tb_regs_hop hop; in __tb_path_deactivate_hop() local
353 ret = tb_port_read(port, &hop, TB_CFG_HOPS, 2 * hop_index, 2); in __tb_path_deactivate_hop()
358 if (!hop.enable) in __tb_path_deactivate_hop()
361 hop.enable = 0; in __tb_path_deactivate_hop()
363 ret = tb_port_write(port, &hop, TB_CFG_HOPS, 2 * hop_index, 2); in __tb_path_deactivate_hop()
370 ret = tb_port_read(port, &hop, TB_CFG_HOPS, 2 * hop_index, 2); in __tb_path_deactivate_hop()
374 if (!hop.pending) { in __tb_path_deactivate_hop()
377 hop.ingress_fc = 0; in __tb_path_deactivate_hop()
378 hop.egress_fc = 0; in __tb_path_deactivate_hop()
379 hop.ingress_shared_buffer = 0; in __tb_path_deactivate_hop()
380 hop.egress_shared_buffer = 0; in __tb_path_deactivate_hop()
382 return tb_port_write(port, &hop, TB_CFG_HOPS, in __tb_path_deactivate_hop()
473 struct tb_regs_hop hop = { 0 }; in tb_path_activate() local
480 hop.next_hop = path->hops[i].next_hop_index; in tb_path_activate()
481 hop.out_port = path->hops[i].out_port->port; in tb_path_activate()
482 hop.initial_credits = path->hops[i].initial_credits; in tb_path_activate()
483 hop.unknown1 = 0; in tb_path_activate()
484 hop.enable = 1; in tb_path_activate()
490 hop.weight = path->weight; in tb_path_activate()
491 hop.unknown2 = 0; in tb_path_activate()
492 hop.priority = path->priority; in tb_path_activate()
493 hop.drop_packages = path->drop_packages; in tb_path_activate()
494 hop.counter = path->hops[i].in_counter_index; in tb_path_activate()
495 hop.counter_enable = path->hops[i].in_counter_index != -1; in tb_path_activate()
496 hop.ingress_fc = path->ingress_fc_enable & in_mask; in tb_path_activate()
497 hop.egress_fc = path->egress_fc_enable & out_mask; in tb_path_activate()
498 hop.ingress_shared_buffer = path->ingress_shared_buffer in tb_path_activate()
500 hop.egress_shared_buffer = path->egress_shared_buffer in tb_path_activate()
502 hop.unknown3 = 0; in tb_path_activate()
505 tb_dump_hop(&path->hops[i], &hop); in tb_path_activate()
506 res = tb_port_write(path->hops[i].in_port, &hop, TB_CFG_HOPS, in tb_path_activate()