xref: /linux/drivers/net/ethernet/sfc/mae_counter_format.h (revision 7ae9fb1b7ecbb5d85d07857943f677fd1a559b18)
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /****************************************************************************
3  * Driver for Solarflare network controllers and boards
4  * Copyright 2020 Xilinx, Inc.
5  *
6  * This program is free software; you can redistribute it and/or modify it
7  * under the terms of the GNU General Public License version 2 as published
8  * by the Free Software Foundation, incorporated herein by reference.
9  */
10 
11 /* Format of counter packets (version 2) from the ef100 Match-Action Engine */
12 
13 #ifndef EFX_MAE_COUNTER_FORMAT_H
14 #define EFX_MAE_COUNTER_FORMAT_H
15 
16 
17 /*------------------------------------------------------------*/
18 /*
19  * ER_RX_SL_PACKETISER_HEADER_WORD(160bit):
20  *
21  */
22 #define ER_RX_SL_PACKETISER_HEADER_WORD_SIZE 20
23 #define ER_RX_SL_PACKETISER_HEADER_WORD_WIDTH 160
24 
25 #define ERF_SC_PACKETISER_HEADER_VERSION_LBN 0
26 #define ERF_SC_PACKETISER_HEADER_VERSION_WIDTH 8
27 #define ERF_SC_PACKETISER_HEADER_VERSION_VALUE 2
28 #define ERF_SC_PACKETISER_HEADER_IDENTIFIER_LBN 8
29 #define ERF_SC_PACKETISER_HEADER_IDENTIFIER_WIDTH 8
30 #define ERF_SC_PACKETISER_HEADER_IDENTIFIER_AR 0
31 #define ERF_SC_PACKETISER_HEADER_IDENTIFIER_CT 1
32 #define ERF_SC_PACKETISER_HEADER_IDENTIFIER_OR 2
33 #define ERF_SC_PACKETISER_HEADER_HEADER_OFFSET_LBN 16
34 #define ERF_SC_PACKETISER_HEADER_HEADER_OFFSET_WIDTH 8
35 #define ERF_SC_PACKETISER_HEADER_HEADER_OFFSET_DEFAULT 0x4
36 #define ERF_SC_PACKETISER_HEADER_PAYLOAD_OFFSET_LBN 24
37 #define ERF_SC_PACKETISER_HEADER_PAYLOAD_OFFSET_WIDTH 8
38 #define ERF_SC_PACKETISER_HEADER_PAYLOAD_OFFSET_DEFAULT 0x14
39 #define ERF_SC_PACKETISER_HEADER_INDEX_LBN 32
40 #define ERF_SC_PACKETISER_HEADER_INDEX_WIDTH 16
41 #define ERF_SC_PACKETISER_HEADER_COUNT_LBN 48
42 #define ERF_SC_PACKETISER_HEADER_COUNT_WIDTH 16
43 #define ERF_SC_PACKETISER_HEADER_RESERVED_0_LBN 64
44 #define ERF_SC_PACKETISER_HEADER_RESERVED_0_WIDTH 32
45 #define ERF_SC_PACKETISER_HEADER_RESERVED_1_LBN 96
46 #define ERF_SC_PACKETISER_HEADER_RESERVED_1_WIDTH 32
47 #define ERF_SC_PACKETISER_HEADER_RESERVED_2_LBN 128
48 #define ERF_SC_PACKETISER_HEADER_RESERVED_2_WIDTH 32
49 
50 
51 /*------------------------------------------------------------*/
52 /*
53  * ER_RX_SL_PACKETISER_PAYLOAD_WORD(128bit):
54  *
55  */
56 #define ER_RX_SL_PACKETISER_PAYLOAD_WORD_SIZE 16
57 #define ER_RX_SL_PACKETISER_PAYLOAD_WORD_WIDTH 128
58 
59 #define ERF_SC_PACKETISER_PAYLOAD_COUNTER_INDEX_LBN 0
60 #define ERF_SC_PACKETISER_PAYLOAD_COUNTER_INDEX_WIDTH 24
61 #define ERF_SC_PACKETISER_PAYLOAD_RESERVED_LBN 24
62 #define ERF_SC_PACKETISER_PAYLOAD_RESERVED_WIDTH 8
63 #define ERF_SC_PACKETISER_PAYLOAD_PACKET_COUNT_OFST 4
64 #define ERF_SC_PACKETISER_PAYLOAD_PACKET_COUNT_SIZE 6
65 #define ERF_SC_PACKETISER_PAYLOAD_PACKET_COUNT_LBN 32
66 #define ERF_SC_PACKETISER_PAYLOAD_PACKET_COUNT_WIDTH 48
67 #define ERF_SC_PACKETISER_PAYLOAD_BYTE_COUNT_OFST 10
68 #define ERF_SC_PACKETISER_PAYLOAD_BYTE_COUNT_SIZE 6
69 #define ERF_SC_PACKETISER_PAYLOAD_BYTE_COUNT_LBN 80
70 #define ERF_SC_PACKETISER_PAYLOAD_BYTE_COUNT_WIDTH 48
71 
72 
73 #endif /* EFX_MAE_COUNTER_FORMAT_H */
74