Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 1 | From 21a9bf50270f71ebda5acb5fc233b8279cec56a7 Mon Sep 17 00:00:00 2001 |
| 2 | From: Shesha Sreenivasamurthy <shesha@cisco.com> |
| 3 | Date: Wed, 2 Sep 2015 08:48:09 -0700 |
| 4 | Subject: [PATCH 6/9] virtio: Cleanup virtio pmd debug log output, reset |
| 5 | offload field |
| 6 | |
| 7 | --- |
| 8 | drivers/net/virtio/virtio_ethdev.c | 10 +++++----- |
| 9 | drivers/net/virtio/virtio_rxtx.c | 4 +++- |
| 10 | 2 files changed, 8 insertions(+), 6 deletions(-) |
| 11 | |
| 12 | diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c |
| 13 | index 465d3cd..6a686fe 100644 |
| 14 | --- a/drivers/net/virtio/virtio_ethdev.c |
| 15 | +++ b/drivers/net/virtio/virtio_ethdev.c |
| 16 | @@ -1521,24 +1521,24 @@ virtio_dev_link_update(struct rte_eth_dev *dev, __rte_unused int wait_to_complet |
| 17 | link.link_speed = SPEED_10G; |
| 18 | |
| 19 | if (vtpci_with_feature(hw, VIRTIO_NET_F_STATUS)) { |
| 20 | - PMD_INIT_LOG(DEBUG, "Get link status from hw"); |
| 21 | vtpci_read_dev_config(hw, |
| 22 | offsetof(struct virtio_net_config, status), |
| 23 | &status, sizeof(status)); |
| 24 | if ((status & VIRTIO_NET_S_LINK_UP) == 0) { |
| 25 | link.link_status = 0; |
| 26 | - PMD_INIT_LOG(DEBUG, "Port %d is down", |
| 27 | - dev->data->port_id); |
| 28 | } else { |
| 29 | link.link_status = 1; |
| 30 | - PMD_INIT_LOG(DEBUG, "Port %d is up", |
| 31 | - dev->data->port_id); |
| 32 | } |
| 33 | } else { |
| 34 | link.link_status = 1; /* Link up */ |
| 35 | } |
| 36 | virtio_dev_atomic_write_link_status(dev, &link); |
| 37 | |
| 38 | + /* This message is far too noisy for normal use */ |
| 39 | + if (0) |
| 40 | + PMD_INIT_LOG(DEBUG, "Port %d is %s\n", dev->data->port_id, |
| 41 | + link.link_status ? "up" : "down"); |
| 42 | + |
| 43 | return (old.link_status == link.link_status) ? -1 : 0; |
| 44 | } |
| 45 | |
| 46 | diff --git a/drivers/net/virtio/virtio_rxtx.c b/drivers/net/virtio/virtio_rxtx.c |
| 47 | index c5b53bb..9f0b759 100644 |
| 48 | --- a/drivers/net/virtio/virtio_rxtx.c |
| 49 | +++ b/drivers/net/virtio/virtio_rxtx.c |
| 50 | @@ -536,6 +536,7 @@ virtio_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts) |
| 51 | rxm->next = NULL; |
| 52 | rxm->pkt_len = (uint32_t)(len[i] - hdr_size); |
| 53 | rxm->data_len = (uint16_t)(len[i] - hdr_size); |
| 54 | + rxm->ol_flags = 0; |
| 55 | |
| 56 | if (hw->vlan_strip) |
| 57 | rte_vlan_strip(rxm); |
| 58 | @@ -651,6 +652,7 @@ virtio_recv_mergeable_pkts(void *rx_queue, |
| 59 | rxm->next = NULL; |
| 60 | rxm->pkt_len = (uint32_t)(len[0] - hdr_size); |
| 61 | rxm->data_len = (uint16_t)(len[0] - hdr_size); |
| 62 | + rxm->ol_flags = 0; |
| 63 | |
| 64 | rxm->port = rxvq->port_id; |
| 65 | rx_pkts[nb_rx] = rxm; |
| 66 | @@ -752,7 +754,7 @@ virtio_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts) |
| 67 | if (unlikely(nb_pkts < 1)) |
| 68 | return nb_pkts; |
| 69 | |
| 70 | - PMD_TX_LOG(DEBUG, "%d packets to xmit", nb_pkts); |
| 71 | + PMD_TX_LOG(DEBUG, "%d packets to xmit\n", nb_pkts); |
| 72 | nb_used = VIRTQUEUE_NUSED(txvq); |
| 73 | |
| 74 | virtio_rmb(); |
| 75 | -- |
| 76 | 2.5.0 |
| 77 | |