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 13917A054F; Tue, 16 Mar 2021 23:22:41 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5E3FC242B25; Tue, 16 Mar 2021 23:20:29 +0100 (CET) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mails.dpdk.org (Postfix) with ESMTP id 48BDF242ABC for ; Tue, 16 Mar 2021 23:20:08 +0100 (CET) IronPort-SDR: y6S/qiXThP5t/TNkLt9OKBIbAu4HXl/nv++jkGio0hros29lIRCKhNcP/mLEC+ON6VhJppJKLj 1d0YFAUwyO3A== X-IronPort-AV: E=McAfee;i="6000,8403,9925"; a="253359292" X-IronPort-AV: E=Sophos;i="5.81,254,1610438400"; d="scan'208";a="253359292" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Mar 2021 15:20:07 -0700 IronPort-SDR: ZZt/HlN3xeBhcGyN42UrX32ZK5nDQXD93Z4SLaE/Wi4JwfgcF/MLE+1lJ1nNhXEI/uE2m3IStl NHGy9JJyNrcQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.81,254,1610438400"; d="scan'208";a="605440372" Received: from txasoft-yocto.an.intel.com ([10.123.72.192]) by fmsmga005.fm.intel.com with ESMTP; 16 Mar 2021 15:20:06 -0700 From: Timothy McDaniel To: dev@dpdk.org Cc: jerinj@marvell.com, harry.van.haaren@intel.com, mdr@ashroe.eu, nhorman@tuxdriver.com, nikhil.rao@intel.com, erik.g.carrillo@intel.com, abhinandan.gujjar@intel.com, pbhagavatula@marvell.com, hemant.agrawal@nxp.com, mattias.ronnblom@ericsson.com, peter.mccarthy@intel.com Date: Tue, 16 Mar 2021 17:18:57 -0500 Message-Id: <20210316221857.2254-26-timothy.mcdaniel@intel.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20210316221857.2254-1-timothy.mcdaniel@intel.com> References: <20210316221857.2254-1-timothy.mcdaniel@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH 25/25] event/dlb2: update xstats for DLB v2.5 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" Add DLB v2.5 specific information such as credit metrics to xstats. Signed-off-by: Timothy McDaniel --- drivers/event/dlb2/dlb2_xstats.c | 41 ++++++++++++++++++++++++++++---- 1 file changed, 37 insertions(+), 4 deletions(-) diff --git a/drivers/event/dlb2/dlb2_xstats.c b/drivers/event/dlb2/dlb2_xstats.c index b62e62060..d4c8d9903 100644 --- a/drivers/event/dlb2/dlb2_xstats.c +++ b/drivers/event/dlb2/dlb2_xstats.c @@ -9,6 +9,7 @@ #include "dlb2_priv.h" #include "dlb2_inline_fns.h" +#include "pf/base/dlb2_regs.h" enum dlb2_xstats_type { /* common to device and port */ @@ -21,6 +22,7 @@ enum dlb2_xstats_type { zero_polls, /**< Call dequeue burst and return 0 */ tx_nospc_ldb_hw_credits, /**< Insufficient LDB h/w credits */ tx_nospc_dir_hw_credits, /**< Insufficient DIR h/w credits */ + tx_nospc_hw_credits, /**< Insufficient h/w credits */ tx_nospc_inflight_max, /**< Reach the new_event_threshold */ tx_nospc_new_event_limit, /**< Insufficient s/w credits */ tx_nospc_inflight_credits, /**< Port has too few s/w credits */ @@ -29,6 +31,7 @@ enum dlb2_xstats_type { inflight_events, ldb_pool_size, dir_pool_size, + pool_size, /* port specific */ tx_new, /**< Send an OP_NEW event */ tx_fwd, /**< Send an OP_FORWARD event */ @@ -129,6 +132,9 @@ dlb2_device_traffic_stat_get(struct dlb2_eventdev *dlb2, case tx_nospc_dir_hw_credits: val += port->stats.traffic.tx_nospc_dir_hw_credits; break; + case tx_nospc_hw_credits: + val += port->stats.traffic.tx_nospc_hw_credits; + break; case tx_nospc_inflight_max: val += port->stats.traffic.tx_nospc_inflight_max; break; @@ -159,6 +165,7 @@ get_dev_stat(struct dlb2_eventdev *dlb2, uint16_t obj_idx __rte_unused, case zero_polls: case tx_nospc_ldb_hw_credits: case tx_nospc_dir_hw_credits: + case tx_nospc_hw_credits: case tx_nospc_inflight_max: case tx_nospc_new_event_limit: case tx_nospc_inflight_credits: @@ -171,6 +178,8 @@ get_dev_stat(struct dlb2_eventdev *dlb2, uint16_t obj_idx __rte_unused, return dlb2->num_ldb_credits; case dir_pool_size: return dlb2->num_dir_credits; + case pool_size: + return dlb2->num_credits; default: return -1; } } @@ -203,6 +212,9 @@ get_port_stat(struct dlb2_eventdev *dlb2, uint16_t obj_idx, case tx_nospc_dir_hw_credits: return ev_port->stats.traffic.tx_nospc_dir_hw_credits; + case tx_nospc_hw_credits: + return ev_port->stats.traffic.tx_nospc_hw_credits; + case tx_nospc_inflight_max: return ev_port->stats.traffic.tx_nospc_inflight_max; @@ -357,6 +369,7 @@ dlb2_xstats_init(struct dlb2_eventdev *dlb2) "zero_polls", "tx_nospc_ldb_hw_credits", "tx_nospc_dir_hw_credits", + "tx_nospc_hw_credits", "tx_nospc_inflight_max", "tx_nospc_new_event_limit", "tx_nospc_inflight_credits", @@ -364,6 +377,7 @@ dlb2_xstats_init(struct dlb2_eventdev *dlb2) "inflight_events", "ldb_pool_size", "dir_pool_size", + "pool_size", }; static const enum dlb2_xstats_type dev_types[] = { rx_ok, @@ -375,6 +389,7 @@ dlb2_xstats_init(struct dlb2_eventdev *dlb2) zero_polls, tx_nospc_ldb_hw_credits, tx_nospc_dir_hw_credits, + tx_nospc_hw_credits, tx_nospc_inflight_max, tx_nospc_new_event_limit, tx_nospc_inflight_credits, @@ -382,6 +397,7 @@ dlb2_xstats_init(struct dlb2_eventdev *dlb2) inflight_events, ldb_pool_size, dir_pool_size, + pool_size, }; /* Note: generated device stats are not allowed to be reset. */ static const uint8_t dev_reset_allowed[] = { @@ -394,6 +410,7 @@ dlb2_xstats_init(struct dlb2_eventdev *dlb2) 0, /* zero_polls */ 0, /* tx_nospc_ldb_hw_credits */ 0, /* tx_nospc_dir_hw_credits */ + 0, /* tx_nospc_hw_credits */ 0, /* tx_nospc_inflight_max */ 0, /* tx_nospc_new_event_limit */ 0, /* tx_nospc_inflight_credits */ @@ -401,6 +418,7 @@ dlb2_xstats_init(struct dlb2_eventdev *dlb2) 0, /* inflight_events */ 0, /* ldb_pool_size */ 0, /* dir_pool_size */ + 0, /* pool_size */ }; static const char * const port_stats[] = { "is_configured", @@ -415,6 +433,7 @@ dlb2_xstats_init(struct dlb2_eventdev *dlb2) "zero_polls", "tx_nospc_ldb_hw_credits", "tx_nospc_dir_hw_credits", + "tx_nospc_hw_credits", "tx_nospc_inflight_max", "tx_nospc_new_event_limit", "tx_nospc_inflight_credits", @@ -448,6 +467,7 @@ dlb2_xstats_init(struct dlb2_eventdev *dlb2) zero_polls, tx_nospc_ldb_hw_credits, tx_nospc_dir_hw_credits, + tx_nospc_hw_credits, tx_nospc_inflight_max, tx_nospc_new_event_limit, tx_nospc_inflight_credits, @@ -481,6 +501,7 @@ dlb2_xstats_init(struct dlb2_eventdev *dlb2) 1, /* zero_polls */ 1, /* tx_nospc_ldb_hw_credits */ 1, /* tx_nospc_dir_hw_credits */ + 1, /* tx_nospc_hw_credits */ 1, /* tx_nospc_inflight_max */ 1, /* tx_nospc_new_event_limit */ 1, /* tx_nospc_inflight_credits */ @@ -935,8 +956,8 @@ dlb2_eventdev_xstats_reset(struct rte_eventdev *dev, break; case RTE_EVENT_DEV_XSTATS_PORT: if (queue_port_id == -1) { - for (i = 0; i < DLB2_MAX_NUM_PORTS(dlb2->version); - i++) { + for (i = 0; + i < DLB2_MAX_NUM_PORTS(dlb2->version); i++) { if (dlb2_xstats_reset_port(dlb2, i, ids, nb_ids)) return -EINVAL; @@ -949,8 +970,8 @@ dlb2_eventdev_xstats_reset(struct rte_eventdev *dev, break; case RTE_EVENT_DEV_XSTATS_QUEUE: if (queue_port_id == -1) { - for (i = 0; i < DLB2_MAX_NUM_QUEUES(dlb2->version); - i++) { + for (i = 0; + i < DLB2_MAX_NUM_QUEUES(dlb2->version); i++) { if (dlb2_xstats_reset_queue(dlb2, i, ids, nb_ids)) return -EINVAL; @@ -1048,6 +1069,9 @@ dlb2_eventdev_dump(struct rte_eventdev *dev, FILE *f) fprintf(f, "\tnum_dir_credits = %u\n", dlb2->hw_rsrc_query_results.num_dir_credits); + fprintf(f, "\tnum_credits = %u\n", + dlb2->hw_rsrc_query_results.num_credits); + /* Port level information */ for (i = 0; i < dlb2->num_ports; i++) { @@ -1102,6 +1126,12 @@ dlb2_eventdev_dump(struct rte_eventdev *dev, FILE *f) fprintf(f, "\tdir_credits = %u\n", p->qm_port.dir_credits); + fprintf(f, "\tcached_credits = %u\n", + p->qm_port.cached_credits); + + fprintf(f, "\tdir_credits = %u\n", + p->qm_port.credits); + fprintf(f, "\tgenbit=%d, cq_idx=%d, cq_depth=%d\n", p->qm_port.gen_bit, p->qm_port.cq_idx, @@ -1139,6 +1169,9 @@ dlb2_eventdev_dump(struct rte_eventdev *dev, FILE *f) fprintf(f, "\t\ttx_nospc_dir_hw_credits %" PRIu64 "\n", p->stats.traffic.tx_nospc_dir_hw_credits); + fprintf(f, "\t\ttx_nospc_hw_credits %" PRIu64 "\n", + p->stats.traffic.tx_nospc_hw_credits); + fprintf(f, "\t\ttx_nospc_inflight_max %" PRIu64 "\n", p->stats.traffic.tx_nospc_inflight_max); -- 2.23.0