From patchwork Wed May 24 10:03:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nithin Dabilpuram X-Patchwork-Id: 127295 X-Patchwork-Delegate: jerinj@marvell.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 0D4A542B8C; Wed, 24 May 2023 12:05:39 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id AB15842D88; Wed, 24 May 2023 12:04:44 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id 2E73D42D6C for ; Wed, 24 May 2023 12:04:43 +0200 (CEST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 34O8F53i028158 for ; Wed, 24 May 2023 03:04:42 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=pfpt0220; bh=GiWDkVGqXr1djwwuHwXqbhBeFNhAu2LyoER252C6Q5U=; b=kRpDZeEGblPG8Uzb2zQbqo3EZYdu/PeP7OnXZrhZcAz5LoYvfOFPrnzfzOe0NF80zt6E 75dRpvJzbZr9l8ciexhS5hdt2pC/cr+MOxl2wTSxYgRmbqQgtx6/bsuKwG3AmZoK9u/b SbgGX7P0CA/J5gXTAPamsTBiPa/l36jgGMUJUjIbpUvC1UhHqVs6rDPEDZxthHc3kFxy prfZEss0FtI8AMrKbQ+uinNNnNxGSjfeC53TG/+PBTAPJ0ry8VHM8mOxQ7tENd9KgpK7 NeKud/hZsjV6wEsLsevvWAeDQstfSwQc/qyUcTCkEgLl1qWHkntu0RNk0NK2mhdlx1bQ Tg== Received: from dc5-exch01.marvell.com ([199.233.59.181]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3qpwqk5djk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Wed, 24 May 2023 03:04:42 -0700 Received: from DC5-EXCH01.marvell.com (10.69.176.38) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.48; Wed, 24 May 2023 03:04:40 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server id 15.0.1497.48 via Frontend Transport; Wed, 24 May 2023 03:04:40 -0700 Received: from hyd1588t430.caveonetworks.com (unknown [10.29.52.204]) by maili.marvell.com (Postfix) with ESMTP id 023113F7074; Wed, 24 May 2023 03:04:37 -0700 (PDT) From: Nithin Dabilpuram To: Nithin Kumar Dabilpuram , Kiran Kumar K , Sunil Kumar Kori , Satha Rao CC: , Subject: [PATCH v2 09/32] common/cnxk: update age drop statistics Date: Wed, 24 May 2023 15:33:44 +0530 Message-ID: <20230524100407.3796139-9-ndabilpuram@marvell.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230524100407.3796139-1-ndabilpuram@marvell.com> References: <20230411091144.1087887-1-ndabilpuram@marvell.com> <20230524100407.3796139-1-ndabilpuram@marvell.com> MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: CMKEmf6-ruGEcsRUZL88LYFXNkozYd9z X-Proofpoint-GUID: CMKEmf6-ruGEcsRUZL88LYFXNkozYd9z X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.573,FMLib:17.11.176.26 definitions=2023-05-24_05,2023-05-23_02,2023-05-22_02 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 From: Satha Rao Update age drop statistics. Added telemetry statistics for age drops. Signed-off-by: Satha Rao --- 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(+) diff --git a/drivers/common/cnxk/cnxk_telemetry_nix.c b/drivers/common/cnxk/cnxk_telemetry_nix.c index b7285cf137..ccae5d7853 100644 --- a/drivers/common/cnxk/cnxk_telemetry_nix.c +++ b/drivers/common/cnxk/cnxk_telemetry_nix.c @@ -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_); diff --git a/drivers/common/cnxk/hw/nix.h b/drivers/common/cnxk/hw/nix.h index 0d8f2a5e9b..fbdf1b64f6 100644 --- a/drivers/common/cnxk/hw/nix.h +++ b/drivers/common/cnxk/hw/nix.h @@ -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) diff --git a/drivers/common/cnxk/roc_features.h b/drivers/common/cnxk/roc_features.h index c2893faa65..6fe01015d8 100644 --- a/drivers/common/cnxk/roc_features.h +++ b/drivers/common/cnxk/roc_features.h @@ -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 diff --git a/drivers/common/cnxk/roc_nix.h b/drivers/common/cnxk/roc_nix.h index 2b576f0891..f84e473db6 100644 --- a/drivers/common/cnxk/roc_nix.h +++ b/drivers/common/cnxk/roc_nix.h @@ -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; }; }; }; diff --git a/drivers/common/cnxk/roc_nix_stats.c b/drivers/common/cnxk/roc_nix_stats.c index ca0e8ccb4f..1e93191a07 100644 --- a/drivers/common/cnxk/roc_nix_stats.c +++ b/drivers/common/cnxk/roc_nix_stats.c @@ -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