82
82
#define MLXSW_PCI_AQ_PAGES 8
83
83
#define MLXSW_PCI_AQ_SIZE (MLXSW_PCI_PAGE_SIZE * MLXSW_PCI_AQ_PAGES)
84
84
#define MLXSW_PCI_WQE_SIZE 32 /* 32 bytes per element */
85
- #define MLXSW_PCI_CQE_SIZE 16 /* 16 bytes per element */
85
+ #define MLXSW_PCI_CQE01_SIZE 16 /* 16 bytes per element */
86
+ #define MLXSW_PCI_CQE2_SIZE 32 /* 32 bytes per element */
86
87
#define MLXSW_PCI_EQE_SIZE 16 /* 16 bytes per element */
87
88
#define MLXSW_PCI_WQE_COUNT (MLXSW_PCI_AQ_SIZE / MLXSW_PCI_WQE_SIZE)
88
- #define MLXSW_PCI_CQE_COUNT (MLXSW_PCI_AQ_SIZE / MLXSW_PCI_CQE_SIZE)
89
+ #define MLXSW_PCI_CQE01_COUNT (MLXSW_PCI_AQ_SIZE / MLXSW_PCI_CQE01_SIZE)
90
+ #define MLXSW_PCI_CQE2_COUNT (MLXSW_PCI_AQ_SIZE / MLXSW_PCI_CQE2_SIZE)
89
91
#define MLXSW_PCI_EQE_COUNT (MLXSW_PCI_AQ_SIZE / MLXSW_PCI_EQE_SIZE)
90
92
#define MLXSW_PCI_EQE_UPDATE_COUNT 0x80
91
93
@@ -126,10 +128,48 @@ MLXSW_ITEM16_INDEXED(pci, wqe, byte_count, 0x02, 0, 14, 0x02, 0x00, false);
126
128
*/
127
129
MLXSW_ITEM64_INDEXED (pci , wqe , address , 0x08 , 0 , 64 , 0x8 , 0x0 , false);
128
130
131
+ enum mlxsw_pci_cqe_v {
132
+ MLXSW_PCI_CQE_V0 ,
133
+ MLXSW_PCI_CQE_V1 ,
134
+ MLXSW_PCI_CQE_V2 ,
135
+ };
136
+
137
+ #define mlxsw_pci_cqe_item_helpers (name , v0 , v1 , v2 ) \
138
+ static inline u32 mlxsw_pci_cqe_##name##_get(enum mlxsw_pci_cqe_v v, char *cqe) \
139
+ { \
140
+ switch (v) { \
141
+ default: \
142
+ case MLXSW_PCI_CQE_V0: \
143
+ return mlxsw_pci_cqe##v0##_##name##_get(cqe); \
144
+ case MLXSW_PCI_CQE_V1: \
145
+ return mlxsw_pci_cqe##v1##_##name##_get(cqe); \
146
+ case MLXSW_PCI_CQE_V2: \
147
+ return mlxsw_pci_cqe##v2##_##name##_get(cqe); \
148
+ } \
149
+ } \
150
+ static inline void mlxsw_pci_cqe_##name##_set(enum mlxsw_pci_cqe_v v, \
151
+ char *cqe, u32 val) \
152
+ { \
153
+ switch (v) { \
154
+ default: \
155
+ case MLXSW_PCI_CQE_V0: \
156
+ mlxsw_pci_cqe##v0##_##name##_set(cqe, val); \
157
+ break; \
158
+ case MLXSW_PCI_CQE_V1: \
159
+ mlxsw_pci_cqe##v1##_##name##_set(cqe, val); \
160
+ break; \
161
+ case MLXSW_PCI_CQE_V2: \
162
+ mlxsw_pci_cqe##v2##_##name##_set(cqe, val); \
163
+ break; \
164
+ } \
165
+ }
166
+
129
167
/* pci_cqe_lag
130
168
* Packet arrives from a port which is a LAG
131
169
*/
132
- MLXSW_ITEM32 (pci , cqe , lag , 0x00 , 23 , 1 );
170
+ MLXSW_ITEM32 (pci , cqe0 , lag , 0x00 , 23 , 1 );
171
+ MLXSW_ITEM32 (pci , cqe12 , lag , 0x00 , 24 , 1 );
172
+ mlxsw_pci_cqe_item_helpers (lag , 0 , 12 , 12 );
133
173
134
174
/* pci_cqe_system_port/lag_id
135
175
* When lag=0: System port on which the packet was received
@@ -138,8 +178,12 @@ MLXSW_ITEM32(pci, cqe, lag, 0x00, 23, 1);
138
178
* bits [3:0] sub_port on which the packet was received
139
179
*/
140
180
MLXSW_ITEM32 (pci , cqe , system_port , 0x00 , 0 , 16 );
141
- MLXSW_ITEM32 (pci , cqe , lag_id , 0x00 , 4 , 12 );
142
- MLXSW_ITEM32 (pci , cqe , lag_port_index , 0x00 , 0 , 4 );
181
+ MLXSW_ITEM32 (pci , cqe0 , lag_id , 0x00 , 4 , 12 );
182
+ MLXSW_ITEM32 (pci , cqe12 , lag_id , 0x00 , 0 , 16 );
183
+ mlxsw_pci_cqe_item_helpers (lag_id , 0 , 12 , 12 );
184
+ MLXSW_ITEM32 (pci , cqe0 , lag_subport , 0x00 , 0 , 4 );
185
+ MLXSW_ITEM32 (pci , cqe12 , lag_subport , 0x00 , 16 , 8 );
186
+ mlxsw_pci_cqe_item_helpers (lag_subport , 0 , 12 , 12 );
143
187
144
188
/* pci_cqe_wqe_counter
145
189
* WQE count of the WQEs completed on the associated dqn
@@ -162,28 +206,38 @@ MLXSW_ITEM32(pci, cqe, trap_id, 0x08, 0, 9);
162
206
* Length include CRC. Indicates the length field includes
163
207
* the packet's CRC.
164
208
*/
165
- MLXSW_ITEM32 (pci , cqe , crc , 0x0C , 8 , 1 );
209
+ MLXSW_ITEM32 (pci , cqe0 , crc , 0x0C , 8 , 1 );
210
+ MLXSW_ITEM32 (pci , cqe12 , crc , 0x0C , 9 , 1 );
211
+ mlxsw_pci_cqe_item_helpers (crc , 0 , 12 , 12 );
166
212
167
213
/* pci_cqe_e
168
214
* CQE with Error.
169
215
*/
170
- MLXSW_ITEM32 (pci , cqe , e , 0x0C , 7 , 1 );
216
+ MLXSW_ITEM32 (pci , cqe0 , e , 0x0C , 7 , 1 );
217
+ MLXSW_ITEM32 (pci , cqe12 , e , 0x00 , 27 , 1 );
218
+ mlxsw_pci_cqe_item_helpers (e , 0 , 12 , 12 );
171
219
172
220
/* pci_cqe_sr
173
221
* 1 - Send Queue
174
222
* 0 - Receive Queue
175
223
*/
176
- MLXSW_ITEM32 (pci , cqe , sr , 0x0C , 6 , 1 );
224
+ MLXSW_ITEM32 (pci , cqe0 , sr , 0x0C , 6 , 1 );
225
+ MLXSW_ITEM32 (pci , cqe12 , sr , 0x00 , 26 , 1 );
226
+ mlxsw_pci_cqe_item_helpers (sr , 0 , 12 , 12 );
177
227
178
228
/* pci_cqe_dqn
179
229
* Descriptor Queue (DQ) Number.
180
230
*/
181
- MLXSW_ITEM32 (pci , cqe , dqn , 0x0C , 1 , 5 );
231
+ MLXSW_ITEM32 (pci , cqe0 , dqn , 0x0C , 1 , 5 );
232
+ MLXSW_ITEM32 (pci , cqe12 , dqn , 0x0C , 1 , 6 );
233
+ mlxsw_pci_cqe_item_helpers (dqn , 0 , 12 , 12 );
182
234
183
235
/* pci_cqe_owner
184
236
* Ownership bit.
185
237
*/
186
- MLXSW_ITEM32 (pci , cqe , owner , 0x0C , 0 , 1 );
238
+ MLXSW_ITEM32 (pci , cqe01 , owner , 0x0C , 0 , 1 );
239
+ MLXSW_ITEM32 (pci , cqe2 , owner , 0x1C , 0 , 1 );
240
+ mlxsw_pci_cqe_item_helpers (owner , 01 , 01 , 2 );
187
241
188
242
/* pci_eqe_event_type
189
243
* Event type.
0 commit comments