[ovs-dev] [RFC PATCH 4/6] dpif-netdev: Make dpcls optimization interval more generic.

Kevin Traynor ktraynor at redhat.com
Fri May 5 16:34:21 UTC 2017


So far the interval was only used for dpcls optimization.
Soon, we will use it for storing cycles to optimize rxq scheduling,
so make the names more generic. Also, set the interval regardless
of whether dpcls optimization has occurred, as the optimization interval
will need to be consistent across pmds.

Signed-off-by: Kevin Traynor <ktraynor at redhat.com>
---
 lib/dpif-netdev.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c
index 80ddb5d..7d7abff 100644
--- a/lib/dpif-netdev.c
+++ b/lib/dpif-netdev.c
@@ -174,6 +174,6 @@ struct emc_cache {
 /* Simple non-wildcarding single-priority classifier. */
 
-/* Time in ms between successive optimizations of the dpcls subtable vector */
-#define DPCLS_OPTIMIZATION_INTERVAL 1000
+/* Time in ms between successive optimizations of the pmd */
+#define PMD_OPTIMIZATION_INTERVAL 1000
 
 struct dpcls {
@@ -4213,5 +4213,5 @@ dp_netdev_configure_pmd(struct dp_netdev_pmd_thread *pmd, struct dp_netdev *dp,
     cmap_init(&pmd->flow_table);
     cmap_init(&pmd->classifiers);
-    pmd->next_optimization = time_msec() + DPCLS_OPTIMIZATION_INTERVAL;
+    pmd->next_optimization = time_msec() + PMD_OPTIMIZATION_INTERVAL;
     hmap_init(&pmd->poll_list);
     hmap_init(&pmd->tx_ports);
@@ -5574,7 +5574,7 @@ dp_netdev_pmd_try_optimize(struct dp_netdev_pmd_thread *pmd)
             }
             ovs_mutex_unlock(&pmd->flow_mutex);
-            /* Start new measuring interval */
-            pmd->next_optimization = now + DPCLS_OPTIMIZATION_INTERVAL;
         }
+        /* Start new measuring interval */
+        pmd->next_optimization = now + PMD_OPTIMIZATION_INTERVAL;
     }
 }
-- 
1.8.3.1



More information about the dev mailing list