]> git.droids-corp.org - dpdk.git/commitdiff
net/sfc: merge Rx and Tx doorbell counters into one
authorAndrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Tue, 2 Nov 2021 13:13:40 +0000 (16:13 +0300)
committerFerruh Yigit <ferruh.yigit@intel.com>
Thu, 4 Nov 2021 16:42:05 +0000 (17:42 +0100)
Datapath queue is either Rx or Tx, so just one counter is sufficient
for doorbells. It can count Tx doorbells in the case of Tx queue and
Rx doorbells in the case of Rx queue.

Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
drivers/net/sfc/sfc_dp.h
drivers/net/sfc/sfc_ef100_rx.c
drivers/net/sfc/sfc_ef100_tx.c
drivers/net/sfc/sfc_ef10_essb_rx.c
drivers/net/sfc/sfc_ef10_rx.c
drivers/net/sfc/sfc_ef10_tx.c
drivers/net/sfc/sfc_rx.c
drivers/net/sfc/sfc_sw_stats.c
drivers/net/sfc/sfc_tx.c

index 994116e480380da38cf3d52665d3ecb57c36e722..c302a5cc13c9cad445dcca363e45736ba4da577f 100644 (file)
@@ -51,8 +51,7 @@ struct sfc_dp_queue {
         * used on datapath or reap to have more chances to be cache-hot.
         */
        union sfc_pkts_bytes            stats;
-       uint32_t                        rx_dbells;
-       uint32_t                        tx_dbells;
+       uint32_t                        dbells;
 
        uint16_t                        port_id;
        uint16_t                        queue_id;
index 83f5c1ec70e804626af324cc908b3416416acad0..259290f14ae6c5537b11ef85772713a751a3a4a3 100644 (file)
@@ -124,7 +124,7 @@ sfc_ef100_rx_qpush(struct sfc_ef100_rxq *rxq, unsigned int added)
         * operations that follow it (i.e. doorbell write).
         */
        rte_write32(dword.ed_u32[0], rxq->doorbell);
-       rxq->dp.dpq.rx_dbells++;
+       rxq->dp.dpq.dbells++;
 
        sfc_ef100_rx_debug(rxq, "RxQ pushed doorbell at pidx %u (added=%u)",
                           EFX_DWORD_FIELD(dword, ERF_GZ_RX_RING_PIDX),
index c0944df166b9732219cb8183a448ec14d0a6bf8c..b41eddbcca475b3f6b8ed35088a2ded17280e6c5 100644 (file)
@@ -503,7 +503,7 @@ sfc_ef100_tx_qpush(struct sfc_ef100_txq *txq, unsigned int added)
         * operations that follow it (i.e. doorbell write).
         */
        rte_write32(dword.ed_u32[0], txq->doorbell);
-       txq->dp.dpq.tx_dbells++;
+       txq->dp.dpq.dbells++;
 
        sfc_ef100_tx_debug(txq, "TxQ pushed doorbell at pidx %u (added=%u)",
                           EFX_DWORD_FIELD(dword, ERF_GZ_TX_RING_PIDX),
index 67db837afdfb74c9e50f4eec79fa481701762bc2..4f7d7122978a52b228e8abef2b10f28c30dbba3f 100644 (file)
@@ -221,7 +221,7 @@ sfc_ef10_essb_rx_qrefill(struct sfc_ef10_essb_rxq *rxq)
        SFC_ASSERT(rxq->added != added);
        rxq->added = added;
        sfc_ef10_rx_qpush(rxq->doorbell, added, rxq_ptr_mask,
-                         &rxq->dp.dpq.rx_dbells);
+                         &rxq->dp.dpq.dbells);
 }
 
 static bool
index 245f616bc2f556237d7632c1e03ea82f4c91bbb4..8503c3c15f03e25febef07bc7684a0f1ecef8611 100644 (file)
@@ -171,8 +171,7 @@ sfc_ef10_rx_qrefill(struct sfc_ef10_rxq *rxq)
 
        SFC_ASSERT(rxq->added != added);
        rxq->added = added;
-       sfc_ef10_rx_qpush(rxq->doorbell, added, ptr_mask,
-                         &rxq->dp.dpq.rx_dbells);
+       sfc_ef10_rx_qpush(rxq->doorbell, added, ptr_mask, &rxq->dp.dpq.dbells);
 }
 
 static void
index fc829a6f3118cd9a598a09a36bfd54af1c939f66..2463c1423a92f98ea7893804270fe7b6dae386ac 100644 (file)
@@ -248,7 +248,7 @@ sfc_ef10_tx_qpush(struct sfc_ef10_txq *txq, unsigned int added,
        rte_io_wmb();
 
        *(volatile efsys_uint128_t *)txq->doorbell = oword.eo_u128[0];
-       txq->dp.dpq.tx_dbells++;
+       txq->dp.dpq.dbells++;
 }
 
 static unsigned int
index e2be84b27533e93dc909b1f37093f8f27e7e4333..17ff2aa67adf0691d376fbe44c4d0a1904a28f8f 100644 (file)
@@ -139,7 +139,7 @@ sfc_efx_rx_qrefill(struct sfc_efx_rxq *rxq)
        SFC_ASSERT(added != rxq->added);
        rxq->added = added;
        efx_rx_qpush(rxq->common, added, &rxq->pushed);
-       rxq->dp.dpq.rx_dbells++;
+       rxq->dp.dpq.dbells++;
 }
 
 static uint64_t
index 6b3a01b3c6e125b6a9c0a211371858b517848326..70259660c03a2ee3133bccbf149c9f297d4ce81b 100644 (file)
@@ -95,7 +95,7 @@ sfc_get_sw_stat_val_rx_dbells(struct sfc_adapter *sa, uint16_t qid,
        SFC_ASSERT(values_count == 1);
        rxq_info = sfc_rxq_info_by_ethdev_qid(sas, qid);
        values[0] = rxq_info->state & SFC_RXQ_INITIALIZED ?
-                   rxq_info->dp->dpq.rx_dbells : 0;
+                   rxq_info->dp->dpq.dbells : 0;
 }
 
 static sfc_get_sw_stat_val_t sfc_get_sw_stat_val_tx_dbells;
@@ -110,7 +110,7 @@ sfc_get_sw_stat_val_tx_dbells(struct sfc_adapter *sa, uint16_t qid,
        SFC_ASSERT(values_count == 1);
        txq_info = sfc_txq_info_by_ethdev_qid(sas, qid);
        values[0] = txq_info->state & SFC_TXQ_INITIALIZED ?
-                   txq_info->dp->dpq.tx_dbells : 0;
+                   txq_info->dp->dpq.dbells : 0;
 }
 
 /*
index bee0beb94722927f8ea325123bdd403a74efc294..d59a1af3af60bf340895a31f1d203be0bf46da53 100644 (file)
@@ -996,7 +996,7 @@ sfc_efx_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
 
                if (likely(pushed != txq->added)) {
                        efx_tx_qpush(txq->common, txq->added, pushed);
-                       txq->dp.dpq.tx_dbells++;
+                       txq->dp.dpq.dbells++;
                }
        }