diff options
-rw-r--r-- | VNFs/DPPD-PROX/lconf.c | 4 | ||||
-rw-r--r-- | VNFs/DPPD-PROX/rx_pkt.c | 10 | ||||
-rw-r--r-- | VNFs/DPPD-PROX/task_base.h | 11 |
3 files changed, 13 insertions, 12 deletions
diff --git a/VNFs/DPPD-PROX/lconf.c b/VNFs/DPPD-PROX/lconf.c index 399c8a7d..682c106f 100644 --- a/VNFs/DPPD-PROX/lconf.c +++ b/VNFs/DPPD-PROX/lconf.c @@ -307,10 +307,10 @@ int lconf_do_flags(struct lcore_cfg *lconf) t = lconf->tasks_all[task_id]; if (t->aux->tx_pkt_orig) { if (t->tx_pkt == tx_pkt_l3) { - t->tx_pkt = t->aux->tx_pkt_orig; + t->aux->tx_pkt_l2 = t->aux->tx_pkt_orig; t->aux->tx_pkt_orig = NULL; } else { - t->aux->tx_pkt_l2 = t->aux->tx_pkt_orig; + t->tx_pkt = t->aux->tx_pkt_orig; t->aux->tx_pkt_orig = NULL; } lconf->flags &= ~LCONF_FLAG_TX_DISTR_ACTIVE; diff --git a/VNFs/DPPD-PROX/rx_pkt.c b/VNFs/DPPD-PROX/rx_pkt.c index ec698d9a..bd06b267 100644 --- a/VNFs/DPPD-PROX/rx_pkt.c +++ b/VNFs/DPPD-PROX/rx_pkt.c @@ -388,13 +388,9 @@ static uint16_t call_prev_rx_pkt(struct task_base *tbase, struct rte_mbuf ***mbu { uint16_t ret; - if (tbase->aux->rx_prev_idx + 1 == tbase->aux->rx_prev_count) { - ret = tbase->aux->rx_pkt_prev[tbase->aux->rx_prev_idx](tbase, mbufs); - } else { - tbase->aux->rx_prev_idx++; - ret = tbase->aux->rx_pkt_prev[tbase->aux->rx_prev_idx](tbase, mbufs); - tbase->aux->rx_prev_idx--; - } + tbase->aux->rx_prev_idx++; + ret = tbase->aux->rx_pkt_prev[tbase->aux->rx_prev_idx - 1](tbase, mbufs); + tbase->aux->rx_prev_idx--; return ret; } diff --git a/VNFs/DPPD-PROX/task_base.h b/VNFs/DPPD-PROX/task_base.h index ad00962f..f8c05242 100644 --- a/VNFs/DPPD-PROX/task_base.h +++ b/VNFs/DPPD-PROX/task_base.h @@ -213,8 +213,8 @@ static void task_base_add_rx_pkt_function(struct task_base *tbase, rx_pkt_func t return; } - for (int16_t i = tbase->aux->rx_prev_count; i >= 0; --i) { - tbase->aux->rx_pkt_prev[i + 1] = tbase->aux->rx_pkt_prev[i]; + for (int16_t i = tbase->aux->rx_prev_count; i > 0; --i) { + tbase->aux->rx_pkt_prev[i] = tbase->aux->rx_pkt_prev[i - 1]; } tbase->aux->rx_pkt_prev[0] = tbase->rx_pkt; tbase->rx_pkt = to_add; @@ -226,8 +226,13 @@ static void task_base_del_rx_pkt_function(struct task_base *tbase, rx_pkt_func t int cur = 0; int found = 0; - if (tbase->aux->rx_prev_count == 1) { + if (unlikely(tbase->aux->rx_prev_count == 0)) { + return; + } else if (tbase->rx_pkt == to_del) { tbase->rx_pkt = tbase->aux->rx_pkt_prev[0]; + for (int16_t i = 0; i < tbase->aux->rx_prev_count - 1; ++i) { + tbase->aux->rx_pkt_prev[i] = tbase->aux->rx_pkt_prev[i + 1]; + } found = 1; } else { for (int16_t i = 0; i < tbase->aux->rx_prev_count; ++i) { |