2 * Copyright (c) 2007 Mellanox Technologies. All rights reserved.
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:
10 * Redistribution and use in source and binary forms, with or
11 * without modification, are permitted provided that the following
14 * - Redistributions of source code must retain the above
15 * copyright notice, this list of conditions and the following
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.
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
34 #ifndef _MLX4_EN_PORT_H_
35 #define _MLX4_EN_PORT_H_
38 #define SET_PORT_GEN_ALL_VALID 0x7
39 #define SET_PORT_PROMISC_SHIFT 31
40 #define SET_PORT_MC_PROMISC_SHIFT 30
43 MLX4_CMD_SET_VLAN_FLTR
= 0x47,
44 MLX4_CMD_SET_MCAST_FLTR
= 0x48,
45 MLX4_CMD_DUMP_ETH_STATS
= 0x49,
49 MCAST_DIRECT_ONLY
= 0,
54 struct mlx4_set_port_general_context
{
67 struct mlx4_set_port_rqp_calc_context
{
85 #define VLAN_FLTR_SIZE 128
86 struct mlx4_set_vlan_fltr_mbox
{
87 __be32 entry
[VLAN_FLTR_SIZE
];
92 MLX4_MCAST_CONFIG
= 0,
93 MLX4_MCAST_DISABLE
= 1,
94 MLX4_MCAST_ENABLE
= 2,
98 MLX4_EN_1G_SPEED
= 0x02,
99 MLX4_EN_10G_SPEED_XFI
= 0x01,
100 MLX4_EN_10G_SPEED_XAUI
= 0x00,
101 MLX4_EN_40G_SPEED
= 0x40,
102 MLX4_EN_OTHER_SPEED
= 0x0f,
105 struct mlx4_en_query_port_context
{
107 #define MLX4_EN_LINK_UP_MASK 0x80
112 #define MLX4_EN_SPEED_MASK 0x43
119 struct mlx4_en_stat_out_mbox
{
120 /* Received frames with a length of 64 octets */
130 /* Received frames with a length of 127 octets */
140 /* Received frames with a length of 255 octets */
150 /* Received frames with a length of 511 octets */
160 /* Received frames with a length of 1023 octets */
170 /* Received frames with a length of 1518 octets */
180 /* Received frames with a length of 1522 octets */
190 /* Received frames with a length of 1548 octets */
200 /* Received frames with a length of 1548 < octets < MTU */
210 /* Received frames with a length of MTU< octets and good CRC */
211 __be64 RGIANT_prio_0
;
212 __be64 RGIANT_prio_1
;
213 __be64 RGIANT_prio_2
;
214 __be64 RGIANT_prio_3
;
215 __be64 RGIANT_prio_4
;
216 __be64 RGIANT_prio_5
;
217 __be64 RGIANT_prio_6
;
218 __be64 RGIANT_prio_7
;
219 __be64 RGIANT_novlan
;
220 /* Received broadcast frames with good CRC */
221 __be64 RBCAST_prio_0
;
222 __be64 RBCAST_prio_1
;
223 __be64 RBCAST_prio_2
;
224 __be64 RBCAST_prio_3
;
225 __be64 RBCAST_prio_4
;
226 __be64 RBCAST_prio_5
;
227 __be64 RBCAST_prio_6
;
228 __be64 RBCAST_prio_7
;
229 __be64 RBCAST_novlan
;
230 /* Received multicast frames with good CRC */
240 /* Received unicast not short or GIANT frames with good CRC */
251 /* Count of total octets of received frames, includes framing characters */
252 __be64 RTTLOCT_prio_0
;
253 /* Count of total octets of received frames, not including framing
255 __be64 RTTLOCT_NOFRM_prio_0
;
256 /* Count of Total number of octets received
257 (only for frames without errors) */
260 __be64 RTTLOCT_prio_1
;
261 __be64 RTTLOCT_NOFRM_prio_1
;
264 __be64 RTTLOCT_prio_2
;
265 __be64 RTTLOCT_NOFRM_prio_2
;
268 __be64 RTTLOCT_prio_3
;
269 __be64 RTTLOCT_NOFRM_prio_3
;
272 __be64 RTTLOCT_prio_4
;
273 __be64 RTTLOCT_NOFRM_prio_4
;
276 __be64 RTTLOCT_prio_5
;
277 __be64 RTTLOCT_NOFRM_prio_5
;
280 __be64 RTTLOCT_prio_6
;
281 __be64 RTTLOCT_NOFRM_prio_6
;
284 __be64 RTTLOCT_prio_7
;
285 __be64 RTTLOCT_NOFRM_prio_7
;
288 __be64 RTTLOCT_novlan
;
289 __be64 RTTLOCT_NOFRM_novlan
;
292 /* Count of Total received frames including bad frames */
294 /* Count of Total number of received frames with 802.1Q encapsulation */
330 /* Total number of Successfully Received Control Frames */
335 /* Count of received frames with a length/type field value between 46
336 (42 for VLANtagged frames) and 1500 (also 1500 for VLAN-tagged frames),
338 __be64 RInRangeLengthErr
;
339 /* Count of received frames with length/type field between 1501 and 1535
340 decimal, inclusive */
341 __be64 ROutRangeLengthErr
;
342 /* Count of received frames that are longer than max allowed size for
343 802.3 frames (1518/1522) */
345 /* Count frames received with PCS error */
348 /* Transmit frames with a length of 64 octets */
359 /* Transmit frames with a length of 65 to 127 octets. */
370 /* Transmit frames with a length of 128 to 255 octets */
381 /* Transmit frames with a length of 256 to 511 octets */
392 /* Transmit frames with a length of 512 to 1023 octets */
403 /* Transmit frames with a length of 1024 to 1518 octets */
414 /* Counts transmit frames with a length of 1519 to 1522 bytes */
425 /* Transmit frames with a length of 1523 to 1548 octets */
436 /* Counts transmit frames with a length of 1549 to MTU bytes */
447 /* Transmit frames with a length greater than MTU octets and a good CRC. */
448 __be64 TGIANT_prio_0
;
449 __be64 TGIANT_prio_1
;
450 __be64 TGIANT_prio_2
;
451 __be64 TGIANT_prio_3
;
452 __be64 TGIANT_prio_4
;
453 __be64 TGIANT_prio_5
;
454 __be64 TGIANT_prio_6
;
455 __be64 TGIANT_prio_7
;
456 __be64 TGIANT_novlan
;
457 __be64 TGIANT_loopbk
;
458 /* Transmit broadcast frames with a good CRC */
459 __be64 TBCAST_prio_0
;
460 __be64 TBCAST_prio_1
;
461 __be64 TBCAST_prio_2
;
462 __be64 TBCAST_prio_3
;
463 __be64 TBCAST_prio_4
;
464 __be64 TBCAST_prio_5
;
465 __be64 TBCAST_prio_6
;
466 __be64 TBCAST_prio_7
;
467 __be64 TBCAST_novlan
;
468 __be64 TBCAST_loopbk
;
469 /* Transmit multicast frames with a good CRC */
470 __be64 TMCAST_prio_0
;
471 __be64 TMCAST_prio_1
;
472 __be64 TMCAST_prio_2
;
473 __be64 TMCAST_prio_3
;
474 __be64 TMCAST_prio_4
;
475 __be64 TMCAST_prio_5
;
476 __be64 TMCAST_prio_6
;
477 __be64 TMCAST_prio_7
;
478 __be64 TMCAST_novlan
;
479 __be64 TMCAST_loopbk
;
480 /* Transmit good frames that are neither broadcast nor multicast */
492 /* total octets of transmitted frames, including framing characters */
493 __be64 TTTLOCT_prio_0
;
494 /* total octets of transmitted frames, not including framing characters */
495 __be64 TTTLOCT_NOFRM_prio_0
;
499 __be64 TTTLOCT_prio_1
;
500 __be64 TTTLOCT_NOFRM_prio_1
;
503 __be64 TTTLOCT_prio_2
;
504 __be64 TTTLOCT_NOFRM_prio_2
;
507 __be64 TTTLOCT_prio_3
;
508 __be64 TTTLOCT_NOFRM_prio_3
;
511 __be64 TTTLOCT_prio_4
;
512 __be64 TTTLOCT_NOFRM_prio_4
;
515 __be64 TTTLOCT_prio_5
;
516 __be64 TTTLOCT_NOFRM_prio_5
;
519 __be64 TTTLOCT_prio_6
;
520 __be64 TTTLOCT_NOFRM_prio_6
;
523 __be64 TTTLOCT_prio_7
;
524 __be64 TTTLOCT_NOFRM_prio_7
;
527 __be64 TTTLOCT_novlan
;
528 __be64 TTTLOCT_NOFRM_novlan
;
531 __be64 TTTLOCT_loopbk
;
532 __be64 TTTLOCT_NOFRM_loopbk
;
535 /* Total frames transmitted with a good CRC that are not aborted */
537 /* Total number of frames transmitted with 802.1Q encapsulation */
577 /* Received frames with a length greater than MTU octets and a bad CRC */
579 /* Received frames with a bad CRC that are not runts, jabbers,
580 or alignment errors */
582 /* Received frames with SFD with a length of less than 64 octets and a
585 /* Received frames with a length less than 64 octets and a good CRC */
587 /* Total Number of Received Packets Dropped */
589 /* Drop due to overflow */
591 /* Drop due to overflow */
593 /* Total of good frames. Does not include frames received with
594 frame-too-long, FCS, or length errors */
596 /* Total dropped Xmited packets */