diff mbox

[ovs-dev,v3,2/2] dpif-netdev: Move setting of queue number to netdev layer.

Message ID 57722F56.5030807@samsung.com
State Not Applicable
Headers show

Commit Message

Ilya Maximets June 28, 2016, 8:03 a.m. UTC
This incremental fixup adds few comments and reduces
number of queues to poll after virtio disconnection by
reconfiguration with 1 queue pair requested.

---
 lib/dpif-netdev.c |  6 ++++--
 lib/netdev-dpdk.c | 12 ++++++------
 2 files changed, 10 insertions(+), 8 deletions(-)
diff mbox

Patch

diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c
index 9d88b72..5087223 100644
--- a/lib/dpif-netdev.c
+++ b/lib/dpif-netdev.c
@@ -442,8 +442,10 @@  struct dp_netdev_pmd_thread {
     pthread_t thread;
     unsigned core_id;               /* CPU core id of this pmd thread. */
     int numa_id;                    /* numa node id of this pmd thread. */
-    atomic_int tx_qid;              /* Queue id used by this pmd thread to
-                                     * send packets on all netdevs */
+
+    /* Queue id used by this pmd thread to send packets on all netdevs.
+     * All tx_qid's are unique and less than 'ovs_numa_get_n_cores() + 1'. */
+    atomic_int tx_qid;
 
     struct ovs_mutex port_mutex;    /* Mutex for 'poll_list' and 'tx_ports'. */
     /* List of rx queues to poll. */
diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c
index 7ee7d2f..6687960 100644
--- a/lib/netdev-dpdk.c
+++ b/lib/netdev-dpdk.c
@@ -2296,15 +2296,15 @@  destroy_device(volatile struct virtio_net *virtio_dev)
             ovs_mutex_lock(&dev->mutex);
             virtio_dev->flags &= ~VIRTIO_DEV_RUNNING;
             ovsrcu_set(&dev->virtio_dev, NULL);
-            /* Clear txq settings. */
+            /* Clear tx/rx queue settings. */
             netdev_dpdk_txq_map_clear(dev);
-            dev->up.n_rxq = NR_QUEUE;
-            dev->up.n_txq = NR_QUEUE;
-            dev->requested_n_rxq = dev->up.n_rxq;
-            dev->requested_n_txq = dev->up.n_txq;
-            exists = true;
+            dev->requested_n_rxq = NR_QUEUE;
+            dev->requested_n_txq = NR_QUEUE;
+            netdev_request_reconfigure(&dev->up);
+
             netdev_change_seq_changed(&dev->up);
             ovs_mutex_unlock(&dev->mutex);
+            exists = true;
             break;
         }
     }