net/netvsc: change datapath logging

The PMD_TX_LOG and PMD_RX_LOG can hide errors since this
debug log is typically disabled. Change the code to use
PMD_DRV_LOG for errors.

Under load, the ring buffer to the host can fill.
Add some statistics to estimate the impact and see other errors.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
This commit is contained in:
Stephen Hemminger 2020-05-19 09:52:26 -07:00 committed by Ferruh Yigit
parent a41ef8eefe
commit b757deb8e3
3 changed files with 22 additions and 9 deletions

View File

@ -58,6 +58,7 @@ static const struct hn_xstats_name_off hn_stat_strings[] = {
{ "good_bytes", offsetof(struct hn_stats, bytes) },
{ "errors", offsetof(struct hn_stats, errors) },
{ "ring full", offsetof(struct hn_stats, ring_full) },
{ "channel full", offsetof(struct hn_stats, channel_full) },
{ "multicast_packets", offsetof(struct hn_stats, multicast) },
{ "broadcast_packets", offsetof(struct hn_stats, broadcast) },
{ "undersize_packets", offsetof(struct hn_stats, size_bins[0]) },

View File

@ -412,8 +412,8 @@ hn_nvs_send_completed(struct rte_eth_dev *dev, uint16_t queue_id,
txq->stats.bytes += txd->data_size;
txq->stats.packets += txd->packets;
} else {
PMD_TX_LOG(NOTICE, "port %u:%u complete tx %u failed status %u",
txq->port_id, txq->queue_id, txd->chim_index, ack->status);
PMD_DRV_LOG(NOTICE, "port %u:%u complete tx %u failed status %u",
txq->port_id, txq->queue_id, txd->chim_index, ack->status);
++txq->stats.errors;
}
@ -438,8 +438,7 @@ hn_nvs_handle_comp(struct rte_eth_dev *dev, uint16_t queue_id,
break;
default:
PMD_TX_LOG(NOTICE,
"unexpected send completion type %u",
PMD_DRV_LOG(NOTICE, "unexpected send completion type %u",
hdr->type);
}
}
@ -657,6 +656,7 @@ static void hn_rxpkt(struct hn_rx_queue *rxq, struct hn_rx_bufinfo *rxb,
if (unlikely(rte_ring_sp_enqueue(rxq->rx_ring, m) != 0)) {
++rxq->stats.ring_full;
PMD_RX_LOG(DEBUG, "rx ring full");
rte_pktmbuf_free(m);
}
}
@ -1174,10 +1174,16 @@ static int hn_flush_txagg(struct hn_tx_queue *txq, bool *need_sig)
if (likely(ret == 0))
hn_reset_txagg(txq);
else
PMD_TX_LOG(NOTICE, "port %u:%u send failed: %d",
txq->port_id, txq->queue_id, ret);
else if (ret == -EAGAIN) {
PMD_TX_LOG(DEBUG, "port %u:%u channel full",
txq->port_id, txq->queue_id);
++txq->stats.channel_full;
} else {
++txq->stats.errors;
PMD_DRV_LOG(NOTICE, "port %u:%u send failed: %d",
txq->port_id, txq->queue_id, ret);
}
return ret;
}
@ -1523,8 +1529,13 @@ hn_xmit_pkts(void *ptxq, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
ret = hn_xmit_sg(txq, txd, m, &need_sig);
if (unlikely(ret != 0)) {
PMD_TX_LOG(NOTICE, "sg send failed: %d", ret);
++txq->stats.errors;
if (ret == -EAGAIN) {
PMD_TX_LOG(DEBUG, "sg channel full");
++txq->stats.channel_full;
} else {
PMD_DRV_LOG(NOTICE, "sg send failed: %d", ret);
++txq->stats.errors;
}
hn_txd_put(txq, txd);
goto fail;
}

View File

@ -40,6 +40,7 @@ struct hn_stats {
uint64_t bytes;
uint64_t errors;
uint64_t ring_full;
uint64_t channel_full;
uint64_t multicast;
uint64_t broadcast;
/* Size bins in array as RFC 2819, undersized [0], 64 [1], etc */