From 23083672b511c38d3c1b3275f6395e7439bf541c Mon Sep 17 00:00:00 2001 From: Kevin Traynor Date: Wed, 20 Oct 2021 10:04:32 +0100 Subject: [PATCH] dpif-netdev: Reset RxQ cycles history on PMD reload. When a PMD reload occurs, some PMD cycle measurements are reset. In order to preserve the full cycles history of an Rxq, the RxQ cycle measurements were not reset. These are both used together to display the % of a PMD that an RxQ is using in the pmd-rxq-show stat. Resetting one and not the other can lead to some unintuitive looking stats while the stats settle for the new config. In some cases, it may appear like the RxQs are using >100% of a PMD. This resolves when the stats settle for the new config, but seeing RxQs apparently using >100% of a PMD may confuse a user and lead them to think there is a bug. To avoid this, reset the RxQ cycle measurements on PMD reload. Signed-off-by: Kevin Traynor Acked-by: Maxime Coquelin Acked-by: Gaetan Rivet Acked-by: David Marchand Signed-off-by: Ilya Maximets --- lib/dpif-netdev.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c index 98453a206..20079d2a3 100644 --- a/lib/dpif-netdev.c +++ b/lib/dpif-netdev.c @@ -6187,6 +6187,9 @@ reload: 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); + for (int j = 0; j < PMD_INTERVAL_MAX; j++) { + dp_netdev_rxq_set_intrvl_cycles(poll_list[i].rxq, 0); + } } if (!poll_cnt) {