[ovs-dev] [PATCH 2/3] dpif-netdev: Optimize txq assignment.

Ilya Maximets i.maximets at samsung.com
Fri Dec 2 14:48:54 UTC 2016


Signed-off-by: Ilya Maximets <i.maximets at samsung.com>
---
 lib/dpif-netdev.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c
index 8e9a623..8af2811 100644
--- a/lib/dpif-netdev.c
+++ b/lib/dpif-netdev.c
@@ -3317,13 +3317,15 @@ reconfigure_datapath(struct dp_netdev *dp)
     }
 
     /* Add every port to the tx cache of every pmd thread, if it's not
-     * there already. */
-    HMAP_FOR_EACH(port, node, &dp->ports) {
-        CMAP_FOR_EACH(pmd, node, &dp->poll_threads) {
-            ovs_mutex_lock(&pmd->port_mutex);
-            dp_netdev_add_port_tx_to_pmd(pmd, port);
-            ovs_mutex_unlock(&pmd->port_mutex);
+     * there already and if this pmd has at least one rxq to poll. */
+    CMAP_FOR_EACH(pmd, node, &dp->poll_threads) {
+        ovs_mutex_lock(&pmd->port_mutex);
+        if (hmap_count(&pmd->poll_list) || pmd->core_id == NON_PMD_CORE_ID) {
+            HMAP_FOR_EACH(port, node, &dp->ports) {
+                dp_netdev_add_port_tx_to_pmd(pmd, port);
+            }
         }
+        ovs_mutex_unlock(&pmd->port_mutex);
     }
 
     /* Reload affected pmd threads. */
-- 
2.7.4



More information about the dev mailing list