diff mbox series

[v2,24/30] bus/dpaa2: add support for hw extra stats API

Message ID 1504860327-18451-25-git-send-email-hemant.agrawal@nxp.com
State New
Headers show
Series NXP DPAA2 PMD updates | expand

Commit Message

Hemant Agrawal Sept. 8, 2017, 8:45 a.m. UTC
Signed-off-by: Hemant Agrawal <hemant.agrawal@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(+)

-- 
2.7.4

Comments

Ferruh Yigit Sept. 15, 2017, 11:38 a.m. UTC | #1
On 9/8/2017 9:45 AM, Hemant Agrawal wrote:
> Signed-off-by: Hemant Agrawal <hemant.agrawal@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 +


This patch, also next one, updates "dpaa" bus, is this by mistake?
"dpaa" not merged yet, and this patchset should be for "dpaa2".

<...>
Hemant Agrawal Sept. 15, 2017, 11:45 a.m. UTC | #2
On 9/15/2017 5:08 PM, Ferruh Yigit wrote:
> On 9/8/2017 9:45 AM, Hemant Agrawal wrote:

>> Signed-off-by: Hemant Agrawal <hemant.agrawal@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 +

>

> This patch, also next one, updates "dpaa" bus, is this by mistake?

> "dpaa" not merged yet, and this patchset should be for "dpaa2".

>

> <...>

>


It was a mistake. I will remove it in next version.
diff mbox series

Patch

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;