From: Jianfeng Tan Date: Tue, 19 Apr 2016 05:22:37 +0000 (+0000) Subject: virtio: fix newline under debug mode X-Git-Tag: spdx-start~6944 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=e908312704278148b0b3155a0093c8b96bf59e26;p=dpdk.git virtio: fix newline under debug mode 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 Acked-by: Yuanhan Liu --- diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c index 63a368ac82..a0ef0a1ea0 100644 --- a/drivers/net/virtio/virtio_ethdev.c +++ b/drivers/net/virtio/virtio_ethdev.c @@ -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; } diff --git a/drivers/net/virtio/virtio_logs.h b/drivers/net/virtio/virtio_logs.h index d6c33f7b38..90a79eaa5b 100644 --- a/drivers/net/virtio/virtio_logs.h +++ b/drivers/net/virtio/virtio_logs.h @@ -47,14 +47,14 @@ #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 diff --git a/drivers/net/virtio/virtio_rxtx.c b/drivers/net/virtio/virtio_rxtx.c index ef21d8e343..2dafebdfd3 100644 --- a/drivers/net/virtio/virtio_rxtx.c +++ b/drivers/net/virtio/virtio_rxtx.c @@ -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++;