]> git.proxmox.com Git - mirror_ovs.git/commitdiff
netdev-dpdk: Print netdev name for txq mapping.
authorIlya Maximets <i.maximets@samsung.com>
Tue, 5 Mar 2019 16:28:26 +0000 (19:28 +0300)
committerIan Stokes <ian.stokes@intel.com>
Fri, 22 Mar 2019 22:44:54 +0000 (22:44 +0000)
In case of reconfiguration while 'vhost_id' is not set yet,
there will be the meaningless message like:

    |netdev_dpdk|DBG|TX queue mapping for
    |netdev_dpdk|DBG| 0 -->  0

It's better to print the name of the netdev which is always set.

Additionally fixed possible splitting by other log messages and
missing space in the queue state message.

Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
Signed-off-by: Ian Stokes <ian.stokes@intel.com>
lib/netdev-dpdk.c

index f0ca4bd6e96612bfa2c2a9cb70d62826fd42f6c1..67df3fc1a5599ee2f175b7c6103220701dd269e0 100644 (file)
@@ -3440,9 +3440,17 @@ netdev_dpdk_remap_txqs(struct netdev_dpdk *dev)
         }
     }
 
-    VLOG_DBG("TX queue mapping for %s\n", dev->vhost_id);
-    for (i = 0; i < total_txqs; i++) {
-        VLOG_DBG("%2d --> %2d", i, dev->tx_q[i].map);
+    if (VLOG_IS_DBG_ENABLED()) {
+        struct ds mapping = DS_EMPTY_INITIALIZER;
+
+        ds_put_format(&mapping, "TX queue mapping for port '%s':\n",
+                      netdev_get_name(&dev->up));
+        for (i = 0; i < total_txqs; i++) {
+            ds_put_format(&mapping, "%2d --> %2d\n", i, dev->tx_q[i].map);
+        }
+
+        VLOG_DBG("%s", ds_cstr(&mapping));
+        ds_destroy(&mapping);
     }
 
     free(enabled_queues);
@@ -3610,7 +3618,7 @@ vring_state_changed(int vid, uint16_t queue_id, int enable)
     ovs_mutex_unlock(&dpdk_mutex);
 
     if (exists) {
-        VLOG_INFO("State of queue %d ( tx_qid %d ) of vhost device '%s'"
+        VLOG_INFO("State of queue %d ( tx_qid %d ) of vhost device '%s' "
                   "changed to \'%s\'", queue_id, qid, ifname,
                   (enable == 1) ? "enabled" : "disabled");
     } else {