Skip to content

Commit 9312150

Browse files
Geetha sowjanyadavem330
authored andcommitted
octeontx2-af: cn10k: mcs: Support for stats collection
Add mailbox messages to return the resource stats to the caller. Stats of SecY, SC and SAs as per the macsec standard, TCAM flow id hits/miss, mailbox to clear the stats are implemented. Signed-off-by: Geetha sowjanya <[email protected]> Signed-off-by: Ankur Dwivedi <[email protected]> Signed-off-by: Sunil Goutham <[email protected]> Signed-off-by: Subbaraya Sundeep <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent bd69476 commit 9312150

File tree

6 files changed

+1048
-0
lines changed

6 files changed

+1048
-0
lines changed

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

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,15 @@ M(MCS_PN_TABLE_WRITE, 0xa009, mcs_pn_table_write, mcs_pn_table_write_req, \
317317
M(MCS_SET_ACTIVE_LMAC, 0xa00a, mcs_set_active_lmac, mcs_set_active_lmac, \
318318
msg_rsp) \
319319
M(MCS_GET_HW_INFO, 0xa00b, mcs_get_hw_info, msg_req, mcs_hw_info) \
320+
M(MCS_GET_FLOWID_STATS, 0xa00c, mcs_get_flowid_stats, mcs_stats_req, \
321+
mcs_flowid_stats) \
322+
M(MCS_GET_SECY_STATS, 0xa00d, mcs_get_secy_stats, mcs_stats_req, \
323+
mcs_secy_stats) \
324+
M(MCS_GET_SC_STATS, 0xa00e, mcs_get_sc_stats, mcs_stats_req, mcs_sc_stats) \
325+
M(MCS_GET_SA_STATS, 0xa00f, mcs_get_sa_stats, mcs_stats_req, mcs_sa_stats) \
326+
M(MCS_GET_PORT_STATS, 0xa010, mcs_get_port_stats, mcs_stats_req, \
327+
mcs_port_stats) \
328+
M(MCS_CLEAR_STATS, 0xa011, mcs_clear_stats, mcs_clear_stats, msg_rsp) \
320329
M(MCS_SET_LMAC_MODE, 0xa013, mcs_set_lmac_mode, mcs_set_lmac_mode, msg_rsp) \
321330
M(MCS_SET_PN_THRESHOLD, 0xa014, mcs_set_pn_threshold, mcs_set_pn_threshold, \
322331
msg_rsp) \
@@ -1973,4 +1982,106 @@ struct mcs_ctrl_pkt_rule_write_req {
19731982
u64 rsvd;
19741983
};
19751984

1985+
struct mcs_stats_req {
1986+
struct mbox_msghdr hdr;
1987+
u8 id;
1988+
u8 mcs_id;
1989+
u8 dir;
1990+
u64 rsvd;
1991+
};
1992+
1993+
struct mcs_flowid_stats {
1994+
struct mbox_msghdr hdr;
1995+
u64 tcam_hit_cnt;
1996+
u64 rsvd;
1997+
};
1998+
1999+
struct mcs_secy_stats {
2000+
struct mbox_msghdr hdr;
2001+
u64 ctl_pkt_bcast_cnt;
2002+
u64 ctl_pkt_mcast_cnt;
2003+
u64 ctl_pkt_ucast_cnt;
2004+
u64 ctl_octet_cnt;
2005+
u64 unctl_pkt_bcast_cnt;
2006+
u64 unctl_pkt_mcast_cnt;
2007+
u64 unctl_pkt_ucast_cnt;
2008+
u64 unctl_octet_cnt;
2009+
/* Valid only for RX */
2010+
u64 octet_decrypted_cnt;
2011+
u64 octet_validated_cnt;
2012+
u64 pkt_port_disabled_cnt;
2013+
u64 pkt_badtag_cnt;
2014+
u64 pkt_nosa_cnt;
2015+
u64 pkt_nosaerror_cnt;
2016+
u64 pkt_tagged_ctl_cnt;
2017+
u64 pkt_untaged_cnt;
2018+
u64 pkt_ctl_cnt; /* CN10K-B */
2019+
u64 pkt_notag_cnt; /* CNF10K-B */
2020+
/* Valid only for TX */
2021+
u64 octet_encrypted_cnt;
2022+
u64 octet_protected_cnt;
2023+
u64 pkt_noactivesa_cnt;
2024+
u64 pkt_toolong_cnt;
2025+
u64 pkt_untagged_cnt;
2026+
u64 rsvd[4];
2027+
};
2028+
2029+
struct mcs_port_stats {
2030+
struct mbox_msghdr hdr;
2031+
u64 tcam_miss_cnt;
2032+
u64 parser_err_cnt;
2033+
u64 preempt_err_cnt; /* CNF10K-B */
2034+
u64 sectag_insert_err_cnt;
2035+
u64 rsvd[4];
2036+
};
2037+
2038+
/* Only for CN10K-B */
2039+
struct mcs_sa_stats {
2040+
struct mbox_msghdr hdr;
2041+
/* RX */
2042+
u64 pkt_invalid_cnt;
2043+
u64 pkt_nosaerror_cnt;
2044+
u64 pkt_notvalid_cnt;
2045+
u64 pkt_ok_cnt;
2046+
u64 pkt_nosa_cnt;
2047+
/* TX */
2048+
u64 pkt_encrypt_cnt;
2049+
u64 pkt_protected_cnt;
2050+
u64 rsvd[4];
2051+
};
2052+
2053+
struct mcs_sc_stats {
2054+
struct mbox_msghdr hdr;
2055+
/* RX */
2056+
u64 hit_cnt;
2057+
u64 pkt_invalid_cnt;
2058+
u64 pkt_late_cnt;
2059+
u64 pkt_notvalid_cnt;
2060+
u64 pkt_unchecked_cnt;
2061+
u64 pkt_delay_cnt; /* CNF10K-B */
2062+
u64 pkt_ok_cnt; /* CNF10K-B */
2063+
u64 octet_decrypt_cnt; /* CN10K-B */
2064+
u64 octet_validate_cnt; /* CN10K-B */
2065+
/* TX */
2066+
u64 pkt_encrypt_cnt;
2067+
u64 pkt_protected_cnt;
2068+
u64 octet_encrypt_cnt; /* CN10K-B */
2069+
u64 octet_protected_cnt; /* CN10K-B */
2070+
u64 rsvd[4];
2071+
};
2072+
2073+
struct mcs_clear_stats {
2074+
struct mbox_msghdr hdr;
2075+
#define MCS_FLOWID_STATS 0
2076+
#define MCS_SECY_STATS 1
2077+
#define MCS_SC_STATS 2
2078+
#define MCS_SA_STATS 3
2079+
#define MCS_PORT_STATS 4
2080+
u8 type; /* FLOWID, SECY, SC, SA, PORT */
2081+
u8 id; /* type = PORT, If id = FF(invalid) port no is derived from pcifunc */
2082+
u8 mcs_id;
2083+
u8 dir;
2084+
u8 all; /* All resources stats mapped to PF are cleared */
2085+
};
2086+
19762087
#endif /* MBOX_H */

0 commit comments

Comments
 (0)