xref: /dpdk/drivers/net/octeontx/octeontx_stats.h (revision c6b97d678699d194b54e1833e5e1c5e01ebdeca6)
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(C) 2022 Marvell.
3  */
4 
5 #ifndef __OCTEONTX_STATS_H__
6 #define __OCTEONTX_STATS_H__
7 
8 #define BGX_XSTAT(stat) \
9 	{#stat, offsetof(octeontx_mbox_bgx_port_stats_t, stat)}
10 struct octeontx_xstats {
11 	char sname[RTE_ETH_XSTATS_NAME_SIZE];
12 	uint32_t soffset;
13 };
14 
15 struct octeontx_xstats octeontx_bgx_xstats[] = {
16 	BGX_XSTAT(rx_packets),
17 	BGX_XSTAT(tx_packets),
18 	BGX_XSTAT(rx_broadcast_packets),
19 	BGX_XSTAT(multicast),
20 	BGX_XSTAT(tx_multicast_packets),
21 	BGX_XSTAT(tx_broadcast_packets),
22 	BGX_XSTAT(rx_undersized_errors),
23 	BGX_XSTAT(rx_oversize_errors),
24 	BGX_XSTAT(rx_jabber_errors),
25 	BGX_XSTAT(rx_crc_errors),
26 	BGX_XSTAT(collisions),
27 	BGX_XSTAT(tx_1_to_64_packets),
28 	BGX_XSTAT(tx_65_to_127_packets),
29 	BGX_XSTAT(tx_128_to_255_packets),
30 	BGX_XSTAT(tx_256_to_511_packets),
31 	BGX_XSTAT(tx_512_to_1023_packets),
32 	BGX_XSTAT(tx_1024_to_1522_packets),
33 	BGX_XSTAT(tx_1523_to_max_packets),
34 	BGX_XSTAT(rx_fragmented_errors),
35 	BGX_XSTAT(rx_pause_packets),
36 	BGX_XSTAT(tx_pause_packets),
37 };
38 
39 #define NUM_BGX_XSTAT \
40 	(sizeof(octeontx_bgx_xstats) / sizeof(struct octeontx_xstats))
41 #endif /* __OCTEONTX_STATS_H__ */
42