1 From e2592eb622c33791d8ae51153360bd8249bdd056 Mon Sep 17 00:00:00 2001
2 From: Damjan Marion <damarion@cisco.com>
3 Date: Wed, 16 Dec 2015 03:29:22 +0100
4 Subject: [PATCH 3/4] virtio: Cleanup virtio pmd debug log output, reset
7 drivers/net/virtio/virtio_ethdev.c | 10 +++++-----
8 drivers/net/virtio/virtio_rxtx.c | 4 +++-
9 2 files changed, 8 insertions(+), 6 deletions(-)
11 diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c
12 index d928339..2fa1587 100644
13 --- a/drivers/net/virtio/virtio_ethdev.c
14 +++ b/drivers/net/virtio/virtio_ethdev.c
15 @@ -1635,24 +1635,24 @@ virtio_dev_link_update(struct rte_eth_dev *dev, __rte_unused int wait_to_complet
16 link.link_speed = SPEED_10G;
18 if (vtpci_with_feature(hw, VIRTIO_NET_F_STATUS)) {
19 - PMD_INIT_LOG(DEBUG, "Get link status from hw");
20 vtpci_read_dev_config(hw,
21 offsetof(struct virtio_net_config, status),
22 &status, sizeof(status));
23 if ((status & VIRTIO_NET_S_LINK_UP) == 0) {
25 - PMD_INIT_LOG(DEBUG, "Port %d is down",
26 - dev->data->port_id);
29 - PMD_INIT_LOG(DEBUG, "Port %d is up",
30 - dev->data->port_id);
33 link.link_status = 1; /* Link up */
35 virtio_dev_atomic_write_link_status(dev, &link);
37 + /* This message is far too noisy for normal use */
39 + PMD_INIT_LOG(DEBUG, "Port %d is %s\n", dev->data->port_id,
40 + link.link_status ? "up" : "down");
42 return (old.link_status == link.link_status) ? -1 : 0;
45 diff --git a/drivers/net/virtio/virtio_rxtx.c b/drivers/net/virtio/virtio_rxtx.c
46 index 74b39ef..2512bce 100644
47 --- a/drivers/net/virtio/virtio_rxtx.c
48 +++ b/drivers/net/virtio/virtio_rxtx.c
49 @@ -618,6 +618,7 @@ virtio_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts)
51 rxm->pkt_len = (uint32_t)(len[i] - hdr_size);
52 rxm->data_len = (uint16_t)(len[i] - hdr_size);
57 @@ -737,6 +738,7 @@ virtio_recv_mergeable_pkts(void *rx_queue,
59 rxm->pkt_len = (uint32_t)(len[0] - hdr_size);
60 rxm->data_len = (uint16_t)(len[0] - hdr_size);
63 rxm->port = rxvq->port_id;
65 @@ -838,7 +840,7 @@ virtio_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
66 if (unlikely(nb_pkts < 1))
69 - PMD_TX_LOG(DEBUG, "%d packets to xmit", nb_pkts);
70 + PMD_TX_LOG(DEBUG, "%d packets to xmit\n", nb_pkts);
71 nb_used = VIRTQUEUE_NUSED(txvq);