]> bbs.cooldavid.org Git - net-next-2.6.git/blob - drivers/net/mlx4/en_port.h
mlx4_en: Change multicast promiscuous mode to support IBoE
[net-next-2.6.git] / drivers / net / mlx4 / en_port.h
1 /*
2  * Copyright (c) 2007 Mellanox Technologies. All rights reserved.
3  *
4  * This software is available to you under a choice of one of two
5  * licenses.  You may choose to be licensed under the terms of the GNU
6  * General Public License (GPL) Version 2, available from the file
7  * COPYING in the main directory of this source tree, or the
8  * OpenIB.org BSD license below:
9  *
10  *     Redistribution and use in source and binary forms, with or
11  *     without modification, are permitted provided that the following
12  *     conditions are met:
13  *
14  *      - Redistributions of source code must retain the above
15  *        copyright notice, this list of conditions and the following
16  *        disclaimer.
17  *
18  *      - Redistributions in binary form must reproduce the above
19  *        copyright notice, this list of conditions and the following
20  *        disclaimer in the documentation and/or other materials
21  *        provided with the distribution.
22  *
23  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
24  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
25  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
26  * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
27  * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
28  * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
29  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
30  * SOFTWARE.
31  *
32  */
33
34 #ifndef _MLX4_EN_PORT_H_
35 #define _MLX4_EN_PORT_H_
36
37
38 #define SET_PORT_GEN_ALL_VALID  0x7
39 #define SET_PORT_PROMISC_EN_SHIFT       31
40 #define SET_PORT_PROMISC_MODE_SHIFT     30
41
42 enum {
43         MLX4_CMD_SET_VLAN_FLTR  = 0x47,
44         MLX4_CMD_SET_MCAST_FLTR = 0x48,
45         MLX4_CMD_DUMP_ETH_STATS = 0x49,
46 };
47
48 struct mlx4_set_port_general_context {
49         u8 reserved[3];
50         u8 flags;
51         u16 reserved2;
52         __be16 mtu;
53         u8 pptx;
54         u8 pfctx;
55         u16 reserved3;
56         u8 pprx;
57         u8 pfcrx;
58         u16 reserved4;
59 };
60
61 struct mlx4_set_port_rqp_calc_context {
62         __be32 base_qpn;
63         __be32 flags;
64         u8 reserved[3];
65         u8 mac_miss;
66         u8 intra_no_vlan;
67         u8 no_vlan;
68         u8 intra_vlan_miss;
69         u8 vlan_miss;
70         u8 reserved2[3];
71         u8 no_vlan_prio;
72         __be32 promisc;
73         __be32 mcast;
74 };
75
76 #define VLAN_FLTR_SIZE  128
77 struct mlx4_set_vlan_fltr_mbox {
78         __be32 entry[VLAN_FLTR_SIZE];
79 };
80
81
82 enum {
83         MLX4_MCAST_CONFIG       = 0,
84         MLX4_MCAST_DISABLE      = 1,
85         MLX4_MCAST_ENABLE       = 2,
86 };
87
88
89 struct mlx4_en_stat_out_mbox {
90         /* Received frames with a length of 64 octets */
91         __be64 R64_prio_0;
92         __be64 R64_prio_1;
93         __be64 R64_prio_2;
94         __be64 R64_prio_3;
95         __be64 R64_prio_4;
96         __be64 R64_prio_5;
97         __be64 R64_prio_6;
98         __be64 R64_prio_7;
99         __be64 R64_novlan;
100         /* Received frames with a length of 127 octets */
101         __be64 R127_prio_0;
102         __be64 R127_prio_1;
103         __be64 R127_prio_2;
104         __be64 R127_prio_3;
105         __be64 R127_prio_4;
106         __be64 R127_prio_5;
107         __be64 R127_prio_6;
108         __be64 R127_prio_7;
109         __be64 R127_novlan;
110         /* Received frames with a length of 255 octets */
111         __be64 R255_prio_0;
112         __be64 R255_prio_1;
113         __be64 R255_prio_2;
114         __be64 R255_prio_3;
115         __be64 R255_prio_4;
116         __be64 R255_prio_5;
117         __be64 R255_prio_6;
118         __be64 R255_prio_7;
119         __be64 R255_novlan;
120         /* Received frames with a length of 511 octets */
121         __be64 R511_prio_0;
122         __be64 R511_prio_1;
123         __be64 R511_prio_2;
124         __be64 R511_prio_3;
125         __be64 R511_prio_4;
126         __be64 R511_prio_5;
127         __be64 R511_prio_6;
128         __be64 R511_prio_7;
129         __be64 R511_novlan;
130         /* Received frames with a length of 1023 octets */
131         __be64 R1023_prio_0;
132         __be64 R1023_prio_1;
133         __be64 R1023_prio_2;
134         __be64 R1023_prio_3;
135         __be64 R1023_prio_4;
136         __be64 R1023_prio_5;
137         __be64 R1023_prio_6;
138         __be64 R1023_prio_7;
139         __be64 R1023_novlan;
140         /* Received frames with a length of 1518 octets */
141         __be64 R1518_prio_0;
142         __be64 R1518_prio_1;
143         __be64 R1518_prio_2;
144         __be64 R1518_prio_3;
145         __be64 R1518_prio_4;
146         __be64 R1518_prio_5;
147         __be64 R1518_prio_6;
148         __be64 R1518_prio_7;
149         __be64 R1518_novlan;
150         /* Received frames with a length of 1522 octets */
151         __be64 R1522_prio_0;
152         __be64 R1522_prio_1;
153         __be64 R1522_prio_2;
154         __be64 R1522_prio_3;
155         __be64 R1522_prio_4;
156         __be64 R1522_prio_5;
157         __be64 R1522_prio_6;
158         __be64 R1522_prio_7;
159         __be64 R1522_novlan;
160         /* Received frames with a length of 1548 octets */
161         __be64 R1548_prio_0;
162         __be64 R1548_prio_1;
163         __be64 R1548_prio_2;
164         __be64 R1548_prio_3;
165         __be64 R1548_prio_4;
166         __be64 R1548_prio_5;
167         __be64 R1548_prio_6;
168         __be64 R1548_prio_7;
169         __be64 R1548_novlan;
170         /* Received frames with a length of 1548 < octets < MTU */
171         __be64 R2MTU_prio_0;
172         __be64 R2MTU_prio_1;
173         __be64 R2MTU_prio_2;
174         __be64 R2MTU_prio_3;
175         __be64 R2MTU_prio_4;
176         __be64 R2MTU_prio_5;
177         __be64 R2MTU_prio_6;
178         __be64 R2MTU_prio_7;
179         __be64 R2MTU_novlan;
180         /* Received frames with a length of MTU< octets and good CRC */
181         __be64 RGIANT_prio_0;
182         __be64 RGIANT_prio_1;
183         __be64 RGIANT_prio_2;
184         __be64 RGIANT_prio_3;
185         __be64 RGIANT_prio_4;
186         __be64 RGIANT_prio_5;
187         __be64 RGIANT_prio_6;
188         __be64 RGIANT_prio_7;
189         __be64 RGIANT_novlan;
190         /* Received broadcast frames with good CRC */
191         __be64 RBCAST_prio_0;
192         __be64 RBCAST_prio_1;
193         __be64 RBCAST_prio_2;
194         __be64 RBCAST_prio_3;
195         __be64 RBCAST_prio_4;
196         __be64 RBCAST_prio_5;
197         __be64 RBCAST_prio_6;
198         __be64 RBCAST_prio_7;
199         __be64 RBCAST_novlan;
200         /* Received multicast frames with good CRC */
201         __be64 MCAST_prio_0;
202         __be64 MCAST_prio_1;
203         __be64 MCAST_prio_2;
204         __be64 MCAST_prio_3;
205         __be64 MCAST_prio_4;
206         __be64 MCAST_prio_5;
207         __be64 MCAST_prio_6;
208         __be64 MCAST_prio_7;
209         __be64 MCAST_novlan;
210         /* Received unicast not short or GIANT frames with good CRC */
211         __be64 RTOTG_prio_0;
212         __be64 RTOTG_prio_1;
213         __be64 RTOTG_prio_2;
214         __be64 RTOTG_prio_3;
215         __be64 RTOTG_prio_4;
216         __be64 RTOTG_prio_5;
217         __be64 RTOTG_prio_6;
218         __be64 RTOTG_prio_7;
219         __be64 RTOTG_novlan;
220
221         /* Count of total octets of received frames, includes framing characters */
222         __be64 RTTLOCT_prio_0;
223         /* Count of total octets of received frames, not including framing
224            characters */
225         __be64 RTTLOCT_NOFRM_prio_0;
226         /* Count of Total number of octets received
227            (only for frames without errors) */
228         __be64 ROCT_prio_0;
229
230         __be64 RTTLOCT_prio_1;
231         __be64 RTTLOCT_NOFRM_prio_1;
232         __be64 ROCT_prio_1;
233
234         __be64 RTTLOCT_prio_2;
235         __be64 RTTLOCT_NOFRM_prio_2;
236         __be64 ROCT_prio_2;
237
238         __be64 RTTLOCT_prio_3;
239         __be64 RTTLOCT_NOFRM_prio_3;
240         __be64 ROCT_prio_3;
241
242         __be64 RTTLOCT_prio_4;
243         __be64 RTTLOCT_NOFRM_prio_4;
244         __be64 ROCT_prio_4;
245
246         __be64 RTTLOCT_prio_5;
247         __be64 RTTLOCT_NOFRM_prio_5;
248         __be64 ROCT_prio_5;
249
250         __be64 RTTLOCT_prio_6;
251         __be64 RTTLOCT_NOFRM_prio_6;
252         __be64 ROCT_prio_6;
253
254         __be64 RTTLOCT_prio_7;
255         __be64 RTTLOCT_NOFRM_prio_7;
256         __be64 ROCT_prio_7;
257
258         __be64 RTTLOCT_novlan;
259         __be64 RTTLOCT_NOFRM_novlan;
260         __be64 ROCT_novlan;
261
262         /* Count of Total received frames including bad frames */
263         __be64 RTOT_prio_0;
264         /* Count of  Total number of received frames with 802.1Q encapsulation */
265         __be64 R1Q_prio_0;
266         __be64 reserved1;
267
268         __be64 RTOT_prio_1;
269         __be64 R1Q_prio_1;
270         __be64 reserved2;
271
272         __be64 RTOT_prio_2;
273         __be64 R1Q_prio_2;
274         __be64 reserved3;
275
276         __be64 RTOT_prio_3;
277         __be64 R1Q_prio_3;
278         __be64 reserved4;
279
280         __be64 RTOT_prio_4;
281         __be64 R1Q_prio_4;
282         __be64 reserved5;
283
284         __be64 RTOT_prio_5;
285         __be64 R1Q_prio_5;
286         __be64 reserved6;
287
288         __be64 RTOT_prio_6;
289         __be64 R1Q_prio_6;
290         __be64 reserved7;
291
292         __be64 RTOT_prio_7;
293         __be64 R1Q_prio_7;
294         __be64 reserved8;
295
296         __be64 RTOT_novlan;
297         __be64 R1Q_novlan;
298         __be64 reserved9;
299
300         /* Total number of Successfully Received Control Frames */
301         __be64 RCNTL;
302         __be64 reserved10;
303         __be64 reserved11;
304         __be64 reserved12;
305         /* Count of received frames with a length/type field  value between 46
306            (42 for VLANtagged frames) and 1500 (also 1500 for VLAN-tagged frames),
307            inclusive */
308         __be64 RInRangeLengthErr;
309         /* Count of received frames with length/type field between 1501 and 1535
310            decimal, inclusive */
311         __be64 ROutRangeLengthErr;
312         /* Count of received frames that are longer than max allowed size for
313            802.3 frames (1518/1522) */
314         __be64 RFrmTooLong;
315         /* Count frames received with PCS error */
316         __be64 PCS;
317
318         /* Transmit frames with a length of 64 octets */
319         __be64 T64_prio_0;
320         __be64 T64_prio_1;
321         __be64 T64_prio_2;
322         __be64 T64_prio_3;
323         __be64 T64_prio_4;
324         __be64 T64_prio_5;
325         __be64 T64_prio_6;
326         __be64 T64_prio_7;
327         __be64 T64_novlan;
328         __be64 T64_loopbk;
329         /* Transmit frames with a length of 65 to 127 octets. */
330         __be64 T127_prio_0;
331         __be64 T127_prio_1;
332         __be64 T127_prio_2;
333         __be64 T127_prio_3;
334         __be64 T127_prio_4;
335         __be64 T127_prio_5;
336         __be64 T127_prio_6;
337         __be64 T127_prio_7;
338         __be64 T127_novlan;
339         __be64 T127_loopbk;
340         /* Transmit frames with a length of 128 to 255 octets */
341         __be64 T255_prio_0;
342         __be64 T255_prio_1;
343         __be64 T255_prio_2;
344         __be64 T255_prio_3;
345         __be64 T255_prio_4;
346         __be64 T255_prio_5;
347         __be64 T255_prio_6;
348         __be64 T255_prio_7;
349         __be64 T255_novlan;
350         __be64 T255_loopbk;
351         /* Transmit frames with a length of 256 to 511 octets */
352         __be64 T511_prio_0;
353         __be64 T511_prio_1;
354         __be64 T511_prio_2;
355         __be64 T511_prio_3;
356         __be64 T511_prio_4;
357         __be64 T511_prio_5;
358         __be64 T511_prio_6;
359         __be64 T511_prio_7;
360         __be64 T511_novlan;
361         __be64 T511_loopbk;
362         /* Transmit frames with a length of 512 to 1023 octets */
363         __be64 T1023_prio_0;
364         __be64 T1023_prio_1;
365         __be64 T1023_prio_2;
366         __be64 T1023_prio_3;
367         __be64 T1023_prio_4;
368         __be64 T1023_prio_5;
369         __be64 T1023_prio_6;
370         __be64 T1023_prio_7;
371         __be64 T1023_novlan;
372         __be64 T1023_loopbk;
373         /* Transmit frames with a length of 1024 to 1518 octets */
374         __be64 T1518_prio_0;
375         __be64 T1518_prio_1;
376         __be64 T1518_prio_2;
377         __be64 T1518_prio_3;
378         __be64 T1518_prio_4;
379         __be64 T1518_prio_5;
380         __be64 T1518_prio_6;
381         __be64 T1518_prio_7;
382         __be64 T1518_novlan;
383         __be64 T1518_loopbk;
384         /* Counts transmit frames with a length of 1519 to 1522 bytes */
385         __be64 T1522_prio_0;
386         __be64 T1522_prio_1;
387         __be64 T1522_prio_2;
388         __be64 T1522_prio_3;
389         __be64 T1522_prio_4;
390         __be64 T1522_prio_5;
391         __be64 T1522_prio_6;
392         __be64 T1522_prio_7;
393         __be64 T1522_novlan;
394         __be64 T1522_loopbk;
395         /* Transmit frames with a length of 1523 to 1548 octets */
396         __be64 T1548_prio_0;
397         __be64 T1548_prio_1;
398         __be64 T1548_prio_2;
399         __be64 T1548_prio_3;
400         __be64 T1548_prio_4;
401         __be64 T1548_prio_5;
402         __be64 T1548_prio_6;
403         __be64 T1548_prio_7;
404         __be64 T1548_novlan;
405         __be64 T1548_loopbk;
406         /* Counts transmit frames with a length of 1549 to MTU bytes */
407         __be64 T2MTU_prio_0;
408         __be64 T2MTU_prio_1;
409         __be64 T2MTU_prio_2;
410         __be64 T2MTU_prio_3;
411         __be64 T2MTU_prio_4;
412         __be64 T2MTU_prio_5;
413         __be64 T2MTU_prio_6;
414         __be64 T2MTU_prio_7;
415         __be64 T2MTU_novlan;
416         __be64 T2MTU_loopbk;
417         /* Transmit frames with a length greater than MTU octets and a good CRC. */
418         __be64 TGIANT_prio_0;
419         __be64 TGIANT_prio_1;
420         __be64 TGIANT_prio_2;
421         __be64 TGIANT_prio_3;
422         __be64 TGIANT_prio_4;
423         __be64 TGIANT_prio_5;
424         __be64 TGIANT_prio_6;
425         __be64 TGIANT_prio_7;
426         __be64 TGIANT_novlan;
427         __be64 TGIANT_loopbk;
428         /* Transmit broadcast frames with a good CRC */
429         __be64 TBCAST_prio_0;
430         __be64 TBCAST_prio_1;
431         __be64 TBCAST_prio_2;
432         __be64 TBCAST_prio_3;
433         __be64 TBCAST_prio_4;
434         __be64 TBCAST_prio_5;
435         __be64 TBCAST_prio_6;
436         __be64 TBCAST_prio_7;
437         __be64 TBCAST_novlan;
438         __be64 TBCAST_loopbk;
439         /* Transmit multicast frames with a good CRC */
440         __be64 TMCAST_prio_0;
441         __be64 TMCAST_prio_1;
442         __be64 TMCAST_prio_2;
443         __be64 TMCAST_prio_3;
444         __be64 TMCAST_prio_4;
445         __be64 TMCAST_prio_5;
446         __be64 TMCAST_prio_6;
447         __be64 TMCAST_prio_7;
448         __be64 TMCAST_novlan;
449         __be64 TMCAST_loopbk;
450         /* Transmit good frames that are neither broadcast nor multicast */
451         __be64 TTOTG_prio_0;
452         __be64 TTOTG_prio_1;
453         __be64 TTOTG_prio_2;
454         __be64 TTOTG_prio_3;
455         __be64 TTOTG_prio_4;
456         __be64 TTOTG_prio_5;
457         __be64 TTOTG_prio_6;
458         __be64 TTOTG_prio_7;
459         __be64 TTOTG_novlan;
460         __be64 TTOTG_loopbk;
461
462         /* total octets of transmitted frames, including framing characters */
463         __be64 TTTLOCT_prio_0;
464         /* total octets of transmitted frames, not including framing characters */
465         __be64 TTTLOCT_NOFRM_prio_0;
466         /* ifOutOctets */
467         __be64 TOCT_prio_0;
468
469         __be64 TTTLOCT_prio_1;
470         __be64 TTTLOCT_NOFRM_prio_1;
471         __be64 TOCT_prio_1;
472
473         __be64 TTTLOCT_prio_2;
474         __be64 TTTLOCT_NOFRM_prio_2;
475         __be64 TOCT_prio_2;
476
477         __be64 TTTLOCT_prio_3;
478         __be64 TTTLOCT_NOFRM_prio_3;
479         __be64 TOCT_prio_3;
480
481         __be64 TTTLOCT_prio_4;
482         __be64 TTTLOCT_NOFRM_prio_4;
483         __be64 TOCT_prio_4;
484
485         __be64 TTTLOCT_prio_5;
486         __be64 TTTLOCT_NOFRM_prio_5;
487         __be64 TOCT_prio_5;
488
489         __be64 TTTLOCT_prio_6;
490         __be64 TTTLOCT_NOFRM_prio_6;
491         __be64 TOCT_prio_6;
492
493         __be64 TTTLOCT_prio_7;
494         __be64 TTTLOCT_NOFRM_prio_7;
495         __be64 TOCT_prio_7;
496
497         __be64 TTTLOCT_novlan;
498         __be64 TTTLOCT_NOFRM_novlan;
499         __be64 TOCT_novlan;
500
501         __be64 TTTLOCT_loopbk;
502         __be64 TTTLOCT_NOFRM_loopbk;
503         __be64 TOCT_loopbk;
504
505         /* Total frames transmitted with a good CRC that are not aborted  */
506         __be64 TTOT_prio_0;
507         /* Total number of frames transmitted with 802.1Q encapsulation */
508         __be64 T1Q_prio_0;
509         __be64 reserved13;
510
511         __be64 TTOT_prio_1;
512         __be64 T1Q_prio_1;
513         __be64 reserved14;
514
515         __be64 TTOT_prio_2;
516         __be64 T1Q_prio_2;
517         __be64 reserved15;
518
519         __be64 TTOT_prio_3;
520         __be64 T1Q_prio_3;
521         __be64 reserved16;
522
523         __be64 TTOT_prio_4;
524         __be64 T1Q_prio_4;
525         __be64 reserved17;
526
527         __be64 TTOT_prio_5;
528         __be64 T1Q_prio_5;
529         __be64 reserved18;
530
531         __be64 TTOT_prio_6;
532         __be64 T1Q_prio_6;
533         __be64 reserved19;
534
535         __be64 TTOT_prio_7;
536         __be64 T1Q_prio_7;
537         __be64 reserved20;
538
539         __be64 TTOT_novlan;
540         __be64 T1Q_novlan;
541         __be64 reserved21;
542
543         __be64 TTOT_loopbk;
544         __be64 T1Q_loopbk;
545         __be64 reserved22;
546
547         /* Received frames with a length greater than MTU octets and a bad CRC */
548         __be32 RJBBR;
549         /* Received frames with a bad CRC that are not runts, jabbers,
550            or alignment errors */
551         __be32 RCRC;
552         /* Received frames with SFD with a length of less than 64 octets and a
553            bad CRC */
554         __be32 RRUNT;
555         /* Received frames with a length less than 64 octets and a good CRC */
556         __be32 RSHORT;
557         /* Total Number of Received Packets Dropped */
558         __be32 RDROP;
559         /* Drop due to overflow  */
560         __be32 RdropOvflw;
561         /* Drop due to overflow */
562         __be32 RdropLength;
563         /* Total of good frames. Does not include frames received with
564            frame-too-long, FCS, or length errors */
565         __be32 RTOTFRMS;
566         /* Total dropped Xmited packets */
567         __be32 TDROP;
568 };
569
570
571 #endif