Reconfiguration of HW NICs may lead to packet drops.
In current model all physical ports will be reconfigured each
time number of PMD threads changed. Since we not stopping
threads on pmd-cpu-mask changes, this patch will help to further
decrease port's downtime by setting the maximum possible number
of wanted tx queues to avoid unnecessary reconfigurations.

Signed-off-by: Ilya Maximets <[email protected]>
---
 lib/dpif-netdev.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c
index 6e575ab..e2b4f39 100644
--- a/lib/dpif-netdev.c
+++ b/lib/dpif-netdev.c
@@ -3324,7 +3324,11 @@ reconfigure_datapath(struct dp_netdev *dp)
      * on the system and the user configuration. */
     reconfigure_pmd_threads(dp);
 
-    wanted_txqs = cmap_count(&dp->poll_threads);
+    /* We need 1 Tx queue for each possible cpu core. */
+    wanted_txqs = ovs_numa_get_n_cores();
+    ovs_assert(wanted_txqs != OVS_CORE_UNSPEC);
+    /* And 1 Tx queue for non-PMD threads. */
+    wanted_txqs++;
 
     /* The number of pmd threads might have changed, or a port can be new:
      * adjust the txqs. */
-- 
2.7.4

_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to