+
+ lconf = NULL;
+ while (core_targ_next(&lconf, &targ, 0) == 0) {
+ l3 = ndp = 0;
+ if (strcmp(targ->sub_mode_str, "l3") == 0)
+ l3 = 1;
+ else if (strcmp(targ->sub_mode_str, "ndp") == 0)
+ ndp = 1;
+ else
+ continue;
+
+ PROX_PANIC((targ->nb_rxports == 0) && (targ->nb_txports == 0), "L3/NDP task must have a RX or a TX port\n");
+ // If the L3/NDP sub_mode receives from a port, check that there is at least one core/task
+ // transmitting to this port in L3/NDP sub_mode
+ for (uint8_t i = 0; i < targ->nb_rxports; ++i) {
+ rx_port_id = targ->rx_port_queue[i].port;
+ ok = 0;
+ tx_lconf = NULL;
+ while (core_targ_next(&tx_lconf, &tx_targ, 0) == 0) {
+ if ((port_id = tx_targ->tx_port_queue[0].port) == OUT_DISCARD)
+ continue;
+ if ((rx_port_id == port_id) &&
+ ( ((tx_targ->flags & TASK_ARG_L3) && l3) ||
+ ((tx_targ->flags & TASK_ARG_NDP) && ndp) ) ) {
+ ok = 1;
+ break;
+ }
+ }
+ PROX_PANIC(ok == 0, "RX %s sub mode for port %d on core %d task %d, but no core/task transmitting on that port\n", l3 ? "l3":"ndp", rx_port_id, lconf->id, targ->id);
+ }
+
+ // If the L3/NDP sub_mode transmits to a port, check that there is at least one core/task
+ // receiving from that port in L3/NDP sub_mode.
+ if ((port_id = targ->tx_port_queue[0].port) == OUT_DISCARD)
+ continue;
+ rx_lconf = NULL;
+ ok = 0;
+ plog_info("\tCore %d task %d transmitting to port %d in %s submode\n", lconf->id, targ->id, port_id, l3 ? "l3":"ndp");
+ while (core_targ_next(&rx_lconf, &rx_targ, 0) == 0) {
+ for (uint8_t i = 0; i < rx_targ->nb_rxports; ++i) {
+ rx_port_id = rx_targ->rx_port_queue[i].port;
+ if ((rx_port_id == port_id) &&
+ ( ((rx_targ->flags & TASK_ARG_L3) && l3) ||
+ ((rx_targ->flags & TASK_ARG_NDP) && ndp) ) ){
+ ok = 1;
+ break;
+ }
+ }
+ if (ok == 1) {
+ plog_info("\tCore %d task %d has found core %d task %d receiving from port %d in %s submode\n", lconf->id, targ->id, rx_lconf->id, rx_targ->id, port_id,
+ ((rx_targ->flags & TASK_ARG_L3) && l3) ? "l3":"ndp");
+ break;
+ }
+ }
+ PROX_PANIC(ok == 0, "%s sub mode for port %d on core %d task %d, but no core/task receiving on that port\n", l3 ? "l3":"ndp", port_id, lconf->id, targ->id);
+ }