Merge "PROX generator: performance optimization (3/4)"
[samplevnf.git] / VNFs / DPPD-PROX / lconf.c
index 399c8a7..935bac5 100644 (file)
@@ -198,6 +198,15 @@ int lconf_do_flags(struct lcore_cfg *lconf)
        struct task_base *t;
        int ret = 0;
 
+       if ((lconf->msg.type == LCONF_MSG_TRACE) && (lconf->tasks_all[lconf->msg.task_id]->tx_pkt == tx_pkt_drop_all)) {
+               /* We are asked to dump packets through command dump.
+                * This usually means map RX and TX packets before printing them.
+                * However we do not transmit the packets in this case => use the DUMP_RX function.
+                * This will prevent seeing the received packets also printed as TX[255] (= dropped)
+                */
+               lconf->msg.type = LCONF_MSG_DUMP_RX;
+       }
+
        switch (lconf->msg.type) {
        case LCONF_MSG_STOP:
                msg_stop(lconf);
@@ -307,10 +316,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;