[dpdk-dev] [PATCH v2 24/30] bus/dpaa2: add support for hw extra stats API
Hemant Agrawal
hemant.agrawal at nxp.com
Fri Sep 8 10:45:21 CEST 2017
Signed-off-by: Hemant Agrawal <hemant.agrawal at nxp.com>
---
drivers/bus/dpaa/base/fman/fman_hw.c | 30 ++++++++++++++++++++++++++++++
drivers/bus/dpaa/include/fsl_fman.h | 3 +++
drivers/bus/dpaa/rte_bus_dpaa_version.map | 1 +
3 files changed, 34 insertions(+)
diff --git a/drivers/bus/dpaa/base/fman/fman_hw.c b/drivers/bus/dpaa/base/fman/fman_hw.c
index be59858..90ded59 100644
--- a/drivers/bus/dpaa/base/fman/fman_hw.c
+++ b/drivers/bus/dpaa/base/fman/fman_hw.c
@@ -234,6 +234,36 @@ fman_if_stats_get(struct fman_if *p, struct rte_eth_stats *stats)
}
void
+fman_if_stats_get_all(struct fman_if *p, uint64_t *value, int n)
+{
+ struct __fman_if *m = container_of(p, struct __fman_if, __if);
+ struct memac_regs *regs = m->ccsr_map;
+ int i;
+ uint64_t base_offset = offsetof(struct memac_regs, reoct_l);
+
+ for (i = 0; i < n; i++)
+ value[i] = ((u64)in_be32((char *)regs
+ + base_offset + 8 * i + 4)) << 32 |
+ ((u64)in_be32((char *)regs
+ + base_offset + 8 * i));
+}
+
+void
+fman_if_stats_get_all(struct fman_if *p, uint64_t *value, int n)
+{
+ struct __fman_if *m = container_of(p, struct __fman_if, __if);
+ struct memac_regs *regs = m->ccsr_map;
+ int i;
+ uint64_t base_offset = offsetof(struct memac_regs, reoct_l);
+
+ for (i = 0; i < n; i++)
+ value[i] = ((u64)in_be32((char *)regs
+ + base_offset + 8 * i + 4)) << 32 |
+ ((u64)in_be32((char *)regs
+ + base_offset + 8 * i));
+}
+
+void
fman_if_stats_reset(struct fman_if *p)
{
struct __fman_if *m = container_of(p, struct __fman_if, __if);
diff --git a/drivers/bus/dpaa/include/fsl_fman.h b/drivers/bus/dpaa/include/fsl_fman.h
index 421a581..9eeb3cd 100644
--- a/drivers/bus/dpaa/include/fsl_fman.h
+++ b/drivers/bus/dpaa/include/fsl_fman.h
@@ -87,6 +87,9 @@ void fman_if_stats_get(struct fman_if *p, struct rte_eth_stats *stats);
/* Reset the FMAN statistics */
void fman_if_stats_reset(struct fman_if *p);
+/* Get all of the FMAN statistics */
+void fman_if_stats_get_all(struct fman_if *p, uint64_t *value, int n);
+
/* 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/rte_bus_dpaa_version.map b/drivers/bus/dpaa/rte_bus_dpaa_version.map
index f231231..a8ac56d 100644
--- a/drivers/bus/dpaa/rte_bus_dpaa_version.map
+++ b/drivers/bus/dpaa/rte_bus_dpaa_version.map
@@ -30,6 +30,7 @@ DPDK_17.11 {
fman_if_set_maxfrm;
fman_if_set_mcast_filter_table;
fman_if_stats_get;
+ fman_if_stats_get_all;
fman_if_stats_reset;
netcfg_acquire;
netcfg_release;
--
2.7.4
More information about the dev
mailing list