Do not add count of non dataplane packets to dropped count 55/66155/1
authorXavier Simonart <xavier.simonart@intel.com>
Thu, 20 Dec 2018 21:01:40 +0000 (22:01 +0100)
committerXavier Simonart <xavier.simonart@intel.com>
Thu, 20 Dec 2018 21:01:40 +0000 (22:01 +0100)
RX packets count = TX count + dropped (handled + discarded) count +
non dataplane packets count.
Hence non dataplane packets such as unexpected packets (e.g. dhcp request)
should not b considerded as handled.

Change-Id: I45cef19fed09bb4f86644d56d689a0959a9038db
Signed-off-by: Xavier Simonart <xavier.simonart@intel.com>
VNFs/DPPD-PROX/handle_lat.c

index a0e5fb4..8c7de8f 100644 (file)
@@ -505,6 +505,7 @@ static void task_lat_store_lat(struct task_lat *task, uint64_t rx_packet_index,
 static int handle_lat_bulk(struct task_base *tbase, struct rte_mbuf **mbufs, uint16_t n_pkts)
 {
        struct task_lat *task = (struct task_lat *)tbase;
+       int rc;
 
        // If link is down, link_speed is 0
        if (unlikely(task->link_speed == 0)) {
@@ -662,7 +663,11 @@ static int handle_lat_bulk(struct task_base *tbase, struct rte_mbuf **mbufs, uin
        task->begin = tbase->aux->tsc_rx.before;
        task->last_pkts_tsc = tbase->aux->tsc_rx.after;
 
-       return task->base.tx_pkt(&task->base, mbufs, n_pkts, NULL);
+       rc = task->base.tx_pkt(&task->base, mbufs, n_pkts, NULL);
+       // non_dp_count should not be drop-handled, as there are all by definition considered as not handled
+       // RX = DISCARDED + HANDLED + NON_DP + (TX - TX_NON_DP) + TX_FAIL
+       TASK_STATS_ADD_DROP_HANDLED(&tbase->aux->stats, -non_dp_count);
+       return rc;
 }
 
 static void init_task_lat_latency_buffer(struct task_lat *task, uint32_t core_id)