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 C478E45843; Fri, 23 Aug 2024 09:33:43 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 34E1C43260; Fri, 23 Aug 2024 09:33:11 +0200 (CEST) Received: from AS8PR04CU009.outbound.protection.outlook.com (mail-westeuropeazon11011045.outbound.protection.outlook.com [52.101.70.45]) by mails.dpdk.org (Postfix) with ESMTP id 9F24943246 for ; Fri, 23 Aug 2024 09:33:06 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=sPHzJbEwq6Nydmg6G4H/GH8TatneObA6qOeOs1Qn6NBUHohf6VmXjGmJyIHYPU8YyESScFXzWGuzku5+UUj3nLsJQmM8/SnLI52kfpkAruNdu3O8RcOQHw5LhecxPzsExt3OBKgobhwqwCXDucBFLVTxk1u+5hkK6NTnePFUnj85E1umstCerCQJK/UVhs0fa9r6cC7XSZlvp9Ga//Ks+w2N4lElMY0fgzvsCqju7CtYOFLPieDyS8aDRtICXRaC1X2YLwyzAGW7KcNW4+L66EZVgwZckzJJyTII19zK3j4wwlNC1nsYp8vcmxiVoDk2KxU4mwn/EyQCaZb0uHvjlQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=DCkwUhX0Onay0Q4xpiNrYdQS7RUc6RuxFQJUgQV1g7I=; b=kHzvNSJlVRKzOZu84EQHMuUpwLRyMzO58mV+z5IWKWBT9OTYm/Yi6/sTE6jlfdeXQm059isRK8h3QyZLWLciXEXMgmP4y8yo1A4LGxX/Y32U7u/pByGfl4G+/+bf/08Ee+7KbMqKSeQ0zVQics/sM0FpsRNIG9jLKJd/X8c0BYZcqXdiAhXarUF2uP1TQ41KzQdnTBLGPLFB3vcJIe0VdoeUhVRF2PubqnkqZ8CHpQQxZAxUadszQdjA+s4AbJumd7YbwtR9Ll38K0fL8BQNLqL0mCjYZe9DeNoUJF0Fih86LCCmyZXpsCm3gd7TFMjaPCncmsr0VuDEYUjvy5PRlg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=DCkwUhX0Onay0Q4xpiNrYdQS7RUc6RuxFQJUgQV1g7I=; b=YqOgb48AupfGJ4iIiHYgEbrZNQotF53PWLYyhrK/XjxdGgwqaOWYqvIGwJpvy/0Im3qo65kRJJ4yRtcYjYl5EFCCcCEuxPa8TP3hJpp8vfAe5HMzcE8Hny0nroT+XKL9mM+awH8Su0LGEFAUoyROBKcU8xj7VsSxpyTPiqNAUwLFbgzAtR1gWJhz5Q4aA8iuQZFJ5Lq6kxbSQSyZoIq1GaRzAtQfv+NJm1KuIPVp1gMQr9AN3YXBD3SeCuuhcOGGzX3xj4MHIh2TXJhGjYMoYaW3nV2zGHMDLdDKaveFUSsdA3cbGOChY/mxgjv8YvJdREsWsDc1W8Jow+aQ46AajA== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from PAXPR04MB9328.eurprd04.prod.outlook.com (2603:10a6:102:2b6::15) by DBBPR04MB7547.eurprd04.prod.outlook.com (2603:10a6:10:208::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.21; Fri, 23 Aug 2024 07:33:05 +0000 Received: from PAXPR04MB9328.eurprd04.prod.outlook.com ([fe80::367:d59:375:fb87]) by PAXPR04MB9328.eurprd04.prod.outlook.com ([fe80::367:d59:375:fb87%3]) with mapi id 15.20.7875.019; Fri, 23 Aug 2024 07:33:05 +0000 From: Hemant Agrawal To: dev@dpdk.org Cc: ferruh.yigit@intel.com, Gagandeep Singh Subject: [PATCH v2 05/18] bus/dpaa: add port buffer manager stats Date: Fri, 23 Aug 2024 13:02:27 +0530 Message-Id: <20240823073240.3708320-6-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240823073240.3708320-1-hemant.agrawal@nxp.com> References: <20240801105313.630280-1-hemant.agrawal@nxp.com> <20240823073240.3708320-1-hemant.agrawal@nxp.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SG2PR02CA0028.apcprd02.prod.outlook.com (2603:1096:3:18::16) To PAXPR04MB9328.eurprd04.prod.outlook.com (2603:10a6:102:2b6::15) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB9328:EE_|DBBPR04MB7547:EE_ X-MS-Office365-Filtering-Correlation-Id: 8d791d29-8f21-4406-b972-08dcc345d3a3 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|366016|376014|1800799024|52116014|38350700014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?IRKnDnKj1oXwKFKsJDbqGrc93sWI+Bc4DeIc7P+s7ojuT1b/9NxfQbBaXqff?= =?us-ascii?Q?uXmDrnQHR1eLhUNCcXQq7h65Rlq3OFHJaigzSfZiP1YBxDQPX79oS+sqk3cG?= =?us-ascii?Q?hioWVo+wKLks+tbOkpOVb/m+uFveTqcP+TEEHmR8ateDCIZOmVYah7k2xEPt?= =?us-ascii?Q?ew3QWq6yuGF5Jnyr1m3JNS6SlH+kJQE3teF0sIsA2+pPn6OuZnlVXHvg5AJr?= =?us-asc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umDIv9V5ln+Ku?= =?us-ascii?Q?s4wILU+GqE5v1vLDgIFZnehVEh0jWc0DU0+1eeoRpV7zMCV3S8Hw1Y3BKwgF?= =?us-ascii?Q?ELjlG7gTKtRVngQReEr4xPbOytdYDD4iz79gosJ6W0JWshtD14yx4D2ArWwO?= =?us-ascii?Q?h9bI+Z+/IgtUTwd+M4Syejg8DrPUtOMk4erqSiiwaOfK1qBjv5RRnJVEbLYO?= =?us-ascii?Q?R8+3XblUWiKfT2UVDfAksQGKaQ1t93/0LTOSqjxXSbhJFDYoyLuHU5fjHawW?= =?us-ascii?Q?Is4W50Jn0r9A4fLDJ5/W+wHpiUFmonCZefTC8/fokU4n8HKXBw=3D=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PAXPR04MB9328.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(366016)(376014)(1800799024)(52116014)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?G3QzeIQiJnf4csVHjuFN/comac+QI4btk8JNsUjZlPczl2fmJW/JffRT1GXg?= =?us-ascii?Q?NpUADe7IyjG3tboIIjuZ9Hozbl3blSAGVBT1R0ObICt36y4mQ1GvtEt4zxXH?= =?us-ascii?Q?9XzimTvSKNXD26+ptDVQY9zsIdIAnsSgICNBEgd59Kh9xiE5Hlhl3yd7e5Ao?= =?us-ascii?Q?TFOLpneWIUxPaxE0zuV2yeWmixPKVggFMjqj/bdBT8dVE4I71fjkPvYjnHhZ?= =?us-ascii?Q?e34fTT+RoSREhGGNQUHveUWxbiMpo1fkR/e4C4aFrdRSkYfQlsECXgCpqNXC?= =?us-ascii?Q?rKpefc4Zr7ogbBJea13wjbe5BNG7ne0sZwkb+Q4sOLJ3PYVVYAgV17SqBmRe?= =?us-ascii?Q?G22WYRHFYdnPsW4GLF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R?= =?us-ascii?Q?RfDgjDq+KgchGa/Uyc7HmQ6SkyBtqhTVblMPCHqBxQ6POClyXJUmU6GtogYB?= =?us-ascii?Q?x4vk/Em5kl4DynLTY7SAQbUMlkp8jsoJgahNrcPoQDf1cnHgns0+NURZhmE6?= =?us-ascii?Q?hFK8nqqWmPIeXPXHsD0TPa7fIDUG9/qou3gTX1RJAslBsB4dJnSFG/ejfj7I?= =?us-ascii?Q?/IN3I80pFpKzlmUkF9UkmLAziDJ1OuB496axf11PW30AGYnAHCYxwMHYgDXn?= =?us-ascii?Q?47dh8yfTuDCy9EiFrnWiYEhe7Z3WIZb+Ie6ksQu1Gpvw6O9Z5BGsqR5ndyjK?= =?us-ascii?Q?q7SU28pfGKl5XpDzZ5LF2Q/7ygCwOD6WSfyc7Bw82su6IcMK37hObZ4DIm77?= =?us-ascii?Q?RA=3D=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8d791d29-8f21-4406-b972-08dcc345d3a3 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9328.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Aug 2024 07:33:05.3736 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: rL5aBi7VysOwE56QlnKfk1oIhtmKem4/2b8ce8JekZuGCv+j5UisXWttrftd53zuvt08xBCyfH0ho4uHm3vUzg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR04MB7547 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 Add BMI statistics and improving the existing extended statistics Signed-off-by: Hemant Agrawal Signed-off-by: Gagandeep Singh --- drivers/bus/dpaa/base/fman/fman_hw.c | 61 ++++++++++++++++++++++++++++ drivers/bus/dpaa/include/fman.h | 4 +- drivers/bus/dpaa/include/fsl_fman.h | 12 ++++++ drivers/bus/dpaa/version.map | 4 ++ drivers/net/dpaa/dpaa_ethdev.c | 46 ++++++++++++++++++--- drivers/net/dpaa/dpaa_ethdev.h | 12 ++++++ 6 files changed, 132 insertions(+), 7 deletions(-) diff --git a/drivers/bus/dpaa/base/fman/fman_hw.c b/drivers/bus/dpaa/base/fman/fman_hw.c index 97e792806f..124c69edb4 100644 --- a/drivers/bus/dpaa/base/fman/fman_hw.c +++ b/drivers/bus/dpaa/base/fman/fman_hw.c @@ -267,6 +267,67 @@ fman_if_stats_reset(struct fman_if *p) ; } +void +fman_if_bmi_stats_enable(struct fman_if *p) +{ + struct __fman_if *m = container_of(p, struct __fman_if, __if); + struct rx_bmi_regs *regs = (struct rx_bmi_regs *)m->bmi_map; + uint32_t tmp; + + tmp = in_be32(®s->fmbm_rstc); + + tmp |= FMAN_BMI_COUNTERS_EN; + + out_be32(®s->fmbm_rstc, tmp); +} + +void +fman_if_bmi_stats_disable(struct fman_if *p) +{ + struct __fman_if *m = container_of(p, struct __fman_if, __if); + struct rx_bmi_regs *regs = (struct rx_bmi_regs *)m->bmi_map; + uint32_t tmp; + + tmp = in_be32(®s->fmbm_rstc); + + tmp &= ~FMAN_BMI_COUNTERS_EN; + + out_be32(®s->fmbm_rstc, tmp); +} + +void +fman_if_bmi_stats_get_all(struct fman_if *p, uint64_t *value) +{ + struct __fman_if *m = container_of(p, struct __fman_if, __if); + struct rx_bmi_regs *regs = (struct rx_bmi_regs *)m->bmi_map; + int i = 0; + + value[i++] = (u32)in_be32(®s->fmbm_rfrc); + value[i++] = (u32)in_be32(®s->fmbm_rfbc); + value[i++] = (u32)in_be32(®s->fmbm_rlfc); + value[i++] = (u32)in_be32(®s->fmbm_rffc); + value[i++] = (u32)in_be32(®s->fmbm_rfdc); + value[i++] = (u32)in_be32(®s->fmbm_rfldec); + value[i++] = (u32)in_be32(®s->fmbm_rodc); + value[i++] = (u32)in_be32(®s->fmbm_rbdc); +} + +void +fman_if_bmi_stats_reset(struct fman_if *p) +{ + struct __fman_if *m = container_of(p, struct __fman_if, __if); + struct rx_bmi_regs *regs = (struct rx_bmi_regs *)m->bmi_map; + + out_be32(®s->fmbm_rfrc, 0); + out_be32(®s->fmbm_rfbc, 0); + out_be32(®s->fmbm_rlfc, 0); + out_be32(®s->fmbm_rffc, 0); + out_be32(®s->fmbm_rfdc, 0); + out_be32(®s->fmbm_rfldec, 0); + out_be32(®s->fmbm_rodc, 0); + out_be32(®s->fmbm_rbdc, 0); +} + void fman_if_promiscuous_enable(struct fman_if *p) { diff --git a/drivers/bus/dpaa/include/fman.h b/drivers/bus/dpaa/include/fman.h index 3a6dd555a7..60681068ea 100644 --- a/drivers/bus/dpaa/include/fman.h +++ b/drivers/bus/dpaa/include/fman.h @@ -56,6 +56,8 @@ #define FMAN_PORT_BMI_FIFO_UNITS 0x100 #define FMAN_PORT_IC_OFFSET_UNITS 0x10 +#define FMAN_BMI_COUNTERS_EN 0x80000000 + #define FMAN_ENABLE_BPOOL_DEPLETION 0xF00000F0 #define HASH_CTRL_MCAST_EN 0x00000100 @@ -260,7 +262,7 @@ struct rx_bmi_regs { /**< Buffer Manager pool Information-*/ uint32_t fmbm_acnt[FMAN_PORT_MAX_EXT_POOLS_NUM]; /**< Allocate Counter-*/ - uint32_t reserved0130[8]; + uint32_t reserved0120[16]; /**< 0x130/0x140 - 0x15F reserved -*/ uint32_t fmbm_rcgm[FMAN_PORT_CG_MAP_NUM]; /**< Congestion Group Map*/ diff --git a/drivers/bus/dpaa/include/fsl_fman.h b/drivers/bus/dpaa/include/fsl_fman.h index 20690f8329..5a9750ad0c 100644 --- a/drivers/bus/dpaa/include/fsl_fman.h +++ b/drivers/bus/dpaa/include/fsl_fman.h @@ -60,6 +60,18 @@ void fman_if_stats_reset(struct fman_if *p); __rte_internal void fman_if_stats_get_all(struct fman_if *p, uint64_t *value, int n); +__rte_internal +void fman_if_bmi_stats_enable(struct fman_if *p); + +__rte_internal +void fman_if_bmi_stats_disable(struct fman_if *p); + +__rte_internal +void fman_if_bmi_stats_get_all(struct fman_if *p, uint64_t *value); + +__rte_internal +void fman_if_bmi_stats_reset(struct fman_if *p); + /* Set ignore pause option for a specific interface */ void fman_if_set_rx_ignore_pause_frames(struct fman_if *p, bool enable); diff --git a/drivers/bus/dpaa/version.map b/drivers/bus/dpaa/version.map index 3f547f75cf..a17d57632e 100644 --- a/drivers/bus/dpaa/version.map +++ b/drivers/bus/dpaa/version.map @@ -24,6 +24,10 @@ INTERNAL { fman_dealloc_bufs_mask_hi; fman_dealloc_bufs_mask_lo; fman_if_add_mac_addr; + fman_if_bmi_stats_enable; + fman_if_bmi_stats_disable; + fman_if_bmi_stats_get_all; + fman_if_bmi_stats_reset; fman_if_clear_mac_addr; fman_if_disable_rx; fman_if_discard_rx_errors; diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c index 1a2de5240f..90b34e42f2 100644 --- a/drivers/net/dpaa/dpaa_ethdev.c +++ b/drivers/net/dpaa/dpaa_ethdev.c @@ -131,6 +131,22 @@ static const struct rte_dpaa_xstats_name_off dpaa_xstats_strings[] = { offsetof(struct dpaa_if_stats, tvlan)}, {"rx_undersized", offsetof(struct dpaa_if_stats, tund)}, + {"rx_frame_counter", + offsetof(struct dpaa_if_rx_bmi_stats, fmbm_rfrc)}, + {"rx_bad_frames_count", + offsetof(struct dpaa_if_rx_bmi_stats, fmbm_rfbc)}, + {"rx_large_frames_count", + offsetof(struct dpaa_if_rx_bmi_stats, fmbm_rlfc)}, + {"rx_filter_frames_count", + offsetof(struct dpaa_if_rx_bmi_stats, fmbm_rffc)}, + {"rx_frame_discrad_count", + offsetof(struct dpaa_if_rx_bmi_stats, fmbm_rfdc)}, + {"rx_frame_list_dma_err_count", + offsetof(struct dpaa_if_rx_bmi_stats, fmbm_rfldec)}, + {"rx_out_of_buffer_discard ", + offsetof(struct dpaa_if_rx_bmi_stats, fmbm_rodc)}, + {"rx_buf_diallocate", + offsetof(struct dpaa_if_rx_bmi_stats, fmbm_rbdc)}, }; static struct rte_dpaa_driver rte_dpaa_pmd; @@ -430,6 +446,7 @@ static void dpaa_interrupt_handler(void *param) static int dpaa_eth_dev_start(struct rte_eth_dev *dev) { struct dpaa_if *dpaa_intf = dev->data->dev_private; + struct fman_if *fif = dev->process_private; uint16_t i; PMD_INIT_FUNC_TRACE(); @@ -443,7 +460,9 @@ static int dpaa_eth_dev_start(struct rte_eth_dev *dev) else dev->tx_pkt_burst = dpaa_eth_queue_tx; - fman_if_enable_rx(dev->process_private); + fman_if_bmi_stats_enable(fif); + fman_if_bmi_stats_reset(fif); + fman_if_enable_rx(fif); for (i = 0; i < dev->data->nb_rx_queues; i++) dev->data->rx_queue_state[i] = RTE_ETH_QUEUE_STATE_STARTED; @@ -461,8 +480,10 @@ static int dpaa_eth_dev_stop(struct rte_eth_dev *dev) PMD_INIT_FUNC_TRACE(); dev->data->dev_started = 0; - if (!fif->is_shared_mac) + if (!fif->is_shared_mac) { + fman_if_bmi_stats_disable(fif); fman_if_disable_rx(fif); + } dev->tx_pkt_burst = dpaa_eth_tx_drop_all; for (i = 0; i < dev->data->nb_rx_queues; i++) @@ -769,6 +790,7 @@ static int dpaa_eth_stats_reset(struct rte_eth_dev *dev) PMD_INIT_FUNC_TRACE(); fman_if_stats_reset(dev->process_private); + fman_if_bmi_stats_reset(dev->process_private); return 0; } @@ -777,8 +799,9 @@ static int dpaa_dev_xstats_get(struct rte_eth_dev *dev, struct rte_eth_xstat *xstats, unsigned int n) { - unsigned int i = 0, num = RTE_DIM(dpaa_xstats_strings); + unsigned int i = 0, j, num = RTE_DIM(dpaa_xstats_strings); uint64_t values[sizeof(struct dpaa_if_stats) / 8]; + unsigned int bmi_count = sizeof(struct dpaa_if_rx_bmi_stats) / 4; if (n < num) return num; @@ -789,10 +812,16 @@ dpaa_dev_xstats_get(struct rte_eth_dev *dev, struct rte_eth_xstat *xstats, fman_if_stats_get_all(dev->process_private, values, sizeof(struct dpaa_if_stats) / 8); - for (i = 0; i < num; i++) { + for (i = 0; i < num - (bmi_count - 1); i++) { xstats[i].id = i; xstats[i].value = values[dpaa_xstats_strings[i].offset / 8]; } + fman_if_bmi_stats_get_all(dev->process_private, values); + for (j = 0; i < num; i++, j++) { + xstats[i].id = i; + xstats[i].value = values[j]; + } + return i; } @@ -819,8 +848,9 @@ static int dpaa_xstats_get_by_id(struct rte_eth_dev *dev, const uint64_t *ids, uint64_t *values, unsigned int n) { - unsigned int i, stat_cnt = RTE_DIM(dpaa_xstats_strings); + unsigned int i, j, stat_cnt = RTE_DIM(dpaa_xstats_strings); uint64_t values_copy[sizeof(struct dpaa_if_stats) / 8]; + unsigned int bmi_count = sizeof(struct dpaa_if_rx_bmi_stats) / 4; if (!ids) { if (n < stat_cnt) @@ -832,10 +862,14 @@ dpaa_xstats_get_by_id(struct rte_eth_dev *dev, const uint64_t *ids, fman_if_stats_get_all(dev->process_private, values_copy, sizeof(struct dpaa_if_stats) / 8); - for (i = 0; i < stat_cnt; i++) + for (i = 0; i < stat_cnt - (bmi_count - 1); i++) values[i] = values_copy[dpaa_xstats_strings[i].offset / 8]; + fman_if_bmi_stats_get_all(dev->process_private, values); + for (j = 0; i < stat_cnt; i++, j++) + values[i] = values_copy[j]; + return stat_cnt; } diff --git a/drivers/net/dpaa/dpaa_ethdev.h b/drivers/net/dpaa/dpaa_ethdev.h index b6c61b8b6b..261a5a3ca7 100644 --- a/drivers/net/dpaa/dpaa_ethdev.h +++ b/drivers/net/dpaa/dpaa_ethdev.h @@ -212,6 +212,18 @@ dpaa_rx_cb_atomic(void *event, const struct qm_dqrr_entry *dqrr, void **bufs); +struct dpaa_if_rx_bmi_stats { + uint32_t fmbm_rstc; /**< Rx Statistics Counters*/ + uint32_t fmbm_rfrc; /**< Rx Frame Counter*/ + uint32_t fmbm_rfbc; /**< Rx Bad Frames Counter*/ + uint32_t fmbm_rlfc; /**< Rx Large Frames Counter*/ + uint32_t fmbm_rffc; /**< Rx Filter Frames Counter*/ + uint32_t fmbm_rfdc; /**< Rx Frame Discard Counter*/ + uint32_t fmbm_rfldec; /**< Rx Frames List DMA Error Counter*/ + uint32_t fmbm_rodc; /**< Rx Out of Buffers Discard nntr*/ + uint32_t fmbm_rbdc; /**< Rx Buffers Deallocate Counter*/ +}; + /* PMD related logs */ extern int dpaa_logtype_pmd; #define RTE_LOGTYPE_DPAA_PMD dpaa_logtype_pmd -- 2.25.1