Lines Matching refs:hop
16 static void tb_dump_hop(const struct tb_path_hop *hop, const struct tb_regs_hop *regs)
18 const struct tb_port *port = hop->in_port;
21 hop->in_hop_index, regs->out_port, regs->next_hop);
38 struct tb_regs_hop hop;
48 ret = tb_port_read(port, &hop, TB_CFG_HOPS, 2 * hopid, 2);
54 if (!hop.enable)
57 out_port = &sw->ports[hop.out_port];
58 hopid = hop.next_hop;
105 struct tb_regs_hop hop;
132 ret = tb_port_read(p, &hop, TB_CFG_HOPS, 2 * h, 2);
138 /* If the hop is not enabled we got an incomplete path */
139 if (!hop.enable)
142 out_port = &sw->ports[hop.out_port];
146 h = hop.next_hop;
174 ret = tb_port_read(p, &hop, TB_CFG_HOPS, 2 * h, 2);
183 out_port = &sw->ports[hop.out_port];
184 next_hop = hop.next_hop;
257 /* Each hop takes two ports */
351 const struct tb_path_hop *hop = &path->hops[i];
353 if (hop->in_port)
354 tb_port_release_in_hopid(hop->in_port,
355 hop->in_hop_index);
356 if (hop->out_port)
357 tb_port_release_out_hopid(hop->out_port,
358 hop->next_hop_index);
373 "nfc credits deallocation failed for hop %d\n",
381 struct tb_regs_hop hop;
386 ret = tb_port_read(port, &hop, TB_CFG_HOPS, 2 * hop_index, 2);
391 if (!hop.enable)
394 hop.enable = 0;
396 ret = tb_port_write(port, &hop, TB_CFG_HOPS, 2 * hop_index, 2);
403 ret = tb_port_read(port, &hop, TB_CFG_HOPS, 2 * hop_index, 2);
407 if (!hop.pending) {
410 hop.ingress_fc = 0;
411 hop.egress_fc = 0;
412 hop.ingress_shared_buffer = 0;
413 hop.egress_shared_buffer = 0;
415 return tb_port_write(port, &hop, TB_CFG_HOPS,
438 "hop deactivation failed for hop %d, index %d\n",
463 * Activate a path starting with the last hop and iterating backwards. The
506 struct tb_regs_hop hop = { 0 };
513 hop.next_hop = path->hops[i].next_hop_index;
514 hop.out_port = path->hops[i].out_port->port;
515 hop.initial_credits = path->hops[i].initial_credits;
516 hop.unknown1 = 0;
517 hop.enable = 1;
523 hop.weight = path->weight;
524 hop.unknown2 = 0;
525 hop.priority = path->priority;
526 hop.drop_packages = path->drop_packages;
527 hop.counter = path->hops[i].in_counter_index;
528 hop.counter_enable = path->hops[i].in_counter_index != -1;
529 hop.ingress_fc = path->ingress_fc_enable & in_mask;
530 hop.egress_fc = path->egress_fc_enable & out_mask;
531 hop.ingress_shared_buffer = path->ingress_shared_buffer
533 hop.egress_shared_buffer = path->egress_shared_buffer
535 hop.unknown3 = 0;
537 tb_port_dbg(path->hops[i].in_port, "Writing hop %d\n", i);
538 tb_dump_hop(&path->hops[i], &hop);
539 res = tb_port_write(path->hops[i].in_port, &hop, TB_CFG_HOPS,