Commit 54289aad authored by Ionut-robert Aron's avatar Ionut-robert Aron Committed by Greg Kroah-Hartman

staging: dpaa2-switch: export the 'no buffer' counter in ethtool

Export the DPSW_CNT_ING_NO_BUFFER_DISCARD counter in ethtool for each
switch interface. This is useful for debugging purposes.
Signed-off-by: default avatarIonut-robert Aron <ionut-robert.aron@nxp.com>
Signed-off-by: default avatarIoana Ciornei <ioana.ciornei@nxp.com>
Link: https://lore.kernel.org/r/20201119165017.806696-2-ciorneiioana@gmail.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 8a3f7b96
/* SPDX-License-Identifier: GPL-2.0 */ /* SPDX-License-Identifier: GPL-2.0 */
/* /*
* Copyright 2014-2016 Freescale Semiconductor Inc. * Copyright 2014-2016 Freescale Semiconductor Inc.
* Copyright 2017-2018 NXP * Copyright 2017-2020 NXP
* *
*/ */
...@@ -10,12 +10,14 @@ ...@@ -10,12 +10,14 @@
/* DPSW Version */ /* DPSW Version */
#define DPSW_VER_MAJOR 8 #define DPSW_VER_MAJOR 8
#define DPSW_VER_MINOR 1 #define DPSW_VER_MINOR 5
#define DPSW_CMD_BASE_VERSION 1 #define DPSW_CMD_BASE_VERSION 1
#define DPSW_CMD_VERSION_2 2
#define DPSW_CMD_ID_OFFSET 4 #define DPSW_CMD_ID_OFFSET 4
#define DPSW_CMD_ID(id) (((id) << DPSW_CMD_ID_OFFSET) | DPSW_CMD_BASE_VERSION) #define DPSW_CMD_ID(id) (((id) << DPSW_CMD_ID_OFFSET) | DPSW_CMD_BASE_VERSION)
#define DPSW_CMD_V2(id) (((id) << DPSW_CMD_ID_OFFSET) | DPSW_CMD_VERSION_2)
/* Command IDs */ /* Command IDs */
#define DPSW_CMDID_CLOSE DPSW_CMD_ID(0x800) #define DPSW_CMDID_CLOSE DPSW_CMD_ID(0x800)
...@@ -38,7 +40,7 @@ ...@@ -38,7 +40,7 @@
#define DPSW_CMDID_IF_SET_TCI DPSW_CMD_ID(0x030) #define DPSW_CMDID_IF_SET_TCI DPSW_CMD_ID(0x030)
#define DPSW_CMDID_IF_SET_STP DPSW_CMD_ID(0x031) #define DPSW_CMDID_IF_SET_STP DPSW_CMD_ID(0x031)
#define DPSW_CMDID_IF_GET_COUNTER DPSW_CMD_ID(0x034) #define DPSW_CMDID_IF_GET_COUNTER DPSW_CMD_V2(0x034)
#define DPSW_CMDID_IF_ENABLE DPSW_CMD_ID(0x03D) #define DPSW_CMDID_IF_ENABLE DPSW_CMD_ID(0x03D)
#define DPSW_CMDID_IF_DISABLE DPSW_CMD_ID(0x03E) #define DPSW_CMDID_IF_DISABLE DPSW_CMD_ID(0x03E)
......
...@@ -334,9 +334,10 @@ enum dpsw_accepted_frames { ...@@ -334,9 +334,10 @@ enum dpsw_accepted_frames {
* @DPSW_CNT_ING_BCAST_FRAME: Counts ingress broadcast frames * @DPSW_CNT_ING_BCAST_FRAME: Counts ingress broadcast frames
* @DPSW_CNT_ING_BCAST_BYTES: Counts ingress broadcast bytes * @DPSW_CNT_ING_BCAST_BYTES: Counts ingress broadcast bytes
* @DPSW_CNT_EGR_FRAME: Counts egress frames * @DPSW_CNT_EGR_FRAME: Counts egress frames
* @DPSW_CNT_EGR_BYTE: Counts eEgress bytes * @DPSW_CNT_EGR_BYTE: Counts egress bytes
* @DPSW_CNT_EGR_FRAME_DISCARD: Counts discarded egress frames * @DPSW_CNT_EGR_FRAME_DISCARD: Counts discarded egress frames
* @DPSW_CNT_EGR_STP_FRAME_DISCARD: Counts egress STP discarded frames * @DPSW_CNT_EGR_STP_FRAME_DISCARD: Counts egress STP discarded frames
* @DPSW_CNT_ING_NO_BUFF_DISCARD: Counts ingress no buffer discarded frames
*/ */
enum dpsw_counter { enum dpsw_counter {
DPSW_CNT_ING_FRAME = 0x0, DPSW_CNT_ING_FRAME = 0x0,
...@@ -350,7 +351,8 @@ enum dpsw_counter { ...@@ -350,7 +351,8 @@ enum dpsw_counter {
DPSW_CNT_EGR_FRAME = 0x8, DPSW_CNT_EGR_FRAME = 0x8,
DPSW_CNT_EGR_BYTE = 0x9, DPSW_CNT_EGR_BYTE = 0x9,
DPSW_CNT_EGR_FRAME_DISCARD = 0xa, DPSW_CNT_EGR_FRAME_DISCARD = 0xa,
DPSW_CNT_EGR_STP_FRAME_DISCARD = 0xb DPSW_CNT_EGR_STP_FRAME_DISCARD = 0xb,
DPSW_CNT_ING_NO_BUFF_DISCARD = 0xc,
}; };
int dpsw_if_get_counter(struct fsl_mc_io *mc_io, int dpsw_if_get_counter(struct fsl_mc_io *mc_io,
......
...@@ -24,7 +24,7 @@ static struct { ...@@ -24,7 +24,7 @@ static struct {
{DPSW_CNT_EGR_FRAME, "tx frames"}, {DPSW_CNT_EGR_FRAME, "tx frames"},
{DPSW_CNT_EGR_BYTE, "tx bytes"}, {DPSW_CNT_EGR_BYTE, "tx bytes"},
{DPSW_CNT_EGR_FRAME_DISCARD, "tx discarded frames"}, {DPSW_CNT_EGR_FRAME_DISCARD, "tx discarded frames"},
{DPSW_CNT_ING_NO_BUFF_DISCARD, "rx discarded no buffer frames"},
}; };
#define DPAA2_SWITCH_NUM_COUNTERS ARRAY_SIZE(dpaa2_switch_ethtool_counters) #define DPAA2_SWITCH_NUM_COUNTERS ARRAY_SIZE(dpaa2_switch_ethtool_counters)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment