net/ionic: log queue counters when tearing down
authorAndrew Boyer <aboyer@pensando.io>
Tue, 16 Feb 2021 20:35:35 +0000 (12:35 -0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Thu, 25 Feb 2021 15:58:56 +0000 (16:58 +0100)
This improves debuggability.

To see the logs, use EAL arg: --log-level=pmd.net.ionic,debug

While here, stop counting fragments, but start counting mtods.

Signed-off-by: Andrew Boyer <aboyer@pensando.io>
drivers/net/ionic/ionic_lif.h
drivers/net/ionic/ionic_rxtx.c

index ba1471b..5885aa1 100644 (file)
@@ -34,7 +34,6 @@ struct ionic_tx_stats {
        uint64_t stop;
        uint64_t no_csum;
        uint64_t tso;
-       uint64_t frags;
 };
 
 struct ionic_rx_stats {
@@ -44,6 +43,7 @@ struct ionic_rx_stats {
        uint64_t bad_cq_status;
        uint64_t no_room;
        uint64_t bad_len;
+       uint64_t mtods;
 };
 
 #define IONIC_QCQ_F_INITED     BIT(0)
index 89b3773..fa92fca 100644 (file)
@@ -123,9 +123,13 @@ void __rte_cold
 ionic_dev_tx_queue_release(void *tx_queue)
 {
        struct ionic_tx_qcq *txq = tx_queue;
+       struct ionic_tx_stats *stats = &txq->stats;
 
        IONIC_PRINT_CALL();
 
+       IONIC_PRINT(DEBUG, "TX queue %u pkts %ju tso %ju",
+               txq->qcq.q.index, stats->packets, stats->tso);
+
        ionic_lif_txq_deinit(txq);
 
        ionic_qcq_free(&txq->qcq);
@@ -410,7 +414,6 @@ ionic_tx_tso(struct ionic_tx_qcq *txq, struct rte_mbuf *txm,
                offset = 0;
                data_iova = rte_mbuf_data_iova(txm_seg);
                left = txm_seg->data_len;
-               stats->frags++;
 
                while (left > 0) {
                        next_addr = rte_cpu_to_le_64(data_iova + offset);
@@ -508,7 +511,6 @@ ionic_tx(struct ionic_tx_qcq *txq, struct rte_mbuf *txm,
        while (txm_seg != NULL) {
                elem->len = txm_seg->data_len;
                elem->addr = rte_cpu_to_le_64(rte_mbuf_data_iova(txm_seg));
-               stats->frags++;
                elem++;
                txm_seg = txm_seg->next;
        }
@@ -657,12 +659,18 @@ void __rte_cold
 ionic_dev_rx_queue_release(void *rx_queue)
 {
        struct ionic_rx_qcq *rxq = rx_queue;
+       struct ionic_rx_stats *stats;
 
        if (!rxq)
                return;
 
        IONIC_PRINT_CALL();
 
+       stats = &rxq->stats;
+
+       IONIC_PRINT(DEBUG, "RX queue %u pkts %ju mtod %ju",
+               rxq->qcq.q.index, stats->packets, stats->mtods);
+
        ionic_rx_empty(rxq);
 
        ionic_lif_rxq_deinit(rxq);
@@ -887,6 +895,7 @@ ionic_rx_clean(struct ionic_rx_qcq *rxq,
                                pkt_type = RTE_PTYPE_L2_ETHER_ARP;
                        else
                                pkt_type = RTE_PTYPE_UNKNOWN;
+                       stats->mtods++;
                        break;
                }
        }