summaryrefslogtreecommitdiffstats
path: root/VNFs/DPPD-PROX/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'VNFs/DPPD-PROX/main.c')
-rw-r--r--VNFs/DPPD-PROX/main.c38
1 files changed, 31 insertions, 7 deletions
diff --git a/VNFs/DPPD-PROX/main.c b/VNFs/DPPD-PROX/main.c
index 1c4dced9..2c362d6c 100644
--- a/VNFs/DPPD-PROX/main.c
+++ b/VNFs/DPPD-PROX/main.c
@@ -94,13 +94,15 @@ static void check_mixed_normal_pipeline(void)
int all_thread_nop = 1;
int generic = 0;
int pipeline = 0;
+ int l3 = 0;
for (uint8_t task_id = 0; task_id < lconf->n_tasks_all; ++task_id) {
struct task_args *targ = &lconf->targs[task_id];
- all_thread_nop = all_thread_nop &&
+ l3 = !strcmp("l3", targ->sub_mode_str);
+ all_thread_nop = all_thread_nop && !l3 &&
targ->task_init->thread_x == thread_nop;
pipeline = pipeline || targ->task_init->thread_x == thread_pipeline;
- generic = generic || targ->task_init->thread_x == thread_generic;
+ generic = generic || targ->task_init->thread_x == thread_generic || l3;
}
PROX_PANIC(generic && pipeline, "Can't run both pipeline and normal thread on same core\n");
@@ -127,8 +129,8 @@ static void check_zero_rx(void)
static void check_missing_rx(void)
{
- struct lcore_cfg *lconf = NULL, *rx_lconf = NULL;
- struct task_args *targ, *rx_targ = NULL;
+ struct lcore_cfg *lconf = NULL, *rx_lconf = NULL, *tx_lconf = NULL;
+ struct task_args *targ, *rx_targ = NULL, *tx_targ = NULL;
struct prox_port_cfg *port;
uint8_t port_id, rx_port_id, ok;
@@ -143,8 +145,30 @@ static void check_missing_rx(void)
lconf = NULL;
while (core_targ_next(&lconf, &targ, 0) == 0) {
- if (strcmp(targ->task_init->sub_mode_str, "l3") != 0)
+ if (strcmp(targ->sub_mode_str, "l3") != 0)
continue;
+
+ // If the L3 sub_mode receives from a port, check that there is at least one core/task
+ // transmitting to this port in L3 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) {
+ port = find_reachable_port(tx_targ);
+ if (port == NULL)
+ continue;
+ port_id = port - prox_port_cfg;
+ if ((rx_port_id == port_id) && (tx_targ->flags & TASK_ARG_L3)){
+ ok = 1;
+ break;
+ }
+ }
+ PROX_PANIC(ok == 0, "RX L3 sub mode for port %d on core %d task %d, but no core/task transmitting on that port\n", rx_port_id, lconf->id, targ->id);
+ }
+
+ // If the L3 sub_mode transmits to a port, check that there is at least one core/task
+ // receiving from that port in L3 sub_mode.
port = find_reachable_port(targ);
if (port == NULL)
continue;
@@ -155,7 +179,7 @@ static void check_missing_rx(void)
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->task_init->flag_features & TASK_FEATURE_L3)){
+ if ((rx_port_id == port_id) && (rx_targ->flags & TASK_ARG_L3)){
ok = 1;
break;
}
@@ -522,7 +546,7 @@ static void init_rings(void)
lconf = NULL;
struct prox_port_cfg *port;
while (core_targ_next(&lconf, &starg, 1) == 0) {
- if ((starg->task_init) && (starg->task_init->flag_features & TASK_FEATURE_L3)) {
+ if ((starg->task_init) && (starg->flags & TASK_ARG_L3)) {
struct core_task ct;
ct.core = prox_cfg.master;
ct.task = 0;