virtio: fix newline under debug mode
authorJianfeng Tan <jianfeng.tan@intel.com>
Tue, 19 Apr 2016 05:22:37 +0000 (05:22 +0000)
committerYuanhan Liu <yuanhan.liu@linux.intel.com>
Tue, 10 May 2016 17:52:01 +0000 (10:52 -0700)
Issue: output of appliations and debug info of DPDK may be mixed up
in same line when enabling below debug options of virtio:
CONFIG_RTE_LIBRTE_VIRTIO_DEBUG_INIT
CONFIG_RTE_LIBRTE_VIRTIO_DEBUG_TX
CONFIG_RTE_LIBRTE_VIRTIO_DEBUG_DRIVER

This patch adds "\n" in the tail of definitions like PMD_RX_LOG,
PMD_TX_LOG, and PMD_DRV_LOG, and removes some "\n" when using these
macros.

Fixes: c1f86306a026 ("virtio: add new driver")

Signed-off-by: Jianfeng Tan <jianfeng.tan@intel.com>
Acked-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
drivers/net/virtio/virtio_ethdev.c
drivers/net/virtio/virtio_logs.h
drivers/net/virtio/virtio_rxtx.c

index 63a368a..a0ef0a1 100644 (file)
@@ -827,7 +827,7 @@ virtio_mac_table_set(struct virtio_hw *hw,
        int err, len[2];
 
        if (!vtpci_with_feature(hw, VIRTIO_NET_F_CTRL_MAC_ADDR)) {
-               PMD_DRV_LOG(INFO, "host does not support mac table\n");
+               PMD_DRV_LOG(INFO, "host does not support mac table");
                return;
        }
 
index d6c33f7..90a79ea 100644 (file)
 
 #ifdef RTE_LIBRTE_VIRTIO_DEBUG_RX
 #define PMD_RX_LOG(level, fmt, args...) \
-       RTE_LOG(level, PMD, "%s() rx: " fmt , __func__, ## args)
+       RTE_LOG(level, PMD, "%s() rx: " fmt "\n", __func__, ## args)
 #else
 #define PMD_RX_LOG(level, fmt, args...) do { } while(0)
 #endif
 
 #ifdef RTE_LIBRTE_VIRTIO_DEBUG_TX
 #define PMD_TX_LOG(level, fmt, args...) \
-       RTE_LOG(level, PMD, "%s() tx: " fmt , __func__, ## args)
+       RTE_LOG(level, PMD, "%s() tx: " fmt "\n", __func__, ## args)
 #else
 #define PMD_TX_LOG(level, fmt, args...) do { } while(0)
 #endif
@@ -62,7 +62,7 @@
 
 #ifdef RTE_LIBRTE_VIRTIO_DEBUG_DRIVER
 #define PMD_DRV_LOG(level, fmt, args...) \
-       RTE_LOG(level, PMD, "%s(): " fmt , __func__, ## args)
+       RTE_LOG(level, PMD, "%s(): " fmt "\n", __func__, ## args)
 #else
 #define PMD_DRV_LOG(level, fmt, args...) do { } while(0)
 #endif
index ef21d8e..2dafebd 100644 (file)
@@ -680,7 +680,7 @@ virtio_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts)
 
                if (unlikely(virtqueue_kick_prepare(rxvq))) {
                        virtqueue_notify(rxvq);
-                       PMD_RX_LOG(DEBUG, "Notified\n");
+                       PMD_RX_LOG(DEBUG, "Notified");
                }
        }
 
@@ -710,7 +710,7 @@ virtio_recv_mergeable_pkts(void *rx_queue,
 
        virtio_rmb();
 
-       PMD_RX_LOG(DEBUG, "used:%d\n", nb_used);
+       PMD_RX_LOG(DEBUG, "used:%d", nb_used);
 
        hw = rxvq->hw;
        nb_rx = 0;
@@ -733,13 +733,13 @@ virtio_recv_mergeable_pkts(void *rx_queue,
 
                i++;
 
-               PMD_RX_LOG(DEBUG, "dequeue:%d\n", num);
-               PMD_RX_LOG(DEBUG, "packet len:%d\n", len[0]);
+               PMD_RX_LOG(DEBUG, "dequeue:%d", num);
+               PMD_RX_LOG(DEBUG, "packet len:%d", len[0]);
 
                rxm = rcv_pkts[0];
 
                if (unlikely(len[0] < hdr_size + ETHER_HDR_LEN)) {
-                       PMD_RX_LOG(ERR, "Packet drop\n");
+                       PMD_RX_LOG(ERR, "Packet drop");
                        nb_enqueued++;
                        virtio_discard_rxbuf(rxvq, rxm);
                        rxvq->errors++;
@@ -781,7 +781,7 @@ virtio_recv_mergeable_pkts(void *rx_queue,
                                rcv_cnt = rx_num;
                        } else {
                                PMD_RX_LOG(ERR,
-                                       "No enough segments for packet.\n");
+                                          "No enough segments for packet.");
                                nb_enqueued++;
                                virtio_discard_rxbuf(rxvq, rxm);
                                rxvq->errors++;