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_EN_SHIFT 31
40 #define SET_PORT_PROMISC_MODE_SHIFT 30
43 MLX4_CMD_SET_VLAN_FLTR = 0x47,
44 MLX4_CMD_SET_MCAST_FLTR = 0x48,
45 MLX4_CMD_DUMP_ETH_STATS = 0x49,
48 struct mlx4_set_port_general_context {
61 struct mlx4_set_port_rqp_calc_context {
76 #define VLAN_FLTR_SIZE 128
77 struct mlx4_set_vlan_fltr_mbox {
78 __be32 entry[VLAN_FLTR_SIZE];
83 MLX4_MCAST_CONFIG = 0,
84 MLX4_MCAST_DISABLE = 1,
85 MLX4_MCAST_ENABLE = 2,
89 struct mlx4_en_stat_out_mbox {
90 /* Received frames with a length of 64 octets */
100 /* Received frames with a length of 127 octets */
110 /* Received frames with a length of 255 octets */
120 /* Received frames with a length of 511 octets */
130 /* Received frames with a length of 1023 octets */
140 /* Received frames with a length of 1518 octets */
150 /* Received frames with a length of 1522 octets */
160 /* Received frames with a length of 1548 octets */
170 /* Received frames with a length of 1548 < octets < MTU */
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 */
210 /* Received unicast not short or GIANT frames with good CRC */
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
225 __be64 RTTLOCT_NOFRM_prio_0;
226 /* Count of Total number of octets received
227 (only for frames without errors) */
230 __be64 RTTLOCT_prio_1;
231 __be64 RTTLOCT_NOFRM_prio_1;
234 __be64 RTTLOCT_prio_2;
235 __be64 RTTLOCT_NOFRM_prio_2;
238 __be64 RTTLOCT_prio_3;
239 __be64 RTTLOCT_NOFRM_prio_3;
242 __be64 RTTLOCT_prio_4;
243 __be64 RTTLOCT_NOFRM_prio_4;
246 __be64 RTTLOCT_prio_5;
247 __be64 RTTLOCT_NOFRM_prio_5;
250 __be64 RTTLOCT_prio_6;
251 __be64 RTTLOCT_NOFRM_prio_6;
254 __be64 RTTLOCT_prio_7;
255 __be64 RTTLOCT_NOFRM_prio_7;
258 __be64 RTTLOCT_novlan;
259 __be64 RTTLOCT_NOFRM_novlan;
262 /* Count of Total received frames including bad frames */
264 /* Count of Total number of received frames with 802.1Q encapsulation */
300 /* Total number of Successfully Received Control Frames */
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),
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) */
315 /* Count frames received with PCS error */
318 /* Transmit frames with a length of 64 octets */
329 /* Transmit frames with a length of 65 to 127 octets. */
340 /* Transmit frames with a length of 128 to 255 octets */
351 /* Transmit frames with a length of 256 to 511 octets */
362 /* Transmit frames with a length of 512 to 1023 octets */
373 /* Transmit frames with a length of 1024 to 1518 octets */
384 /* Counts transmit frames with a length of 1519 to 1522 bytes */
395 /* Transmit frames with a length of 1523 to 1548 octets */
406 /* Counts transmit frames with a length of 1549 to MTU bytes */
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 */
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;
469 __be64 TTTLOCT_prio_1;
470 __be64 TTTLOCT_NOFRM_prio_1;
473 __be64 TTTLOCT_prio_2;
474 __be64 TTTLOCT_NOFRM_prio_2;
477 __be64 TTTLOCT_prio_3;
478 __be64 TTTLOCT_NOFRM_prio_3;
481 __be64 TTTLOCT_prio_4;
482 __be64 TTTLOCT_NOFRM_prio_4;
485 __be64 TTTLOCT_prio_5;
486 __be64 TTTLOCT_NOFRM_prio_5;
489 __be64 TTTLOCT_prio_6;
490 __be64 TTTLOCT_NOFRM_prio_6;
493 __be64 TTTLOCT_prio_7;
494 __be64 TTTLOCT_NOFRM_prio_7;
497 __be64 TTTLOCT_novlan;
498 __be64 TTTLOCT_NOFRM_novlan;
501 __be64 TTTLOCT_loopbk;
502 __be64 TTTLOCT_NOFRM_loopbk;
505 /* Total frames transmitted with a good CRC that are not aborted */
507 /* Total number of frames transmitted with 802.1Q encapsulation */
547 /* Received frames with a length greater than MTU octets and a bad CRC */
549 /* Received frames with a bad CRC that are not runts, jabbers,
550 or alignment errors */
552 /* Received frames with SFD with a length of less than 64 octets and a
555 /* Received frames with a length less than 64 octets and a good CRC */
557 /* Total Number of Received Packets Dropped */
559 /* Drop due to overflow */
561 /* Drop due to overflow */
563 /* Total of good frames. Does not include frames received with
564 frame-too-long, FCS, or length errors */
566 /* Total dropped Xmited packets */