Lines Matching defs: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;
107 struct tb_regs_hop hop;
134 ret = tb_port_read(p, &hop, TB_CFG_HOPS, 2 * h, 2);
140 /* If the hop is not enabled we got an incomplete path */
141 if (!hop.enable)
144 out_port = &sw->ports[hop.out_port];
148 h = hop.next_hop;
180 ret = tb_port_read(p, &hop, TB_CFG_HOPS, 2 * h, 2);
189 out_port = &sw->ports[hop.out_port];
190 next_hop = hop.next_hop;
204 tb_dump_hop(&path->hops[i], &hop);
267 /* Each hop takes two ports */
364 const struct tb_path_hop *hop = &path->hops[i];
366 if (hop->in_port)
367 tb_port_release_in_hopid(hop->in_port,
368 hop->in_hop_index);
369 if (hop->out_port)
370 tb_port_release_out_hopid(hop->out_port,
371 hop->next_hop_index);
387 "nfc credits deallocation failed for hop %d\n",
395 struct tb_regs_hop hop;
400 ret = tb_port_read(port, &hop, TB_CFG_HOPS, 2 * hop_index, 2);
405 if (!hop.enable)
408 hop.enable = 0;
410 ret = tb_port_write(port, &hop, TB_CFG_HOPS, 2 * hop_index, 2);
417 ret = tb_port_read(port, &hop, TB_CFG_HOPS, 2 * hop_index, 2);
421 if (!hop.pending) {
430 hop.ingress_fc = 0;
431 hop.ingress_shared_buffer = 0;
433 hop.egress_fc = 0;
434 hop.egress_shared_buffer = 0;
436 return tb_port_write(port, &hop, TB_CFG_HOPS,
472 "hop deactivation failed for hop %d, index %d\n",
498 * Activate a path starting with the last hop and iterating backwards. The
541 struct tb_regs_hop hop = { 0 };
548 hop.next_hop = path->hops[i].next_hop_index;
549 hop.out_port = path->hops[i].out_port->port;
550 hop.initial_credits = path->hops[i].initial_credits;
551 hop.pmps = path->hops[i].pm_support;
552 hop.unknown1 = 0;
553 hop.enable = 1;
559 hop.weight = path->weight;
560 hop.unknown2 = 0;
561 hop.priority = path->priority;
562 hop.drop_packages = path->drop_packages;
563 hop.counter = path->hops[i].in_counter_index;
564 hop.counter_enable = path->hops[i].in_counter_index != -1;
565 hop.ingress_fc = path->ingress_fc_enable & in_mask;
566 hop.egress_fc = path->egress_fc_enable & out_mask;
567 hop.ingress_shared_buffer = path->ingress_shared_buffer
569 hop.egress_shared_buffer = path->egress_shared_buffer
571 hop.unknown3 = 0;
573 tb_port_dbg(path->hops[i].in_port, "Writing hop %d\n", i);
574 tb_dump_hop(&path->hops[i], &hop);
575 res = tb_port_write(path->hops[i].in_port, &hop, TB_CFG_HOPS,