[ovs-dev,RFC,7/8] dpif-netdev: Reset the rxq current cycle counter on reload.

Message ID 1515096166-16257-8-git-send-email-jan.scheurich@ericsson.com
State Superseded
Delegated to: Ian Stokes
Headers show
Series
  • dpif-netdev: Refactor cycle count and rebased patches
Related show

Commit Message

Jan Scheurich Jan. 4, 2018, 8:02 p.m.
From: Kevin Traynor <ktraynor@redhat.com>

An rxq may have processing cycles counted in the current
counter when a reload happens. That could temporarily create
a small skew on the stats for an rxq. Reset the counter after
reload.

Fixes: 4809891b2e01 ("dpif-netdev: Count the rxq processing cycles for an rxq.")
Signed-off-by: Kevin Traynor <ktraynor@redhat.com>
---
 lib/dpif-netdev.c | 2 ++
 1 file changed, 2 insertions(+)

Patch

diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c
index 5d23128..fc10f8e 100644
--- a/lib/dpif-netdev.c
+++ b/lib/dpif-netdev.c
@@ -4246,6 +4246,8 @@  reload:
        VLOG_DBG("Core %d processing port \'%s\' with queue-id %d\n",
                 pmd->core_id, netdev_rxq_get_name(poll_list[i].rxq->rx),
                 netdev_rxq_get_queue_id(poll_list[i].rxq->rx));
+       /* Reset the rxq current cycles counter. */
+       dp_netdev_rxq_set_cycles(poll_list[i].rxq, RXQ_CYCLES_PROC_CURR, 0);
     }
 
     if (!poll_cnt) {