From: Stephen Hemminger <stephen@networkplumber.org>
To: dev@dpdk.org
Cc: Stephen Hemminger <stephen@networkplumber.org>,
Jiawen Wu <jiawenwu@trustnetic.com>,
Zaiyu Wang <zaiyuwang@trustnetic.com>
Subject: [RFC 6/7] net/txgbe: remove queue stats mapping
Date: Sat, 30 May 2026 09:10:01 -0700 [thread overview]
Message-ID: <20260530161151.873199-7-stephen@networkplumber.org> (raw)
In-Reply-To: <20260530161151.873199-1-stephen@networkplumber.org>
Support for queue stats mapping has been deprecated since 25.11.
Remove support for this ethdev op in txgbe driver.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
drivers/net/txgbe/txgbe_ethdev.c | 87 +++-----------------------------
drivers/net/txgbe/txgbe_ethdev.h | 13 -----
2 files changed, 7 insertions(+), 93 deletions(-)
diff --git a/drivers/net/txgbe/txgbe_ethdev.c b/drivers/net/txgbe/txgbe_ethdev.c
index 5d360f8305..3886a2cbf4 100644
--- a/drivers/net/txgbe/txgbe_ethdev.c
+++ b/drivers/net/txgbe/txgbe_ethdev.c
@@ -391,60 +391,6 @@ txgbe_disable_intr(struct txgbe_hw *hw)
txgbe_flush(hw);
}
-static int
-txgbe_dev_queue_stats_mapping_set(struct rte_eth_dev *eth_dev,
- uint16_t queue_id,
- uint8_t stat_idx,
- uint8_t is_rx)
-{
- struct txgbe_hw *hw = TXGBE_DEV_HW(eth_dev);
- struct txgbe_stat_mappings *stat_mappings =
- TXGBE_DEV_STAT_MAPPINGS(eth_dev);
- uint32_t qsmr_mask = 0;
- uint32_t clearing_mask = QMAP_FIELD_RESERVED_BITS_MASK;
- uint32_t q_map;
- uint8_t n, offset;
-
- if (!txgbe_is_pf(hw))
- return -ENOSYS;
-
- if (stat_idx & ~QMAP_FIELD_RESERVED_BITS_MASK)
- return -EIO;
-
- PMD_INIT_LOG(DEBUG, "Setting port %d, %s queue_id %d to stat index %d",
- (int)(eth_dev->data->port_id), is_rx ? "RX" : "TX",
- queue_id, stat_idx);
-
- n = (uint8_t)(queue_id / NB_QMAP_FIELDS_PER_QSM_REG);
- if (n >= TXGBE_NB_STAT_MAPPING) {
- PMD_INIT_LOG(ERR, "Nb of stat mapping registers exceeded");
- return -EIO;
- }
- offset = (uint8_t)(queue_id % NB_QMAP_FIELDS_PER_QSM_REG);
-
- /* Now clear any previous stat_idx set */
- clearing_mask <<= (QSM_REG_NB_BITS_PER_QMAP_FIELD * offset);
- if (!is_rx)
- stat_mappings->tqsm[n] &= ~clearing_mask;
- else
- stat_mappings->rqsm[n] &= ~clearing_mask;
-
- q_map = (uint32_t)stat_idx;
- q_map &= QMAP_FIELD_RESERVED_BITS_MASK;
- qsmr_mask = q_map << (QSM_REG_NB_BITS_PER_QMAP_FIELD * offset);
- if (!is_rx)
- stat_mappings->tqsm[n] |= qsmr_mask;
- else
- stat_mappings->rqsm[n] |= qsmr_mask;
-
- PMD_INIT_LOG(DEBUG, "Set port %d, %s queue_id %d to stat index %d",
- (int)(eth_dev->data->port_id), is_rx ? "RX" : "TX",
- queue_id, stat_idx);
- PMD_INIT_LOG(DEBUG, "%s[%d] = 0x%08x", is_rx ? "RQSMR" : "TQSM", n,
- is_rx ? stat_mappings->rqsm[n] : stat_mappings->tqsm[n]);
- return 0;
-}
-
static void
txgbe_dcb_init(struct txgbe_hw *hw, struct txgbe_dcb_config *dcb_config)
{
@@ -2457,10 +2403,8 @@ txgbe_dev_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats,
{
struct txgbe_hw *hw = TXGBE_DEV_HW(dev);
struct txgbe_hw_stats *hw_stats = TXGBE_DEV_STATS(dev);
- struct txgbe_stat_mappings *stat_mappings =
- TXGBE_DEV_STAT_MAPPINGS(dev);
struct txgbe_tx_queue *txq;
- uint32_t i, j;
+ unsigned int i;
txgbe_read_stats_registers(hw, hw_stats);
@@ -2474,29 +2418,13 @@ txgbe_dev_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats,
stats->obytes = hw_stats->tx_bytes;
if (qstats != NULL) {
- memset(&qstats->q_ipackets, 0, sizeof(qstats->q_ipackets));
- memset(&qstats->q_opackets, 0, sizeof(qstats->q_opackets));
- memset(&qstats->q_ibytes, 0, sizeof(qstats->q_ibytes));
- memset(&qstats->q_obytes, 0, sizeof(qstats->q_obytes));
- memset(&qstats->q_errors, 0, sizeof(qstats->q_errors));
for (i = 0; i < TXGBE_MAX_QP; i++) {
- uint32_t n = i / NB_QMAP_FIELDS_PER_QSM_REG;
- uint32_t offset = (i % NB_QMAP_FIELDS_PER_QSM_REG) * 8;
- uint32_t q_map;
-
- q_map = (stat_mappings->rqsm[n] >> offset)
- & QMAP_FIELD_RESERVED_BITS_MASK;
- j = (q_map < RTE_ETHDEV_QUEUE_STAT_CNTRS
- ? q_map : q_map % RTE_ETHDEV_QUEUE_STAT_CNTRS);
- qstats->q_ipackets[j] += hw_stats->qp[i].rx_qp_packets;
- qstats->q_ibytes[j] += hw_stats->qp[i].rx_qp_bytes;
-
- q_map = (stat_mappings->tqsm[n] >> offset)
- & QMAP_FIELD_RESERVED_BITS_MASK;
- j = (q_map < RTE_ETHDEV_QUEUE_STAT_CNTRS
- ? q_map : q_map % RTE_ETHDEV_QUEUE_STAT_CNTRS);
- qstats->q_opackets[j] += hw_stats->qp[i].tx_qp_packets;
- qstats->q_obytes[j] += hw_stats->qp[i].tx_qp_bytes;
+ if (i >= RTE_ETHDEV_QUEUE_STAT_CNTRS)
+ break;
+ qstats->q_ipackets[i] += hw_stats->qp[i].rx_qp_packets;
+ qstats->q_ibytes[i] += hw_stats->qp[i].rx_qp_bytes;
+ qstats->q_opackets[i] += hw_stats->qp[i].tx_qp_packets;
+ qstats->q_obytes[i] += hw_stats->qp[i].tx_qp_bytes;
}
}
@@ -5987,7 +5915,6 @@ static const struct eth_dev_ops txgbe_eth_dev_ops = {
.xstats_reset = txgbe_dev_xstats_reset,
.xstats_get_names = txgbe_dev_xstats_get_names,
.xstats_get_names_by_id = txgbe_dev_xstats_get_names_by_id,
- .queue_stats_mapping_set = txgbe_dev_queue_stats_mapping_set,
.fw_version_get = txgbe_fw_version_get,
.dev_supported_ptypes_get = txgbe_dev_supported_ptypes_get,
.mtu_set = txgbe_dev_mtu_set,
diff --git a/drivers/net/txgbe/txgbe_ethdev.h b/drivers/net/txgbe/txgbe_ethdev.h
index 189fbac541..ac977dfc02 100644
--- a/drivers/net/txgbe/txgbe_ethdev.h
+++ b/drivers/net/txgbe/txgbe_ethdev.h
@@ -153,15 +153,6 @@ struct txgbe_interrupt {
uint64_t mask_orig; /* save mask during delayed handler */
};
-#define TXGBE_NB_STAT_MAPPING 32
-#define QSM_REG_NB_BITS_PER_QMAP_FIELD 8
-#define NB_QMAP_FIELDS_PER_QSM_REG 4
-#define QMAP_FIELD_RESERVED_BITS_MASK 0x0f
-struct txgbe_stat_mappings {
- uint32_t tqsm[TXGBE_NB_STAT_MAPPING];
- uint32_t rqsm[TXGBE_NB_STAT_MAPPING];
-};
-
struct txgbe_vfta {
uint32_t vfta[TXGBE_VFTA_SIZE];
};
@@ -355,7 +346,6 @@ struct txgbe_adapter {
struct rte_eth_fdir_conf fdir_conf;
struct txgbe_hw_fdir_info fdir;
struct txgbe_interrupt intr;
- struct txgbe_stat_mappings stat_mappings;
struct txgbe_vfta shadow_vfta;
struct txgbe_hwstrip hwstrip;
struct txgbe_dcb_config dcb_config;
@@ -398,9 +388,6 @@ struct txgbe_adapter {
#define TXGBE_DEV_FDIR(dev) \
(&((struct txgbe_adapter *)(dev)->data->dev_private)->fdir)
-#define TXGBE_DEV_STAT_MAPPINGS(dev) \
- (&((struct txgbe_adapter *)(dev)->data->dev_private)->stat_mappings)
-
#define TXGBE_DEV_VFTA(dev) \
(&((struct txgbe_adapter *)(dev)->data->dev_private)->shadow_vfta)
--
2.53.0
next prev parent reply other threads:[~2026-05-30 16:12 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-30 16:09 [RFC 0/7] Complete removal of queue stats mapping Stephen Hemminger
2026-05-30 16:09 ` [RFC 1/7] net/virtio: remove unused " Stephen Hemminger
2026-05-30 16:09 ` [RFC 2/7] net/enic: remove queue_stats_mapping ethdev_op Stephen Hemminger
2026-05-30 16:09 ` [RFC 3/7] net/cnxk: remove queue stats mapping Stephen Hemminger
2026-05-30 16:09 ` [RFC 4/7] net/e1000: " Stephen Hemminger
2026-05-30 16:10 ` [RFC 5/7] net/ixgbe: " Stephen Hemminger
2026-05-30 16:10 ` Stephen Hemminger [this message]
2026-05-30 16:10 ` [RFC 7/7] ethdev: remove support for " Stephen Hemminger
2026-06-01 1:56 ` fengchengwen
2026-06-01 8:45 ` Andrew Rybchenko
2026-07-23 20:28 ` [PATCH v2 0/9] Complete removal of " Stephen Hemminger
2026-07-23 20:28 ` [PATCH v2 1/9] net/virtio: remove unused " Stephen Hemminger
2026-07-23 20:28 ` [PATCH v2 2/9] app/testpmd: remove unused function prototype Stephen Hemminger
2026-07-23 20:28 ` [PATCH v2 3/9] net/enic: remove unneeded ops initialization Stephen Hemminger
2026-07-24 1:52 ` Hyong Youb Kim (hyonkim)
2026-07-23 20:28 ` [PATCH v2 4/9] net/cnxk: remove queue stats mapping Stephen Hemminger
2026-07-24 7:26 ` David Marchand
2026-07-24 15:20 ` Stephen Hemminger
2026-07-23 20:28 ` [PATCH v2 5/9] net/e1000: " Stephen Hemminger
2026-07-24 7:31 ` David Marchand
2026-07-23 20:28 ` [PATCH v2 6/9] net/ixgbe: " Stephen Hemminger
2026-07-23 20:28 ` [PATCH v2 7/9] net/txgbe: " Stephen Hemminger
2026-07-23 20:28 ` [PATCH v2 8/9] net/sxe2: " Stephen Hemminger
2026-07-23 20:28 ` [PATCH v2 9/9] ethdev: remove support for " Stephen Hemminger
2026-07-24 7:39 ` [PATCH v2 0/9] Complete removal of " David Marchand
2026-07-24 7:42 ` David Marchand
2026-07-24 15:28 ` Stephen Hemminger
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260530161151.873199-7-stephen@networkplumber.org \
--to=stephen@networkplumber.org \
--cc=dev@dpdk.org \
--cc=jiawenwu@trustnetic.com \
--cc=zaiyuwang@trustnetic.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.