From: Satha Rao <skoteshwar@marvell.com>
Update age drop statistics. Added telemetry statistics for age drops.
Signed-off-by: Satha Rao <skoteshwar@marvell.com>
---
drivers/common/cnxk/cnxk_telemetry_nix.c | 4 ++++
drivers/common/cnxk/hw/nix.h | 2 ++
drivers/common/cnxk/roc_features.h | 6 ++++++
drivers/common/cnxk/roc_nix.h | 2 ++
drivers/common/cnxk/roc_nix_stats.c | 4 ++++
5 files changed, 18 insertions(+)
@@ -680,6 +680,10 @@ nix_sq_ctx(volatile void *qctx, struct plt_tel_data *d)
/* W12 */
CNXK_TEL_DICT_BF_PTR(d, ctx, pkts, w12_);
+ /* W13 */
+ CNXK_TEL_DICT_INT(d, ctx, aged_drop_octs, w13_);
+ CNXK_TEL_DICT_INT(d, ctx, aged_drop_pkts, w13_);
+
/* W14 */
CNXK_TEL_DICT_BF_PTR(d, ctx, drop_octs, w14_);
@@ -363,6 +363,8 @@
#define NIX_LF_SQ_OP_STATUS (0xa30ull)
#define NIX_LF_SQ_OP_DROP_OCTS (0xa40ull)
#define NIX_LF_SQ_OP_DROP_PKTS (0xa50ull)
+#define NIX_LF_SQ_OP_AGE_DROP_OCTS (0xa60ull) /* [CN10K, .) */
+#define NIX_LF_SQ_OP_AGE_DROP_PKTS (0xa70ull) /* [CN10K, .) */
#define NIX_LF_CQ_OP_INT (0xb00ull)
#define NIX_LF_CQ_OP_DOOR (0xb30ull)
#define NIX_LF_CQ_OP_STATUS (0xb40ull)
@@ -47,4 +47,10 @@ roc_feature_nix_has_rxchan_multi_bpid(void)
return true;
return false;
}
+
+static inline bool
+roc_feature_nix_has_age_drop_stats(void)
+{
+ return (roc_model_is_cn10kb() || roc_model_is_cn10ka_b0());
+}
#endif
@@ -293,6 +293,8 @@ struct roc_nix_stats_queue {
uint64_t tx_octs;
uint64_t tx_drop_pkts;
uint64_t tx_drop_octs;
+ uint64_t tx_age_drop_pkts;
+ uint64_t tx_age_drop_octs;
};
};
};
@@ -137,6 +137,10 @@ nix_stat_tx_queue_get(struct nix *nix, uint16_t qid,
qstats->tx_octs = qstat_read(nix, qid, NIX_LF_SQ_OP_OCTS);
qstats->tx_drop_pkts = qstat_read(nix, qid, NIX_LF_SQ_OP_DROP_PKTS);
qstats->tx_drop_octs = qstat_read(nix, qid, NIX_LF_SQ_OP_DROP_OCTS);
+ if (roc_feature_nix_has_age_drop_stats()) {
+ qstats->tx_age_drop_pkts = qstat_read(nix, qid, NIX_LF_SQ_OP_AGE_DROP_PKTS);
+ qstats->tx_age_drop_octs = qstat_read(nix, qid, NIX_LF_SQ_OP_AGE_DROP_OCTS);
+ }
}
static int