Skip to content

Commit 3ba98a8

Browse files
Geetha sowjanyaPaolo Abeni
authored andcommitted
octeontx2-af: Fix mcs stats register address
This patch adds the miss mcs stats register for mcs supported platforms. Fixes: 9312150 ("octeontx2-af: cn10k: mcs: Support for stats collection") Signed-off-by: Geetha sowjanya <[email protected]> Reviewed-by: Wojciech Drewek <[email protected]> Signed-off-by: Paolo Abeni <[email protected]>
1 parent 9723b2c commit 3ba98a8

File tree

2 files changed

+29
-6
lines changed

2 files changed

+29
-6
lines changed

drivers/net/ethernet/marvell/octeontx2/af/mcs.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ void mcs_get_rx_secy_stats(struct mcs *mcs, struct mcs_secy_stats *stats, int id
117117
reg = MCSX_CSE_RX_MEM_SLAVE_INPKTSSECYTAGGEDCTLX(id);
118118
stats->pkt_tagged_ctl_cnt = mcs_reg_read(mcs, reg);
119119

120-
reg = MCSX_CSE_RX_MEM_SLAVE_INPKTSSECYUNTAGGEDORNOTAGX(id);
120+
reg = MCSX_CSE_RX_MEM_SLAVE_INPKTSSECYUNTAGGEDX(id);
121121
stats->pkt_untaged_cnt = mcs_reg_read(mcs, reg);
122122

123123
reg = MCSX_CSE_RX_MEM_SLAVE_INPKTSSECYCTLX(id);
@@ -215,7 +215,7 @@ void mcs_get_sc_stats(struct mcs *mcs, struct mcs_sc_stats *stats,
215215
reg = MCSX_CSE_RX_MEM_SLAVE_INPKTSSCNOTVALIDX(id);
216216
stats->pkt_notvalid_cnt = mcs_reg_read(mcs, reg);
217217

218-
reg = MCSX_CSE_RX_MEM_SLAVE_INPKTSSCUNCHECKEDOROKX(id);
218+
reg = MCSX_CSE_RX_MEM_SLAVE_INPKTSSCUNCHECKEDX(id);
219219
stats->pkt_unchecked_cnt = mcs_reg_read(mcs, reg);
220220

221221
if (mcs->hw->mcs_blks > 1) {

drivers/net/ethernet/marvell/octeontx2/af/mcs_reg.h

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -810,14 +810,37 @@
810810
offset = 0x9d8ull; \
811811
offset; })
812812

813+
#define MCSX_CSE_RX_MEM_SLAVE_INPKTSSCUNCHECKEDX(a) ({ \
814+
u64 offset; \
815+
\
816+
offset = 0xee80ull; \
817+
if (mcs->hw->mcs_blks > 1) \
818+
offset = 0xe818ull; \
819+
offset += (a) * 0x8ull; \
820+
offset; })
821+
822+
#define MCSX_CSE_RX_MEM_SLAVE_INPKTSSECYUNTAGGEDX(a) ({ \
823+
u64 offset; \
824+
\
825+
offset = 0xa680ull; \
826+
if (mcs->hw->mcs_blks > 1) \
827+
offset = 0xd018ull; \
828+
offset += (a) * 0x8ull; \
829+
offset; })
830+
831+
#define MCSX_CSE_RX_MEM_SLAVE_INPKTSSCLATEORDELAYEDX(a) ({ \
832+
u64 offset; \
833+
\
834+
offset = 0xf680ull; \
835+
if (mcs->hw->mcs_blks > 1) \
836+
offset = 0xe018ull; \
837+
offset += (a) * 0x8ull; \
838+
offset; })
839+
813840
#define MCSX_CSE_RX_MEM_SLAVE_INOCTETSSCDECRYPTEDX(a) (0xe680ull + (a) * 0x8ull)
814841
#define MCSX_CSE_RX_MEM_SLAVE_INOCTETSSCVALIDATEX(a) (0xde80ull + (a) * 0x8ull)
815-
#define MCSX_CSE_RX_MEM_SLAVE_INPKTSSECYUNTAGGEDORNOTAGX(a) (0xa680ull + (a) * 0x8ull)
816842
#define MCSX_CSE_RX_MEM_SLAVE_INPKTSSECYNOTAGX(a) (0xd218 + (a) * 0x8ull)
817-
#define MCSX_CSE_RX_MEM_SLAVE_INPKTSSECYUNTAGGEDX(a) (0xd018ull + (a) * 0x8ull)
818-
#define MCSX_CSE_RX_MEM_SLAVE_INPKTSSCUNCHECKEDOROKX(a) (0xee80ull + (a) * 0x8ull)
819843
#define MCSX_CSE_RX_MEM_SLAVE_INPKTSSECYCTLX(a) (0xb680ull + (a) * 0x8ull)
820-
#define MCSX_CSE_RX_MEM_SLAVE_INPKTSSCLATEORDELAYEDX(a) (0xf680ull + (a) * 0x8ull)
821844
#define MCSX_CSE_RX_MEM_SLAVE_INPKTSSAINVALIDX(a) (0x12680ull + (a) * 0x8ull)
822845
#define MCSX_CSE_RX_MEM_SLAVE_INPKTSSANOTUSINGSAERRORX(a) (0x15680ull + (a) * 0x8ull)
823846
#define MCSX_CSE_RX_MEM_SLAVE_INPKTSSANOTVALIDX(a) (0x13680ull + (a) * 0x8ull)

0 commit comments

Comments
 (0)