From 6ecdeb8fb5c38a9c1b60eba98b7f8f23c5fe394d Mon Sep 17 00:00:00 2001 From: Xavier Simonart Date: Tue, 26 May 2020 11:56:41 +0200 Subject: Fix Idle count Change-Id: Idd72b593504139ac9d42c33767f8a18395b2cc87 Signed-off-by: Xavier Simonart --- VNFs/DPPD-PROX/rx_pkt.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'VNFs') diff --git a/VNFs/DPPD-PROX/rx_pkt.c b/VNFs/DPPD-PROX/rx_pkt.c index 17e39646..1fd5ca85 100644 --- a/VNFs/DPPD-PROX/rx_pkt.c +++ b/VNFs/DPPD-PROX/rx_pkt.c @@ -260,8 +260,10 @@ static inline uint16_t rx_pkt_hw1_param(struct task_base *tbase, struct rte_mbuf } } - if (nb_rx == 0) + if (unlikely(nb_rx == 0)) { + TASK_STATS_ADD_IDLE(&tbase->aux->stats, rte_rdtsc() - cur_tsc); return 0; + } if (l3_ndp == PROX_L3) skip = handle_l3(tbase, nb_rx, mbufs_ptr); @@ -270,12 +272,9 @@ static inline uint16_t rx_pkt_hw1_param(struct task_base *tbase, struct rte_mbuf if (skip) TASK_STATS_ADD_RX_NON_DP(&tbase->aux->stats, skip); - if (likely(nb_rx > 0)) { - TASK_STATS_ADD_RX(&tbase->aux->stats, nb_rx); - return nb_rx - skip; - } - TASK_STATS_ADD_IDLE(&tbase->aux->stats, rte_rdtsc() - cur_tsc); - return 0; + + TASK_STATS_ADD_RX(&tbase->aux->stats, nb_rx); + return nb_rx - skip; } uint16_t rx_pkt_hw(struct task_base *tbase, struct rte_mbuf ***mbufs) -- cgit 1.2.3-korg