From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id AA4D9A0C4E; Tue, 2 Nov 2021 14:13:51 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 73B4E4069F; Tue, 2 Nov 2021 14:13:51 +0100 (CET) Received: from shelob.oktetlabs.ru (shelob.oktetlabs.ru [91.220.146.113]) by mails.dpdk.org (Postfix) with ESMTP id 5FCAA4068F for ; Tue, 2 Nov 2021 14:13:49 +0100 (CET) Received: by shelob.oktetlabs.ru (Postfix, from userid 122) id 034617F70A; Tue, 2 Nov 2021 16:13:48 +0300 (MSK) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on shelob.oktetlabs.ru X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=ALL_TRUSTED, DKIM_ADSP_DISCARD, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.2 Received: from aros.oktetlabs.ru (aros.oktetlabs.ru [192.168.38.17]) by shelob.oktetlabs.ru (Postfix) with ESMTP id 42AC27F4E2 for ; Tue, 2 Nov 2021 16:13:44 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 shelob.oktetlabs.ru 42AC27F4E2 Authentication-Results: shelob.oktetlabs.ru/42AC27F4E2; dkim=none; dkim-atps=neutral From: Andrew Rybchenko To: dev@dpdk.org Date: Tue, 2 Nov 2021 16:13:40 +0300 Message-Id: <20211102131340.3927913-1-andrew.rybchenko@oktetlabs.ru> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH] net/sfc: merge Rx and Tx doorbell counters into one X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 --- drivers/net/sfc/sfc_dp.h | 3 +-- drivers/net/sfc/sfc_ef100_rx.c | 2 +- drivers/net/sfc/sfc_ef100_tx.c | 2 +- drivers/net/sfc/sfc_ef10_essb_rx.c | 2 +- drivers/net/sfc/sfc_ef10_rx.c | 3 +-- drivers/net/sfc/sfc_ef10_tx.c | 2 +- drivers/net/sfc/sfc_rx.c | 2 +- drivers/net/sfc/sfc_sw_stats.c | 4 ++-- drivers/net/sfc/sfc_tx.c | 2 +- 9 files changed, 10 insertions(+), 12 deletions(-) diff --git a/drivers/net/sfc/sfc_dp.h b/drivers/net/sfc/sfc_dp.h index 994116e480..c302a5cc13 100644 --- a/drivers/net/sfc/sfc_dp.h +++ b/drivers/net/sfc/sfc_dp.h @@ -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; diff --git a/drivers/net/sfc/sfc_ef100_rx.c b/drivers/net/sfc/sfc_ef100_rx.c index 83f5c1ec70..259290f14a 100644 --- a/drivers/net/sfc/sfc_ef100_rx.c +++ b/drivers/net/sfc/sfc_ef100_rx.c @@ -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), diff --git a/drivers/net/sfc/sfc_ef100_tx.c b/drivers/net/sfc/sfc_ef100_tx.c index c0944df166..b41eddbcca 100644 --- a/drivers/net/sfc/sfc_ef100_tx.c +++ b/drivers/net/sfc/sfc_ef100_tx.c @@ -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), diff --git a/drivers/net/sfc/sfc_ef10_essb_rx.c b/drivers/net/sfc/sfc_ef10_essb_rx.c index 67db837afd..4f7d712297 100644 --- a/drivers/net/sfc/sfc_ef10_essb_rx.c +++ b/drivers/net/sfc/sfc_ef10_essb_rx.c @@ -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 diff --git a/drivers/net/sfc/sfc_ef10_rx.c b/drivers/net/sfc/sfc_ef10_rx.c index 245f616bc2..8503c3c15f 100644 --- a/drivers/net/sfc/sfc_ef10_rx.c +++ b/drivers/net/sfc/sfc_ef10_rx.c @@ -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 diff --git a/drivers/net/sfc/sfc_ef10_tx.c b/drivers/net/sfc/sfc_ef10_tx.c index fc829a6f31..2463c1423a 100644 --- a/drivers/net/sfc/sfc_ef10_tx.c +++ b/drivers/net/sfc/sfc_ef10_tx.c @@ -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 diff --git a/drivers/net/sfc/sfc_rx.c b/drivers/net/sfc/sfc_rx.c index e2be84b275..17ff2aa67a 100644 --- a/drivers/net/sfc/sfc_rx.c +++ b/drivers/net/sfc/sfc_rx.c @@ -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 diff --git a/drivers/net/sfc/sfc_sw_stats.c b/drivers/net/sfc/sfc_sw_stats.c index 6b3a01b3c6..70259660c0 100644 --- a/drivers/net/sfc/sfc_sw_stats.c +++ b/drivers/net/sfc/sfc_sw_stats.c @@ -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; } /* diff --git a/drivers/net/sfc/sfc_tx.c b/drivers/net/sfc/sfc_tx.c index bee0beb947..d59a1af3af 100644 --- a/drivers/net/sfc/sfc_tx.c +++ b/drivers/net/sfc/sfc_tx.c @@ -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++; } } -- 2.30.2