en_port.h 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560
  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. #ifndef _MLX4_EN_PORT_H_
  34. #define _MLX4_EN_PORT_H_
  35. #define SET_PORT_GEN_ALL_VALID 0x7
  36. #define SET_PORT_PROMISC_SHIFT 31
  37. #define SET_PORT_MC_PROMISC_SHIFT 30
  38. #define MLX4_EN_NUM_TC 8
  39. #define VLAN_FLTR_SIZE 128
  40. struct mlx4_set_vlan_fltr_mbox {
  41. __be32 entry[VLAN_FLTR_SIZE];
  42. };
  43. enum {
  44. MLX4_MCAST_CONFIG = 0,
  45. MLX4_MCAST_DISABLE = 1,
  46. MLX4_MCAST_ENABLE = 2,
  47. };
  48. enum {
  49. MLX4_EN_1G_SPEED = 0x02,
  50. MLX4_EN_10G_SPEED_XFI = 0x01,
  51. MLX4_EN_10G_SPEED_XAUI = 0x00,
  52. MLX4_EN_40G_SPEED = 0x40,
  53. MLX4_EN_OTHER_SPEED = 0x0f,
  54. };
  55. struct mlx4_en_query_port_context {
  56. u8 link_up;
  57. #define MLX4_EN_LINK_UP_MASK 0x80
  58. u8 reserved;
  59. __be16 mtu;
  60. u8 reserved2;
  61. u8 link_speed;
  62. #define MLX4_EN_SPEED_MASK 0x43
  63. u16 reserved3[5];
  64. __be64 mac;
  65. u8 transceiver;
  66. };
  67. struct mlx4_en_stat_out_mbox {
  68. /* Received frames with a length of 64 octets */
  69. __be64 R64_prio_0;
  70. __be64 R64_prio_1;
  71. __be64 R64_prio_2;
  72. __be64 R64_prio_3;
  73. __be64 R64_prio_4;
  74. __be64 R64_prio_5;
  75. __be64 R64_prio_6;
  76. __be64 R64_prio_7;
  77. __be64 R64_novlan;
  78. /* Received frames with a length of 127 octets */
  79. __be64 R127_prio_0;
  80. __be64 R127_prio_1;
  81. __be64 R127_prio_2;
  82. __be64 R127_prio_3;
  83. __be64 R127_prio_4;
  84. __be64 R127_prio_5;
  85. __be64 R127_prio_6;
  86. __be64 R127_prio_7;
  87. __be64 R127_novlan;
  88. /* Received frames with a length of 255 octets */
  89. __be64 R255_prio_0;
  90. __be64 R255_prio_1;
  91. __be64 R255_prio_2;
  92. __be64 R255_prio_3;
  93. __be64 R255_prio_4;
  94. __be64 R255_prio_5;
  95. __be64 R255_prio_6;
  96. __be64 R255_prio_7;
  97. __be64 R255_novlan;
  98. /* Received frames with a length of 511 octets */
  99. __be64 R511_prio_0;
  100. __be64 R511_prio_1;
  101. __be64 R511_prio_2;
  102. __be64 R511_prio_3;
  103. __be64 R511_prio_4;
  104. __be64 R511_prio_5;
  105. __be64 R511_prio_6;
  106. __be64 R511_prio_7;
  107. __be64 R511_novlan;
  108. /* Received frames with a length of 1023 octets */
  109. __be64 R1023_prio_0;
  110. __be64 R1023_prio_1;
  111. __be64 R1023_prio_2;
  112. __be64 R1023_prio_3;
  113. __be64 R1023_prio_4;
  114. __be64 R1023_prio_5;
  115. __be64 R1023_prio_6;
  116. __be64 R1023_prio_7;
  117. __be64 R1023_novlan;
  118. /* Received frames with a length of 1518 octets */
  119. __be64 R1518_prio_0;
  120. __be64 R1518_prio_1;
  121. __be64 R1518_prio_2;
  122. __be64 R1518_prio_3;
  123. __be64 R1518_prio_4;
  124. __be64 R1518_prio_5;
  125. __be64 R1518_prio_6;
  126. __be64 R1518_prio_7;
  127. __be64 R1518_novlan;
  128. /* Received frames with a length of 1522 octets */
  129. __be64 R1522_prio_0;
  130. __be64 R1522_prio_1;
  131. __be64 R1522_prio_2;
  132. __be64 R1522_prio_3;
  133. __be64 R1522_prio_4;
  134. __be64 R1522_prio_5;
  135. __be64 R1522_prio_6;
  136. __be64 R1522_prio_7;
  137. __be64 R1522_novlan;
  138. /* Received frames with a length of 1548 octets */
  139. __be64 R1548_prio_0;
  140. __be64 R1548_prio_1;
  141. __be64 R1548_prio_2;
  142. __be64 R1548_prio_3;
  143. __be64 R1548_prio_4;
  144. __be64 R1548_prio_5;
  145. __be64 R1548_prio_6;
  146. __be64 R1548_prio_7;
  147. __be64 R1548_novlan;
  148. /* Received frames with a length of 1548 < octets < MTU */
  149. __be64 R2MTU_prio_0;
  150. __be64 R2MTU_prio_1;
  151. __be64 R2MTU_prio_2;
  152. __be64 R2MTU_prio_3;
  153. __be64 R2MTU_prio_4;
  154. __be64 R2MTU_prio_5;
  155. __be64 R2MTU_prio_6;
  156. __be64 R2MTU_prio_7;
  157. __be64 R2MTU_novlan;
  158. /* Received frames with a length of MTU< octets and good CRC */
  159. __be64 RGIANT_prio_0;
  160. __be64 RGIANT_prio_1;
  161. __be64 RGIANT_prio_2;
  162. __be64 RGIANT_prio_3;
  163. __be64 RGIANT_prio_4;
  164. __be64 RGIANT_prio_5;
  165. __be64 RGIANT_prio_6;
  166. __be64 RGIANT_prio_7;
  167. __be64 RGIANT_novlan;
  168. /* Received broadcast frames with good CRC */
  169. __be64 RBCAST_prio_0;
  170. __be64 RBCAST_prio_1;
  171. __be64 RBCAST_prio_2;
  172. __be64 RBCAST_prio_3;
  173. __be64 RBCAST_prio_4;
  174. __be64 RBCAST_prio_5;
  175. __be64 RBCAST_prio_6;
  176. __be64 RBCAST_prio_7;
  177. __be64 RBCAST_novlan;
  178. /* Received multicast frames with good CRC */
  179. __be64 MCAST_prio_0;
  180. __be64 MCAST_prio_1;
  181. __be64 MCAST_prio_2;
  182. __be64 MCAST_prio_3;
  183. __be64 MCAST_prio_4;
  184. __be64 MCAST_prio_5;
  185. __be64 MCAST_prio_6;
  186. __be64 MCAST_prio_7;
  187. __be64 MCAST_novlan;
  188. /* Received unicast not short or GIANT frames with good CRC */
  189. __be64 RTOTG_prio_0;
  190. __be64 RTOTG_prio_1;
  191. __be64 RTOTG_prio_2;
  192. __be64 RTOTG_prio_3;
  193. __be64 RTOTG_prio_4;
  194. __be64 RTOTG_prio_5;
  195. __be64 RTOTG_prio_6;
  196. __be64 RTOTG_prio_7;
  197. __be64 RTOTG_novlan;
  198. /* Count of total octets of received frames, includes framing characters */
  199. __be64 RTTLOCT_prio_0;
  200. /* Count of total octets of received frames, not including framing
  201. characters */
  202. __be64 RTTLOCT_NOFRM_prio_0;
  203. /* Count of Total number of octets received
  204. (only for frames without errors) */
  205. __be64 ROCT_prio_0;
  206. __be64 RTTLOCT_prio_1;
  207. __be64 RTTLOCT_NOFRM_prio_1;
  208. __be64 ROCT_prio_1;
  209. __be64 RTTLOCT_prio_2;
  210. __be64 RTTLOCT_NOFRM_prio_2;
  211. __be64 ROCT_prio_2;
  212. __be64 RTTLOCT_prio_3;
  213. __be64 RTTLOCT_NOFRM_prio_3;
  214. __be64 ROCT_prio_3;
  215. __be64 RTTLOCT_prio_4;
  216. __be64 RTTLOCT_NOFRM_prio_4;
  217. __be64 ROCT_prio_4;
  218. __be64 RTTLOCT_prio_5;
  219. __be64 RTTLOCT_NOFRM_prio_5;
  220. __be64 ROCT_prio_5;
  221. __be64 RTTLOCT_prio_6;
  222. __be64 RTTLOCT_NOFRM_prio_6;
  223. __be64 ROCT_prio_6;
  224. __be64 RTTLOCT_prio_7;
  225. __be64 RTTLOCT_NOFRM_prio_7;
  226. __be64 ROCT_prio_7;
  227. __be64 RTTLOCT_novlan;
  228. __be64 RTTLOCT_NOFRM_novlan;
  229. __be64 ROCT_novlan;
  230. /* Count of Total received frames including bad frames */
  231. __be64 RTOT_prio_0;
  232. /* Count of Total number of received frames with 802.1Q encapsulation */
  233. __be64 R1Q_prio_0;
  234. __be64 reserved1;
  235. __be64 RTOT_prio_1;
  236. __be64 R1Q_prio_1;
  237. __be64 reserved2;
  238. __be64 RTOT_prio_2;
  239. __be64 R1Q_prio_2;
  240. __be64 reserved3;
  241. __be64 RTOT_prio_3;
  242. __be64 R1Q_prio_3;
  243. __be64 reserved4;
  244. __be64 RTOT_prio_4;
  245. __be64 R1Q_prio_4;
  246. __be64 reserved5;
  247. __be64 RTOT_prio_5;
  248. __be64 R1Q_prio_5;
  249. __be64 reserved6;
  250. __be64 RTOT_prio_6;
  251. __be64 R1Q_prio_6;
  252. __be64 reserved7;
  253. __be64 RTOT_prio_7;
  254. __be64 R1Q_prio_7;
  255. __be64 reserved8;
  256. __be64 RTOT_novlan;
  257. __be64 R1Q_novlan;
  258. __be64 reserved9;
  259. /* Total number of Successfully Received Control Frames */
  260. __be64 RCNTL;
  261. __be64 reserved10;
  262. __be64 reserved11;
  263. __be64 reserved12;
  264. /* Count of received frames with a length/type field value between 46
  265. (42 for VLANtagged frames) and 1500 (also 1500 for VLAN-tagged frames),
  266. inclusive */
  267. __be64 RInRangeLengthErr;
  268. /* Count of received frames with length/type field between 1501 and 1535
  269. decimal, inclusive */
  270. __be64 ROutRangeLengthErr;
  271. /* Count of received frames that are longer than max allowed size for
  272. 802.3 frames (1518/1522) */
  273. __be64 RFrmTooLong;
  274. /* Count frames received with PCS error */
  275. __be64 PCS;
  276. /* Transmit frames with a length of 64 octets */
  277. __be64 T64_prio_0;
  278. __be64 T64_prio_1;
  279. __be64 T64_prio_2;
  280. __be64 T64_prio_3;
  281. __be64 T64_prio_4;
  282. __be64 T64_prio_5;
  283. __be64 T64_prio_6;
  284. __be64 T64_prio_7;
  285. __be64 T64_novlan;
  286. __be64 T64_loopbk;
  287. /* Transmit frames with a length of 65 to 127 octets. */
  288. __be64 T127_prio_0;
  289. __be64 T127_prio_1;
  290. __be64 T127_prio_2;
  291. __be64 T127_prio_3;
  292. __be64 T127_prio_4;
  293. __be64 T127_prio_5;
  294. __be64 T127_prio_6;
  295. __be64 T127_prio_7;
  296. __be64 T127_novlan;
  297. __be64 T127_loopbk;
  298. /* Transmit frames with a length of 128 to 255 octets */
  299. __be64 T255_prio_0;
  300. __be64 T255_prio_1;
  301. __be64 T255_prio_2;
  302. __be64 T255_prio_3;
  303. __be64 T255_prio_4;
  304. __be64 T255_prio_5;
  305. __be64 T255_prio_6;
  306. __be64 T255_prio_7;
  307. __be64 T255_novlan;
  308. __be64 T255_loopbk;
  309. /* Transmit frames with a length of 256 to 511 octets */
  310. __be64 T511_prio_0;
  311. __be64 T511_prio_1;
  312. __be64 T511_prio_2;
  313. __be64 T511_prio_3;
  314. __be64 T511_prio_4;
  315. __be64 T511_prio_5;
  316. __be64 T511_prio_6;
  317. __be64 T511_prio_7;
  318. __be64 T511_novlan;
  319. __be64 T511_loopbk;
  320. /* Transmit frames with a length of 512 to 1023 octets */
  321. __be64 T1023_prio_0;
  322. __be64 T1023_prio_1;
  323. __be64 T1023_prio_2;
  324. __be64 T1023_prio_3;
  325. __be64 T1023_prio_4;
  326. __be64 T1023_prio_5;
  327. __be64 T1023_prio_6;
  328. __be64 T1023_prio_7;
  329. __be64 T1023_novlan;
  330. __be64 T1023_loopbk;
  331. /* Transmit frames with a length of 1024 to 1518 octets */
  332. __be64 T1518_prio_0;
  333. __be64 T1518_prio_1;
  334. __be64 T1518_prio_2;
  335. __be64 T1518_prio_3;
  336. __be64 T1518_prio_4;
  337. __be64 T1518_prio_5;
  338. __be64 T1518_prio_6;
  339. __be64 T1518_prio_7;
  340. __be64 T1518_novlan;
  341. __be64 T1518_loopbk;
  342. /* Counts transmit frames with a length of 1519 to 1522 bytes */
  343. __be64 T1522_prio_0;
  344. __be64 T1522_prio_1;
  345. __be64 T1522_prio_2;
  346. __be64 T1522_prio_3;
  347. __be64 T1522_prio_4;
  348. __be64 T1522_prio_5;
  349. __be64 T1522_prio_6;
  350. __be64 T1522_prio_7;
  351. __be64 T1522_novlan;
  352. __be64 T1522_loopbk;
  353. /* Transmit frames with a length of 1523 to 1548 octets */
  354. __be64 T1548_prio_0;
  355. __be64 T1548_prio_1;
  356. __be64 T1548_prio_2;
  357. __be64 T1548_prio_3;
  358. __be64 T1548_prio_4;
  359. __be64 T1548_prio_5;
  360. __be64 T1548_prio_6;
  361. __be64 T1548_prio_7;
  362. __be64 T1548_novlan;
  363. __be64 T1548_loopbk;
  364. /* Counts transmit frames with a length of 1549 to MTU bytes */
  365. __be64 T2MTU_prio_0;
  366. __be64 T2MTU_prio_1;
  367. __be64 T2MTU_prio_2;
  368. __be64 T2MTU_prio_3;
  369. __be64 T2MTU_prio_4;
  370. __be64 T2MTU_prio_5;
  371. __be64 T2MTU_prio_6;
  372. __be64 T2MTU_prio_7;
  373. __be64 T2MTU_novlan;
  374. __be64 T2MTU_loopbk;
  375. /* Transmit frames with a length greater than MTU octets and a good CRC. */
  376. __be64 TGIANT_prio_0;
  377. __be64 TGIANT_prio_1;
  378. __be64 TGIANT_prio_2;
  379. __be64 TGIANT_prio_3;
  380. __be64 TGIANT_prio_4;
  381. __be64 TGIANT_prio_5;
  382. __be64 TGIANT_prio_6;
  383. __be64 TGIANT_prio_7;
  384. __be64 TGIANT_novlan;
  385. __be64 TGIANT_loopbk;
  386. /* Transmit broadcast frames with a good CRC */
  387. __be64 TBCAST_prio_0;
  388. __be64 TBCAST_prio_1;
  389. __be64 TBCAST_prio_2;
  390. __be64 TBCAST_prio_3;
  391. __be64 TBCAST_prio_4;
  392. __be64 TBCAST_prio_5;
  393. __be64 TBCAST_prio_6;
  394. __be64 TBCAST_prio_7;
  395. __be64 TBCAST_novlan;
  396. __be64 TBCAST_loopbk;
  397. /* Transmit multicast frames with a good CRC */
  398. __be64 TMCAST_prio_0;
  399. __be64 TMCAST_prio_1;
  400. __be64 TMCAST_prio_2;
  401. __be64 TMCAST_prio_3;
  402. __be64 TMCAST_prio_4;
  403. __be64 TMCAST_prio_5;
  404. __be64 TMCAST_prio_6;
  405. __be64 TMCAST_prio_7;
  406. __be64 TMCAST_novlan;
  407. __be64 TMCAST_loopbk;
  408. /* Transmit good frames that are neither broadcast nor multicast */
  409. __be64 TTOTG_prio_0;
  410. __be64 TTOTG_prio_1;
  411. __be64 TTOTG_prio_2;
  412. __be64 TTOTG_prio_3;
  413. __be64 TTOTG_prio_4;
  414. __be64 TTOTG_prio_5;
  415. __be64 TTOTG_prio_6;
  416. __be64 TTOTG_prio_7;
  417. __be64 TTOTG_novlan;
  418. __be64 TTOTG_loopbk;
  419. /* total octets of transmitted frames, including framing characters */
  420. __be64 TTTLOCT_prio_0;
  421. /* total octets of transmitted frames, not including framing characters */
  422. __be64 TTTLOCT_NOFRM_prio_0;
  423. /* ifOutOctets */
  424. __be64 TOCT_prio_0;
  425. __be64 TTTLOCT_prio_1;
  426. __be64 TTTLOCT_NOFRM_prio_1;
  427. __be64 TOCT_prio_1;
  428. __be64 TTTLOCT_prio_2;
  429. __be64 TTTLOCT_NOFRM_prio_2;
  430. __be64 TOCT_prio_2;
  431. __be64 TTTLOCT_prio_3;
  432. __be64 TTTLOCT_NOFRM_prio_3;
  433. __be64 TOCT_prio_3;
  434. __be64 TTTLOCT_prio_4;
  435. __be64 TTTLOCT_NOFRM_prio_4;
  436. __be64 TOCT_prio_4;
  437. __be64 TTTLOCT_prio_5;
  438. __be64 TTTLOCT_NOFRM_prio_5;
  439. __be64 TOCT_prio_5;
  440. __be64 TTTLOCT_prio_6;
  441. __be64 TTTLOCT_NOFRM_prio_6;
  442. __be64 TOCT_prio_6;
  443. __be64 TTTLOCT_prio_7;
  444. __be64 TTTLOCT_NOFRM_prio_7;
  445. __be64 TOCT_prio_7;
  446. __be64 TTTLOCT_novlan;
  447. __be64 TTTLOCT_NOFRM_novlan;
  448. __be64 TOCT_novlan;
  449. __be64 TTTLOCT_loopbk;
  450. __be64 TTTLOCT_NOFRM_loopbk;
  451. __be64 TOCT_loopbk;
  452. /* Total frames transmitted with a good CRC that are not aborted */
  453. __be64 TTOT_prio_0;
  454. /* Total number of frames transmitted with 802.1Q encapsulation */
  455. __be64 T1Q_prio_0;
  456. __be64 reserved13;
  457. __be64 TTOT_prio_1;
  458. __be64 T1Q_prio_1;
  459. __be64 reserved14;
  460. __be64 TTOT_prio_2;
  461. __be64 T1Q_prio_2;
  462. __be64 reserved15;
  463. __be64 TTOT_prio_3;
  464. __be64 T1Q_prio_3;
  465. __be64 reserved16;
  466. __be64 TTOT_prio_4;
  467. __be64 T1Q_prio_4;
  468. __be64 reserved17;
  469. __be64 TTOT_prio_5;
  470. __be64 T1Q_prio_5;
  471. __be64 reserved18;
  472. __be64 TTOT_prio_6;
  473. __be64 T1Q_prio_6;
  474. __be64 reserved19;
  475. __be64 TTOT_prio_7;
  476. __be64 T1Q_prio_7;
  477. __be64 reserved20;
  478. __be64 TTOT_novlan;
  479. __be64 T1Q_novlan;
  480. __be64 reserved21;
  481. __be64 TTOT_loopbk;
  482. __be64 T1Q_loopbk;
  483. __be64 reserved22;
  484. /* Received frames with a length greater than MTU octets and a bad CRC */
  485. __be32 RJBBR;
  486. /* Received frames with a bad CRC that are not runts, jabbers,
  487. or alignment errors */
  488. __be32 RCRC;
  489. /* Received frames with SFD with a length of less than 64 octets and a
  490. bad CRC */
  491. __be32 RRUNT;
  492. /* Received frames with a length less than 64 octets and a good CRC */
  493. __be32 RSHORT;
  494. /* Total Number of Received Packets Dropped */
  495. __be32 RDROP;
  496. /* Drop due to overflow */
  497. __be32 RdropOvflw;
  498. /* Drop due to overflow */
  499. __be32 RdropLength;
  500. /* Total of good frames. Does not include frames received with
  501. frame-too-long, FCS, or length errors */
  502. __be32 RTOTFRMS;
  503. /* Total dropped Xmited packets */
  504. __be32 TDROP;
  505. };
  506. #endif