Damjan Marion | bce6b6a | 2015-12-16 04:27:37 +0100 | [diff] [blame] | 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 |
| 5 | |
| 6 | --- |
| 7 | drivers/net/virtio/virtio_ethdev.c | 10 +++++----- |
| 8 | drivers/net/virtio/virtio_rxtx.c | 4 +++- |
| 9 | 2 files changed, 8 insertions(+), 6 deletions(-) |
| 10 | |
| 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; |
| 17 | |
| 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) { |
| 24 | link.link_status = 0; |
| 25 | - PMD_INIT_LOG(DEBUG, "Port %d is down", |
| 26 | - dev->data->port_id); |
| 27 | } else { |
| 28 | link.link_status = 1; |
| 29 | - PMD_INIT_LOG(DEBUG, "Port %d is up", |
| 30 | - dev->data->port_id); |
| 31 | } |
| 32 | } else { |
| 33 | link.link_status = 1; /* Link up */ |
| 34 | } |
| 35 | virtio_dev_atomic_write_link_status(dev, &link); |
| 36 | |
| 37 | + /* This message is far too noisy for normal use */ |
| 38 | + if (0) |
| 39 | + PMD_INIT_LOG(DEBUG, "Port %d is %s\n", dev->data->port_id, |
| 40 | + link.link_status ? "up" : "down"); |
| 41 | + |
| 42 | return (old.link_status == link.link_status) ? -1 : 0; |
| 43 | } |
| 44 | |
| 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) |
| 50 | rxm->next = NULL; |
| 51 | rxm->pkt_len = (uint32_t)(len[i] - hdr_size); |
| 52 | rxm->data_len = (uint16_t)(len[i] - hdr_size); |
| 53 | + rxm->ol_flags = 0; |
| 54 | |
| 55 | if (hw->vlan_strip) |
| 56 | rte_vlan_strip(rxm); |
| 57 | @@ -737,6 +738,7 @@ virtio_recv_mergeable_pkts(void *rx_queue, |
| 58 | rxm->vlan_tci = 0; |
| 59 | rxm->pkt_len = (uint32_t)(len[0] - hdr_size); |
| 60 | rxm->data_len = (uint16_t)(len[0] - hdr_size); |
| 61 | + rxm->ol_flags = 0; |
| 62 | |
| 63 | rxm->port = rxvq->port_id; |
| 64 | rx_pkts[nb_rx] = rxm; |
| 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)) |
| 67 | return nb_pkts; |
| 68 | |
| 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); |
| 72 | |
| 73 | virtio_rmb(); |
| 74 | -- |
| 75 | 2.5.0 |
| 76 | |