bfa_defs_svc.h 37 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082
  1. /*
  2. * Copyright (c) 2005-2010 Brocade Communications Systems, Inc.
  3. * All rights reserved
  4. * www.brocade.com
  5. *
  6. * Linux driver for Brocade Fibre Channel Host Bus Adapter.
  7. *
  8. * This program is free software; you can redistribute it and/or modify it
  9. * under the terms of the GNU General Public License (GPL) Version 2 as
  10. * published by the Free Software Foundation
  11. *
  12. * This program is distributed in the hope that it will be useful, but
  13. * WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  15. * General Public License for more details.
  16. */
  17. #ifndef __BFA_DEFS_SVC_H__
  18. #define __BFA_DEFS_SVC_H__
  19. #include "bfa_defs.h"
  20. #include "bfa_fc.h"
  21. #include "bfi.h"
  22. #define BFA_IOCFC_INTR_DELAY 1125
  23. #define BFA_IOCFC_INTR_LATENCY 225
  24. #define BFA_IOCFCOE_INTR_DELAY 25
  25. #define BFA_IOCFCOE_INTR_LATENCY 5
  26. /*
  27. * Interrupt coalescing configuration.
  28. */
  29. #pragma pack(1)
  30. struct bfa_iocfc_intr_attr_s {
  31. u8 coalesce; /* enable/disable coalescing */
  32. u8 rsvd[3];
  33. __be16 latency; /* latency in microseconds */
  34. __be16 delay; /* delay in microseconds */
  35. };
  36. /*
  37. * IOC firmware configuraton
  38. */
  39. struct bfa_iocfc_fwcfg_s {
  40. u16 num_fabrics; /* number of fabrics */
  41. u16 num_lports; /* number of local lports */
  42. u16 num_rports; /* number of remote ports */
  43. u16 num_ioim_reqs; /* number of IO reqs */
  44. u16 num_tskim_reqs; /* task management requests */
  45. u16 num_iotm_reqs; /* number of TM IO reqs */
  46. u16 num_tsktm_reqs; /* TM task management requests*/
  47. u16 num_fcxp_reqs; /* unassisted FC exchanges */
  48. u16 num_uf_bufs; /* unsolicited recv buffers */
  49. u8 num_cqs;
  50. u8 fw_tick_res; /* FW clock resolution in ms */
  51. u8 rsvd[4];
  52. };
  53. #pragma pack()
  54. struct bfa_iocfc_drvcfg_s {
  55. u16 num_reqq_elems; /* number of req queue elements */
  56. u16 num_rspq_elems; /* number of rsp queue elements */
  57. u16 num_sgpgs; /* number of total SG pages */
  58. u16 num_sboot_tgts; /* number of SAN boot targets */
  59. u16 num_sboot_luns; /* number of SAN boot luns */
  60. u16 ioc_recover; /* IOC recovery mode */
  61. u16 min_cfg; /* minimum configuration */
  62. u16 path_tov; /* device path timeout */
  63. bfa_boolean_t delay_comp; /* delay completion of
  64. failed inflight IOs */
  65. u32 rsvd;
  66. };
  67. /*
  68. * IOC configuration
  69. */
  70. struct bfa_iocfc_cfg_s {
  71. struct bfa_iocfc_fwcfg_s fwcfg; /* firmware side config */
  72. struct bfa_iocfc_drvcfg_s drvcfg; /* driver side config */
  73. };
  74. /*
  75. * IOC firmware IO stats
  76. */
  77. struct bfa_fw_io_stats_s {
  78. u32 host_abort; /* IO aborted by host driver*/
  79. u32 host_cleanup; /* IO clean up by host driver */
  80. u32 fw_io_timeout; /* IOs timedout */
  81. u32 fw_frm_parse; /* frame parsed by f/w */
  82. u32 fw_frm_data; /* fcp_data frame parsed by f/w */
  83. u32 fw_frm_rsp; /* fcp_rsp frame parsed by f/w */
  84. u32 fw_frm_xfer_rdy; /* xfer_rdy frame parsed by f/w */
  85. u32 fw_frm_bls_acc; /* BLS ACC frame parsed by f/w */
  86. u32 fw_frm_tgt_abort; /* target ABTS parsed by f/w */
  87. u32 fw_frm_unknown; /* unknown parsed by f/w */
  88. u32 fw_data_dma; /* f/w DMA'ed the data frame */
  89. u32 fw_frm_drop; /* f/w drop the frame */
  90. u32 rec_timeout; /* FW rec timed out */
  91. u32 error_rec; /* FW sending rec on
  92. * an error condition*/
  93. u32 wait_for_si; /* FW wait for SI */
  94. u32 rec_rsp_inval; /* REC rsp invalid */
  95. u32 seqr_io_abort; /* target does not know cmd so abort */
  96. u32 seqr_io_retry; /* SEQR failed so retry IO */
  97. u32 itn_cisc_upd_rsp; /* ITN cisc updated on fcp_rsp */
  98. u32 itn_cisc_upd_data; /* ITN cisc updated on fcp_data */
  99. u32 itn_cisc_upd_xfer_rdy; /* ITN cisc updated on fcp_data */
  100. u32 fcp_data_lost; /* fcp data lost */
  101. u32 ro_set_in_xfer_rdy; /* Target set RO in Xfer_rdy frame */
  102. u32 xfer_rdy_ooo_err; /* Out of order Xfer_rdy received */
  103. u32 xfer_rdy_unknown_err; /* unknown error in xfer_rdy frame */
  104. u32 io_abort_timeout; /* ABTS timedout */
  105. u32 sler_initiated; /* SLER initiated */
  106. u32 unexp_fcp_rsp; /* fcp response in wrong state */
  107. u32 fcp_rsp_under_run; /* fcp rsp IO underrun */
  108. u32 fcp_rsp_under_run_wr; /* fcp rsp IO underrun for write */
  109. u32 fcp_rsp_under_run_err; /* fcp rsp IO underrun error */
  110. u32 fcp_rsp_resid_inval; /* invalid residue */
  111. u32 fcp_rsp_over_run; /* fcp rsp IO overrun */
  112. u32 fcp_rsp_over_run_err; /* fcp rsp IO overrun error */
  113. u32 fcp_rsp_proto_err; /* protocol error in fcp rsp */
  114. u32 fcp_rsp_sense_err; /* error in sense info in fcp rsp */
  115. u32 fcp_conf_req; /* FCP conf requested */
  116. u32 tgt_aborted_io; /* target initiated abort */
  117. u32 ioh_edtov_timeout_event;/* IOH edtov timer popped */
  118. u32 ioh_fcp_rsp_excp_event; /* IOH FCP_RSP exception */
  119. u32 ioh_fcp_conf_event; /* IOH FCP_CONF */
  120. u32 ioh_mult_frm_rsp_event; /* IOH multi_frame FCP_RSP */
  121. u32 ioh_hit_class2_event; /* IOH hit class2 */
  122. u32 ioh_miss_other_event; /* IOH miss other */
  123. u32 ioh_seq_cnt_err_event; /* IOH seq cnt error */
  124. u32 ioh_len_err_event; /* IOH len error - fcp_dl !=
  125. * bytes xfered */
  126. u32 ioh_seq_len_err_event; /* IOH seq len error */
  127. u32 ioh_data_oor_event; /* Data out of range */
  128. u32 ioh_ro_ooo_event; /* Relative offset out of range */
  129. u32 ioh_cpu_owned_event; /* IOH hit -iost owned by f/w */
  130. u32 ioh_unexp_frame_event; /* unexpected frame received
  131. * count */
  132. u32 ioh_err_int; /* IOH error int during data-phase
  133. * for scsi write
  134. */
  135. };
  136. /*
  137. * IOC port firmware stats
  138. */
  139. struct bfa_fw_port_fpg_stats_s {
  140. u32 intr_evt;
  141. u32 intr;
  142. u32 intr_excess;
  143. u32 intr_cause0;
  144. u32 intr_other;
  145. u32 intr_other_ign;
  146. u32 sig_lost;
  147. u32 sig_regained;
  148. u32 sync_lost;
  149. u32 sync_to;
  150. u32 sync_regained;
  151. u32 div2_overflow;
  152. u32 div2_underflow;
  153. u32 efifo_overflow;
  154. u32 efifo_underflow;
  155. u32 idle_rx;
  156. u32 lrr_rx;
  157. u32 lr_rx;
  158. u32 ols_rx;
  159. u32 nos_rx;
  160. u32 lip_rx;
  161. u32 arbf0_rx;
  162. u32 arb_rx;
  163. u32 mrk_rx;
  164. u32 const_mrk_rx;
  165. u32 prim_unknown;
  166. };
  167. struct bfa_fw_port_lksm_stats_s {
  168. u32 hwsm_success; /* hwsm state machine success */
  169. u32 hwsm_fails; /* hwsm fails */
  170. u32 hwsm_wdtov; /* hwsm timed out */
  171. u32 swsm_success; /* swsm success */
  172. u32 swsm_fails; /* swsm fails */
  173. u32 swsm_wdtov; /* swsm timed out */
  174. u32 busybufs; /* link init failed due to busybuf */
  175. u32 buf_waits; /* bufwait state entries */
  176. u32 link_fails; /* link failures */
  177. u32 psp_errors; /* primitive sequence protocol errors */
  178. u32 lr_unexp; /* No. of times LR rx-ed unexpectedly */
  179. u32 lrr_unexp; /* No. of times LRR rx-ed unexpectedly */
  180. u32 lr_tx; /* No. of times LR tx started */
  181. u32 lrr_tx; /* No. of times LRR tx started */
  182. u32 ols_tx; /* No. of times OLS tx started */
  183. u32 nos_tx; /* No. of times NOS tx started */
  184. u32 hwsm_lrr_rx; /* No. of times LRR rx-ed by HWSM */
  185. u32 hwsm_lr_rx; /* No. of times LR rx-ed by HWSM */
  186. };
  187. struct bfa_fw_port_snsm_stats_s {
  188. u32 hwsm_success; /* Successful hwsm terminations */
  189. u32 hwsm_fails; /* hwsm fail count */
  190. u32 hwsm_wdtov; /* hwsm timed out */
  191. u32 swsm_success; /* swsm success */
  192. u32 swsm_wdtov; /* swsm timed out */
  193. u32 error_resets; /* error resets initiated by upsm */
  194. u32 sync_lost; /* Sync loss count */
  195. u32 sig_lost; /* Signal loss count */
  196. };
  197. struct bfa_fw_port_physm_stats_s {
  198. u32 module_inserts; /* Module insert count */
  199. u32 module_xtracts; /* Module extracts count */
  200. u32 module_invalids; /* Invalid module inserted count */
  201. u32 module_read_ign; /* Module validation status ignored */
  202. u32 laser_faults; /* Laser fault count */
  203. u32 rsvd;
  204. };
  205. struct bfa_fw_fip_stats_s {
  206. u32 vlan_req; /* vlan discovery requests */
  207. u32 vlan_notify; /* vlan notifications */
  208. u32 vlan_err; /* vlan response error */
  209. u32 vlan_timeouts; /* vlan disvoery timeouts */
  210. u32 vlan_invalids; /* invalid vlan in discovery advert. */
  211. u32 disc_req; /* Discovery solicit requests */
  212. u32 disc_rsp; /* Discovery solicit response */
  213. u32 disc_err; /* Discovery advt. parse errors */
  214. u32 disc_unsol; /* Discovery unsolicited */
  215. u32 disc_timeouts; /* Discovery timeouts */
  216. u32 disc_fcf_unavail; /* Discovery FCF Not Avail. */
  217. u32 linksvc_unsupp; /* Unsupported link service req */
  218. u32 linksvc_err; /* Parse error in link service req */
  219. u32 logo_req; /* FIP logos received */
  220. u32 clrvlink_req; /* Clear virtual link req */
  221. u32 op_unsupp; /* Unsupported FIP operation */
  222. u32 untagged; /* Untagged frames (ignored) */
  223. u32 invalid_version; /* Invalid FIP version */
  224. };
  225. struct bfa_fw_lps_stats_s {
  226. u32 mac_invalids; /* Invalid mac assigned */
  227. u32 rsvd;
  228. };
  229. struct bfa_fw_fcoe_stats_s {
  230. u32 cee_linkups; /* CEE link up count */
  231. u32 cee_linkdns; /* CEE link down count */
  232. u32 fip_linkups; /* FIP link up count */
  233. u32 fip_linkdns; /* FIP link up count */
  234. u32 fip_fails; /* FIP fail count */
  235. u32 mac_invalids; /* Invalid mac assigned */
  236. };
  237. /*
  238. * IOC firmware FCoE port stats
  239. */
  240. struct bfa_fw_fcoe_port_stats_s {
  241. struct bfa_fw_fcoe_stats_s fcoe_stats;
  242. struct bfa_fw_fip_stats_s fip_stats;
  243. };
  244. /*
  245. * IOC firmware FC uport stats
  246. */
  247. struct bfa_fw_fc_uport_stats_s {
  248. struct bfa_fw_port_snsm_stats_s snsm_stats;
  249. struct bfa_fw_port_lksm_stats_s lksm_stats;
  250. };
  251. /*
  252. * IOC firmware FC port stats
  253. */
  254. union bfa_fw_fc_port_stats_s {
  255. struct bfa_fw_fc_uport_stats_s fc_stats;
  256. struct bfa_fw_fcoe_port_stats_s fcoe_stats;
  257. };
  258. /*
  259. * IOC firmware port stats
  260. */
  261. struct bfa_fw_port_stats_s {
  262. struct bfa_fw_port_fpg_stats_s fpg_stats;
  263. struct bfa_fw_port_physm_stats_s physm_stats;
  264. union bfa_fw_fc_port_stats_s fc_port;
  265. };
  266. /*
  267. * fcxchg module statistics
  268. */
  269. struct bfa_fw_fcxchg_stats_s {
  270. u32 ua_tag_inv;
  271. u32 ua_state_inv;
  272. };
  273. struct bfa_fw_lpsm_stats_s {
  274. u32 cls_rx;
  275. u32 cls_tx;
  276. };
  277. /*
  278. * Trunk statistics
  279. */
  280. struct bfa_fw_trunk_stats_s {
  281. u32 emt_recvd; /* Trunk EMT received */
  282. u32 emt_accepted; /* Trunk EMT Accepted */
  283. u32 emt_rejected; /* Trunk EMT rejected */
  284. u32 etp_recvd; /* Trunk ETP received */
  285. u32 etp_accepted; /* Trunk ETP Accepted */
  286. u32 etp_rejected; /* Trunk ETP rejected */
  287. u32 lr_recvd; /* Trunk LR received */
  288. u32 rsvd; /* padding for 64 bit alignment */
  289. };
  290. struct bfa_fw_advsm_stats_s {
  291. u32 flogi_sent; /* Flogi sent */
  292. u32 flogi_acc_recvd; /* Flogi Acc received */
  293. u32 flogi_rjt_recvd; /* Flogi rejects received */
  294. u32 flogi_retries; /* Flogi retries */
  295. u32 elp_recvd; /* ELP received */
  296. u32 elp_accepted; /* ELP Accepted */
  297. u32 elp_rejected; /* ELP rejected */
  298. u32 elp_dropped; /* ELP dropped */
  299. };
  300. /*
  301. * IOCFC firmware stats
  302. */
  303. struct bfa_fw_iocfc_stats_s {
  304. u32 cfg_reqs; /* cfg request */
  305. u32 updq_reqs; /* update queue request */
  306. u32 ic_reqs; /* interrupt coalesce reqs */
  307. u32 unknown_reqs;
  308. u32 set_intr_reqs; /* set interrupt reqs */
  309. };
  310. /*
  311. * IOC attributes returned in queries
  312. */
  313. struct bfa_iocfc_attr_s {
  314. struct bfa_iocfc_cfg_s config; /* IOCFC config */
  315. struct bfa_iocfc_intr_attr_s intr_attr; /* interrupt attr */
  316. };
  317. /*
  318. * Eth_sndrcv mod stats
  319. */
  320. struct bfa_fw_eth_sndrcv_stats_s {
  321. u32 crc_err;
  322. u32 rsvd; /* 64bit align */
  323. };
  324. /*
  325. * CT MAC mod stats
  326. */
  327. struct bfa_fw_mac_mod_stats_s {
  328. u32 mac_on; /* MAC got turned-on */
  329. u32 link_up; /* link-up */
  330. u32 signal_off; /* lost signal */
  331. u32 dfe_on; /* DFE on */
  332. u32 mac_reset; /* # of MAC reset to bring lnk up */
  333. u32 pcs_reset; /* # of PCS reset to bring lnk up */
  334. u32 loopback; /* MAC got into serdes loopback */
  335. u32 lb_mac_reset;
  336. /* # of MAC reset to bring link up in loopback */
  337. u32 lb_pcs_reset;
  338. /* # of PCS reset to bring link up in loopback */
  339. u32 rsvd; /* 64bit align */
  340. };
  341. /*
  342. * CT MOD stats
  343. */
  344. struct bfa_fw_ct_mod_stats_s {
  345. u32 rxa_rds_undrun; /* RxA RDS underrun */
  346. u32 rad_bpc_ovfl; /* RAD BPC overflow */
  347. u32 rad_rlb_bpc_ovfl; /* RAD RLB BPC overflow */
  348. u32 bpc_fcs_err; /* BPC FCS_ERR */
  349. u32 txa_tso_hdr; /* TxA TSO header too long */
  350. u32 rsvd; /* 64bit align */
  351. };
  352. /*
  353. * IOC firmware stats
  354. */
  355. struct bfa_fw_stats_s {
  356. struct bfa_fw_ioc_stats_s ioc_stats;
  357. struct bfa_fw_iocfc_stats_s iocfc_stats;
  358. struct bfa_fw_io_stats_s io_stats;
  359. struct bfa_fw_port_stats_s port_stats;
  360. struct bfa_fw_fcxchg_stats_s fcxchg_stats;
  361. struct bfa_fw_lpsm_stats_s lpsm_stats;
  362. struct bfa_fw_lps_stats_s lps_stats;
  363. struct bfa_fw_trunk_stats_s trunk_stats;
  364. struct bfa_fw_advsm_stats_s advsm_stats;
  365. struct bfa_fw_mac_mod_stats_s macmod_stats;
  366. struct bfa_fw_ct_mod_stats_s ctmod_stats;
  367. struct bfa_fw_eth_sndrcv_stats_s ethsndrcv_stats;
  368. };
  369. #define BFA_IOCFC_PATHTOV_MAX 60
  370. #define BFA_IOCFC_QDEPTH_MAX 2000
  371. /*
  372. * QoS states
  373. */
  374. enum bfa_qos_state {
  375. BFA_QOS_ONLINE = 1, /* QoS is online */
  376. BFA_QOS_OFFLINE = 2, /* QoS is offline */
  377. };
  378. /*
  379. * QoS Priority levels.
  380. */
  381. enum bfa_qos_priority {
  382. BFA_QOS_UNKNOWN = 0,
  383. BFA_QOS_HIGH = 1, /* QoS Priority Level High */
  384. BFA_QOS_MED = 2, /* QoS Priority Level Medium */
  385. BFA_QOS_LOW = 3, /* QoS Priority Level Low */
  386. };
  387. /*
  388. * QoS bandwidth allocation for each priority level
  389. */
  390. enum bfa_qos_bw_alloc {
  391. BFA_QOS_BW_HIGH = 60, /* bandwidth allocation for High */
  392. BFA_QOS_BW_MED = 30, /* bandwidth allocation for Medium */
  393. BFA_QOS_BW_LOW = 10, /* bandwidth allocation for Low */
  394. };
  395. #pragma pack(1)
  396. /*
  397. * QoS attribute returned in QoS Query
  398. */
  399. struct bfa_qos_attr_s {
  400. u8 state; /* QoS current state */
  401. u8 rsvd[3];
  402. u32 total_bb_cr; /* Total BB Credits */
  403. };
  404. /*
  405. * These fields should be displayed only from the CLI.
  406. * There will be a separate BFAL API (get_qos_vc_attr ?)
  407. * to retrieve this.
  408. *
  409. */
  410. #define BFA_QOS_MAX_VC 16
  411. struct bfa_qos_vc_info_s {
  412. u8 vc_credit;
  413. u8 borrow_credit;
  414. u8 priority;
  415. u8 resvd;
  416. };
  417. struct bfa_qos_vc_attr_s {
  418. u16 total_vc_count; /* Total VC Count */
  419. u16 shared_credit;
  420. u32 elp_opmode_flags;
  421. struct bfa_qos_vc_info_s vc_info[BFA_QOS_MAX_VC]; /* as many as
  422. * total_vc_count */
  423. };
  424. /*
  425. * QoS statistics
  426. */
  427. struct bfa_qos_stats_s {
  428. u32 flogi_sent; /* QoS Flogi sent */
  429. u32 flogi_acc_recvd; /* QoS Flogi Acc received */
  430. u32 flogi_rjt_recvd; /* QoS Flogi rejects received */
  431. u32 flogi_retries; /* QoS Flogi retries */
  432. u32 elp_recvd; /* QoS ELP received */
  433. u32 elp_accepted; /* QoS ELP Accepted */
  434. u32 elp_rejected; /* QoS ELP rejected */
  435. u32 elp_dropped; /* QoS ELP dropped */
  436. u32 qos_rscn_recvd; /* QoS RSCN received */
  437. u32 rsvd; /* padding for 64 bit alignment */
  438. };
  439. /*
  440. * FCoE statistics
  441. */
  442. struct bfa_fcoe_stats_s {
  443. u64 secs_reset; /* Seconds since stats reset */
  444. u64 cee_linkups; /* CEE link up */
  445. u64 cee_linkdns; /* CEE link down */
  446. u64 fip_linkups; /* FIP link up */
  447. u64 fip_linkdns; /* FIP link down */
  448. u64 fip_fails; /* FIP failures */
  449. u64 mac_invalids; /* Invalid mac assignments */
  450. u64 vlan_req; /* Vlan requests */
  451. u64 vlan_notify; /* Vlan notifications */
  452. u64 vlan_err; /* Vlan notification errors */
  453. u64 vlan_timeouts; /* Vlan request timeouts */
  454. u64 vlan_invalids; /* Vlan invalids */
  455. u64 disc_req; /* Discovery requests */
  456. u64 disc_rsp; /* Discovery responses */
  457. u64 disc_err; /* Discovery error frames */
  458. u64 disc_unsol; /* Discovery unsolicited */
  459. u64 disc_timeouts; /* Discovery timeouts */
  460. u64 disc_fcf_unavail; /* Discovery FCF not avail */
  461. u64 linksvc_unsupp; /* FIP link service req unsupp. */
  462. u64 linksvc_err; /* FIP link service req errors */
  463. u64 logo_req; /* FIP logos received */
  464. u64 clrvlink_req; /* Clear virtual link requests */
  465. u64 op_unsupp; /* FIP operation unsupp. */
  466. u64 untagged; /* FIP untagged frames */
  467. u64 txf_ucast; /* Tx FCoE unicast frames */
  468. u64 txf_ucast_vlan; /* Tx FCoE unicast vlan frames */
  469. u64 txf_ucast_octets; /* Tx FCoE unicast octets */
  470. u64 txf_mcast; /* Tx FCoE multicast frames */
  471. u64 txf_mcast_vlan; /* Tx FCoE multicast vlan frames */
  472. u64 txf_mcast_octets; /* Tx FCoE multicast octets */
  473. u64 txf_bcast; /* Tx FCoE broadcast frames */
  474. u64 txf_bcast_vlan; /* Tx FCoE broadcast vlan frames */
  475. u64 txf_bcast_octets; /* Tx FCoE broadcast octets */
  476. u64 txf_timeout; /* Tx timeouts */
  477. u64 txf_parity_errors; /* Transmit parity err */
  478. u64 txf_fid_parity_errors; /* Transmit FID parity err */
  479. u64 rxf_ucast_octets; /* Rx FCoE unicast octets */
  480. u64 rxf_ucast; /* Rx FCoE unicast frames */
  481. u64 rxf_ucast_vlan; /* Rx FCoE unicast vlan frames */
  482. u64 rxf_mcast_octets; /* Rx FCoE multicast octets */
  483. u64 rxf_mcast; /* Rx FCoE multicast frames */
  484. u64 rxf_mcast_vlan; /* Rx FCoE multicast vlan frames */
  485. u64 rxf_bcast_octets; /* Rx FCoE broadcast octets */
  486. u64 rxf_bcast; /* Rx FCoE broadcast frames */
  487. u64 rxf_bcast_vlan; /* Rx FCoE broadcast vlan frames */
  488. };
  489. /*
  490. * QoS or FCoE stats (fcport stats excluding physical FC port stats)
  491. */
  492. union bfa_fcport_stats_u {
  493. struct bfa_qos_stats_s fcqos;
  494. struct bfa_fcoe_stats_s fcoe;
  495. };
  496. #pragma pack()
  497. struct bfa_fcpim_del_itn_stats_s {
  498. u32 del_itn_iocomp_aborted; /* Aborted IO requests */
  499. u32 del_itn_iocomp_timedout; /* IO timeouts */
  500. u32 del_itn_iocom_sqer_needed; /* IO retry for SQ error recovery */
  501. u32 del_itn_iocom_res_free; /* Delayed freeing of IO resources */
  502. u32 del_itn_iocom_hostabrts; /* Host IO abort requests */
  503. u32 del_itn_total_ios; /* Total IO count */
  504. u32 del_io_iocdowns; /* IO cleaned-up due to IOC down */
  505. u32 del_tm_iocdowns; /* TM cleaned-up due to IOC down */
  506. };
  507. struct bfa_itnim_iostats_s {
  508. u32 total_ios; /* Total IO Requests */
  509. u32 input_reqs; /* Data in-bound requests */
  510. u32 output_reqs; /* Data out-bound requests */
  511. u32 io_comps; /* Total IO Completions */
  512. u32 wr_throughput; /* Write data transferred in bytes */
  513. u32 rd_throughput; /* Read data transferred in bytes */
  514. u32 iocomp_ok; /* Slowpath IO completions */
  515. u32 iocomp_underrun; /* IO underrun */
  516. u32 iocomp_overrun; /* IO overrun */
  517. u32 qwait; /* IO Request-Q wait */
  518. u32 qresumes; /* IO Request-Q wait done */
  519. u32 no_iotags; /* No free IO tag */
  520. u32 iocomp_timedout; /* IO timeouts */
  521. u32 iocom_nexus_abort; /* IO failure due to target offline */
  522. u32 iocom_proto_err; /* IO protocol errors */
  523. u32 iocom_dif_err; /* IO SBC-3 protection errors */
  524. u32 iocom_sqer_needed; /* fcp-2 error recovery failed */
  525. u32 iocom_res_free; /* Delayed freeing of IO tag */
  526. u32 io_aborts; /* Host IO abort requests */
  527. u32 iocom_hostabrts; /* Host IO abort completions */
  528. u32 io_cleanups; /* IO clean-up requests */
  529. u32 path_tov_expired; /* IO path tov expired */
  530. u32 iocomp_aborted; /* IO abort completions */
  531. u32 io_iocdowns; /* IO cleaned-up due to IOC down */
  532. u32 iocom_utags; /* IO comp with unknown tags */
  533. u32 io_tmaborts; /* Abort request due to TM command */
  534. u32 tm_io_comps; /* Abort completion due to TM command */
  535. u32 creates; /* IT Nexus create requests */
  536. u32 fw_create; /* IT Nexus FW create requests */
  537. u32 create_comps; /* IT Nexus FW create completions */
  538. u32 onlines; /* IT Nexus onlines */
  539. u32 offlines; /* IT Nexus offlines */
  540. u32 fw_delete; /* IT Nexus FW delete requests */
  541. u32 delete_comps; /* IT Nexus FW delete completions */
  542. u32 deletes; /* IT Nexus delete requests */
  543. u32 sler_events; /* SLER events */
  544. u32 ioc_disabled; /* Num IOC disables */
  545. u32 cleanup_comps; /* IT Nexus cleanup completions */
  546. u32 tm_cmnds; /* TM Requests */
  547. u32 tm_fw_rsps; /* TM Completions */
  548. u32 tm_success; /* TM initiated IO cleanup success */
  549. u32 tm_failures; /* TM initiated IO cleanup failure */
  550. u32 no_tskims; /* No free TM tag */
  551. u32 tm_qwait; /* TM Request-Q wait */
  552. u32 tm_qresumes; /* TM Request-Q wait done */
  553. u32 tm_iocdowns; /* TM cleaned-up due to IOC down */
  554. u32 tm_cleanups; /* TM cleanup requests */
  555. u32 tm_cleanup_comps; /* TM cleanup completions */
  556. };
  557. /* Modify char* port_stt[] in bfal_port.c if a new state was added */
  558. enum bfa_port_states {
  559. BFA_PORT_ST_UNINIT = 1,
  560. BFA_PORT_ST_ENABLING_QWAIT = 2,
  561. BFA_PORT_ST_ENABLING = 3,
  562. BFA_PORT_ST_LINKDOWN = 4,
  563. BFA_PORT_ST_LINKUP = 5,
  564. BFA_PORT_ST_DISABLING_QWAIT = 6,
  565. BFA_PORT_ST_DISABLING = 7,
  566. BFA_PORT_ST_DISABLED = 8,
  567. BFA_PORT_ST_STOPPED = 9,
  568. BFA_PORT_ST_IOCDOWN = 10,
  569. BFA_PORT_ST_IOCDIS = 11,
  570. BFA_PORT_ST_FWMISMATCH = 12,
  571. BFA_PORT_ST_PREBOOT_DISABLED = 13,
  572. BFA_PORT_ST_TOGGLING_QWAIT = 14,
  573. BFA_PORT_ST_MAX_STATE,
  574. };
  575. /*
  576. * Port operational type (in sync with SNIA port type).
  577. */
  578. enum bfa_port_type {
  579. BFA_PORT_TYPE_UNKNOWN = 1, /* port type is unknown */
  580. BFA_PORT_TYPE_NPORT = 5, /* P2P with switched fabric */
  581. BFA_PORT_TYPE_NLPORT = 6, /* public loop */
  582. BFA_PORT_TYPE_LPORT = 20, /* private loop */
  583. BFA_PORT_TYPE_P2P = 21, /* P2P with no switched fabric */
  584. BFA_PORT_TYPE_VPORT = 22, /* NPIV - virtual port */
  585. };
  586. /*
  587. * Port topology setting. A port's topology and fabric login status
  588. * determine its operational type.
  589. */
  590. enum bfa_port_topology {
  591. BFA_PORT_TOPOLOGY_NONE = 0, /* No valid topology */
  592. BFA_PORT_TOPOLOGY_P2P = 1, /* P2P only */
  593. BFA_PORT_TOPOLOGY_LOOP = 2, /* LOOP topology */
  594. BFA_PORT_TOPOLOGY_AUTO = 3, /* auto topology selection */
  595. };
  596. /*
  597. * Physical port loopback types.
  598. */
  599. enum bfa_port_opmode {
  600. BFA_PORT_OPMODE_NORMAL = 0x00, /* normal non-loopback mode */
  601. BFA_PORT_OPMODE_LB_INT = 0x01, /* internal loop back */
  602. BFA_PORT_OPMODE_LB_SLW = 0x02, /* serial link wrapback (serdes) */
  603. BFA_PORT_OPMODE_LB_EXT = 0x04, /* external loop back (serdes) */
  604. BFA_PORT_OPMODE_LB_CBL = 0x08, /* cabled loop back */
  605. BFA_PORT_OPMODE_LB_NLINT = 0x20, /* NL_Port internal loopback */
  606. };
  607. #define BFA_PORT_OPMODE_LB_HARD(_mode) \
  608. ((_mode == BFA_PORT_OPMODE_LB_INT) || \
  609. (_mode == BFA_PORT_OPMODE_LB_SLW) || \
  610. (_mode == BFA_PORT_OPMODE_LB_EXT))
  611. /*
  612. * Port link state
  613. */
  614. enum bfa_port_linkstate {
  615. BFA_PORT_LINKUP = 1, /* Physical port/Trunk link up */
  616. BFA_PORT_LINKDOWN = 2, /* Physical port/Trunk link down */
  617. };
  618. /*
  619. * Port link state reason code
  620. */
  621. enum bfa_port_linkstate_rsn {
  622. BFA_PORT_LINKSTATE_RSN_NONE = 0,
  623. BFA_PORT_LINKSTATE_RSN_DISABLED = 1,
  624. BFA_PORT_LINKSTATE_RSN_RX_NOS = 2,
  625. BFA_PORT_LINKSTATE_RSN_RX_OLS = 3,
  626. BFA_PORT_LINKSTATE_RSN_RX_LIP = 4,
  627. BFA_PORT_LINKSTATE_RSN_RX_LIPF7 = 5,
  628. BFA_PORT_LINKSTATE_RSN_SFP_REMOVED = 6,
  629. BFA_PORT_LINKSTATE_RSN_PORT_FAULT = 7,
  630. BFA_PORT_LINKSTATE_RSN_RX_LOS = 8,
  631. BFA_PORT_LINKSTATE_RSN_LOCAL_FAULT = 9,
  632. BFA_PORT_LINKSTATE_RSN_REMOTE_FAULT = 10,
  633. BFA_PORT_LINKSTATE_RSN_TIMEOUT = 11,
  634. /* CEE related reason codes/errors */
  635. CEE_LLDP_INFO_AGED_OUT = 20,
  636. CEE_LLDP_SHUTDOWN_TLV_RCVD = 21,
  637. CEE_PEER_NOT_ADVERTISE_DCBX = 22,
  638. CEE_PEER_NOT_ADVERTISE_PG = 23,
  639. CEE_PEER_NOT_ADVERTISE_PFC = 24,
  640. CEE_PEER_NOT_ADVERTISE_FCOE = 25,
  641. CEE_PG_NOT_COMPATIBLE = 26,
  642. CEE_PFC_NOT_COMPATIBLE = 27,
  643. CEE_FCOE_NOT_COMPATIBLE = 28,
  644. CEE_BAD_PG_RCVD = 29,
  645. CEE_BAD_BW_RCVD = 30,
  646. CEE_BAD_PFC_RCVD = 31,
  647. CEE_BAD_APP_PRI_RCVD = 32,
  648. CEE_FCOE_PRI_PFC_OFF = 33,
  649. CEE_DUP_CONTROL_TLV_RCVD = 34,
  650. CEE_DUP_FEAT_TLV_RCVD = 35,
  651. CEE_APPLY_NEW_CFG = 36, /* reason, not error */
  652. CEE_PROTOCOL_INIT = 37, /* reason, not error */
  653. CEE_PHY_LINK_DOWN = 38,
  654. CEE_LLS_FCOE_ABSENT = 39,
  655. CEE_LLS_FCOE_DOWN = 40,
  656. CEE_ISCSI_NOT_COMPATIBLE = 41,
  657. CEE_ISCSI_PRI_PFC_OFF = 42,
  658. CEE_ISCSI_PRI_OVERLAP_FCOE_PRI = 43
  659. };
  660. #pragma pack(1)
  661. /*
  662. * Physical port configuration
  663. */
  664. struct bfa_port_cfg_s {
  665. u8 topology; /* bfa_port_topology */
  666. u8 speed; /* enum bfa_port_speed */
  667. u8 trunked; /* trunked or not */
  668. u8 qos_enabled; /* qos enabled or not */
  669. u8 cfg_hardalpa; /* is hard alpa configured */
  670. u8 hardalpa; /* configured hard alpa */
  671. __be16 maxfrsize; /* maximum frame size */
  672. u8 rx_bbcredit; /* receive buffer credits */
  673. u8 tx_bbcredit; /* transmit buffer credits */
  674. u8 ratelimit; /* ratelimit enabled or not */
  675. u8 trl_def_speed; /* ratelimit default speed */
  676. u16 path_tov; /* device path timeout */
  677. u16 q_depth; /* SCSI Queue depth */
  678. };
  679. #pragma pack()
  680. /*
  681. * Port attribute values.
  682. */
  683. struct bfa_port_attr_s {
  684. /*
  685. * Static fields
  686. */
  687. wwn_t nwwn; /* node wwn */
  688. wwn_t pwwn; /* port wwn */
  689. wwn_t factorynwwn; /* factory node wwn */
  690. wwn_t factorypwwn; /* factory port wwn */
  691. enum fc_cos cos_supported; /* supported class of services */
  692. u32 rsvd;
  693. struct fc_symname_s port_symname; /* port symbolic name */
  694. enum bfa_port_speed speed_supported; /* supported speeds */
  695. bfa_boolean_t pbind_enabled;
  696. /*
  697. * Configured values
  698. */
  699. struct bfa_port_cfg_s pport_cfg; /* pport cfg */
  700. /*
  701. * Dynamic field - info from BFA
  702. */
  703. enum bfa_port_states port_state; /* current port state */
  704. enum bfa_port_speed speed; /* current speed */
  705. enum bfa_port_topology topology; /* current topology */
  706. bfa_boolean_t beacon; /* current beacon status */
  707. bfa_boolean_t link_e2e_beacon; /* link beacon is on */
  708. bfa_boolean_t plog_enabled; /* portlog is enabled */
  709. /*
  710. * Dynamic field - info from FCS
  711. */
  712. u32 pid; /* port ID */
  713. enum bfa_port_type port_type; /* current topology */
  714. u32 loopback; /* external loopback */
  715. u32 authfail; /* auth fail state */
  716. bfa_boolean_t io_profile; /* get it from fcpim mod */
  717. u8 pad[4]; /* for 64-bit alignement */
  718. /* FCoE specific */
  719. u16 fcoe_vlan;
  720. u8 rsvd1[6];
  721. };
  722. /*
  723. * Port FCP mappings.
  724. */
  725. struct bfa_port_fcpmap_s {
  726. char osdevname[256];
  727. u32 bus;
  728. u32 target;
  729. u32 oslun;
  730. u32 fcid;
  731. wwn_t nwwn;
  732. wwn_t pwwn;
  733. u64 fcplun;
  734. char luid[256];
  735. };
  736. /*
  737. * Port RNID info.
  738. */
  739. struct bfa_port_rnid_s {
  740. wwn_t wwn;
  741. u32 unittype;
  742. u32 portid;
  743. u32 attached_nodes_num;
  744. u16 ip_version;
  745. u16 udp_port;
  746. u8 ipaddr[16];
  747. u16 rsvd;
  748. u16 topologydiscoveryflags;
  749. };
  750. #pragma pack(1)
  751. struct bfa_fcport_fcf_s {
  752. wwn_t name; /* FCF name */
  753. wwn_t fabric_name; /* Fabric Name */
  754. u8 fipenabled; /* FIP enabled or not */
  755. u8 fipfailed; /* FIP failed or not */
  756. u8 resv[2];
  757. u8 pri; /* FCF priority */
  758. u8 version; /* FIP version used */
  759. u8 available; /* Available for login */
  760. u8 fka_disabled; /* FKA is disabled */
  761. u8 maxsz_verified; /* FCoE max size verified */
  762. u8 fc_map[3]; /* FC map */
  763. __be16 vlan; /* FCoE vlan tag/priority */
  764. u32 fka_adv_per; /* FIP ka advert. period */
  765. mac_t mac; /* FCF mac */
  766. };
  767. /*
  768. * Trunk states for BCU/BFAL
  769. */
  770. enum bfa_trunk_state {
  771. BFA_TRUNK_DISABLED = 0, /* Trunk is not configured */
  772. BFA_TRUNK_ONLINE = 1, /* Trunk is online */
  773. BFA_TRUNK_OFFLINE = 2, /* Trunk is offline */
  774. };
  775. /*
  776. * VC attributes for trunked link
  777. */
  778. struct bfa_trunk_vc_attr_s {
  779. u32 bb_credit;
  780. u32 elp_opmode_flags;
  781. u32 req_credit;
  782. u16 vc_credits[8];
  783. };
  784. /*
  785. * Link state information
  786. */
  787. struct bfa_port_link_s {
  788. u8 linkstate; /* Link state bfa_port_linkstate */
  789. u8 linkstate_rsn; /* bfa_port_linkstate_rsn_t */
  790. u8 topology; /* P2P/LOOP bfa_port_topology */
  791. u8 speed; /* Link speed (1/2/4/8 G) */
  792. u32 linkstate_opt; /* Linkstate optional data (debug) */
  793. u8 trunked; /* Trunked or not (1 or 0) */
  794. u8 resvd[3];
  795. struct bfa_qos_attr_s qos_attr; /* QoS Attributes */
  796. union {
  797. struct bfa_qos_vc_attr_s qos_vc_attr; /* VC info from ELP */
  798. struct bfa_trunk_vc_attr_s trunk_vc_attr;
  799. struct bfa_fcport_fcf_s fcf; /* FCF information (for FCoE) */
  800. } vc_fcf;
  801. };
  802. #pragma pack()
  803. enum bfa_trunk_link_fctl {
  804. BFA_TRUNK_LINK_FCTL_NORMAL,
  805. BFA_TRUNK_LINK_FCTL_VC,
  806. BFA_TRUNK_LINK_FCTL_VC_QOS,
  807. };
  808. enum bfa_trunk_link_state {
  809. BFA_TRUNK_LINK_STATE_UP = 1, /* link part of trunk */
  810. BFA_TRUNK_LINK_STATE_DN_LINKDN = 2, /* physical link down */
  811. BFA_TRUNK_LINK_STATE_DN_GRP_MIS = 3, /* trunk group different */
  812. BFA_TRUNK_LINK_STATE_DN_SPD_MIS = 4, /* speed mismatch */
  813. BFA_TRUNK_LINK_STATE_DN_MODE_MIS = 5, /* remote port not trunked */
  814. };
  815. #define BFA_TRUNK_MAX_PORTS 2
  816. struct bfa_trunk_link_attr_s {
  817. wwn_t trunk_wwn;
  818. enum bfa_trunk_link_fctl fctl;
  819. enum bfa_trunk_link_state link_state;
  820. enum bfa_port_speed speed;
  821. u32 deskew;
  822. };
  823. struct bfa_trunk_attr_s {
  824. enum bfa_trunk_state state;
  825. enum bfa_port_speed speed;
  826. u32 port_id;
  827. u32 rsvd;
  828. struct bfa_trunk_link_attr_s link_attr[BFA_TRUNK_MAX_PORTS];
  829. };
  830. struct bfa_rport_hal_stats_s {
  831. u32 sm_un_cr; /* uninit: create events */
  832. u32 sm_un_unexp; /* uninit: exception events */
  833. u32 sm_cr_on; /* created: online events */
  834. u32 sm_cr_del; /* created: delete events */
  835. u32 sm_cr_hwf; /* created: IOC down */
  836. u32 sm_cr_unexp; /* created: exception events */
  837. u32 sm_fwc_rsp; /* fw create: f/w responses */
  838. u32 sm_fwc_del; /* fw create: delete events */
  839. u32 sm_fwc_off; /* fw create: offline events */
  840. u32 sm_fwc_hwf; /* fw create: IOC down */
  841. u32 sm_fwc_unexp; /* fw create: exception events*/
  842. u32 sm_on_off; /* online: offline events */
  843. u32 sm_on_del; /* online: delete events */
  844. u32 sm_on_hwf; /* online: IOC down events */
  845. u32 sm_on_unexp; /* online: exception events */
  846. u32 sm_fwd_rsp; /* fw delete: fw responses */
  847. u32 sm_fwd_del; /* fw delete: delete events */
  848. u32 sm_fwd_hwf; /* fw delete: IOC down events */
  849. u32 sm_fwd_unexp; /* fw delete: exception events*/
  850. u32 sm_off_del; /* offline: delete events */
  851. u32 sm_off_on; /* offline: online events */
  852. u32 sm_off_hwf; /* offline: IOC down events */
  853. u32 sm_off_unexp; /* offline: exception events */
  854. u32 sm_del_fwrsp; /* delete: fw responses */
  855. u32 sm_del_hwf; /* delete: IOC down events */
  856. u32 sm_del_unexp; /* delete: exception events */
  857. u32 sm_delp_fwrsp; /* delete pend: fw responses */
  858. u32 sm_delp_hwf; /* delete pend: IOC downs */
  859. u32 sm_delp_unexp; /* delete pend: exceptions */
  860. u32 sm_offp_fwrsp; /* off-pending: fw responses */
  861. u32 sm_offp_del; /* off-pending: deletes */
  862. u32 sm_offp_hwf; /* off-pending: IOC downs */
  863. u32 sm_offp_unexp; /* off-pending: exceptions */
  864. u32 sm_iocd_off; /* IOC down: offline events */
  865. u32 sm_iocd_del; /* IOC down: delete events */
  866. u32 sm_iocd_on; /* IOC down: online events */
  867. u32 sm_iocd_unexp; /* IOC down: exceptions */
  868. u32 rsvd;
  869. };
  870. #pragma pack(1)
  871. /*
  872. * Rport's QoS attributes
  873. */
  874. struct bfa_rport_qos_attr_s {
  875. u8 qos_priority; /* rport's QoS priority */
  876. u8 rsvd[3];
  877. u32 qos_flow_id; /* QoS flow Id */
  878. };
  879. #pragma pack()
  880. #define BFA_IOBUCKET_MAX 14
  881. struct bfa_itnim_latency_s {
  882. u32 min[BFA_IOBUCKET_MAX];
  883. u32 max[BFA_IOBUCKET_MAX];
  884. u32 count[BFA_IOBUCKET_MAX];
  885. u32 avg[BFA_IOBUCKET_MAX];
  886. };
  887. struct bfa_itnim_ioprofile_s {
  888. u32 clock_res_mul;
  889. u32 clock_res_div;
  890. u32 index;
  891. u32 io_profile_start_time; /* IO profile start time */
  892. u32 iocomps[BFA_IOBUCKET_MAX]; /* IO completed */
  893. struct bfa_itnim_latency_s io_latency;
  894. };
  895. /*
  896. * FC physical port statistics.
  897. */
  898. struct bfa_port_fc_stats_s {
  899. u64 secs_reset; /* Seconds since stats is reset */
  900. u64 tx_frames; /* Tx frames */
  901. u64 tx_words; /* Tx words */
  902. u64 tx_lip; /* Tx LIP */
  903. u64 tx_nos; /* Tx NOS */
  904. u64 tx_ols; /* Tx OLS */
  905. u64 tx_lr; /* Tx LR */
  906. u64 tx_lrr; /* Tx LRR */
  907. u64 rx_frames; /* Rx frames */
  908. u64 rx_words; /* Rx words */
  909. u64 lip_count; /* Rx LIP */
  910. u64 nos_count; /* Rx NOS */
  911. u64 ols_count; /* Rx OLS */
  912. u64 lr_count; /* Rx LR */
  913. u64 lrr_count; /* Rx LRR */
  914. u64 invalid_crcs; /* Rx CRC err frames */
  915. u64 invalid_crc_gd_eof; /* Rx CRC err good EOF frames */
  916. u64 undersized_frm; /* Rx undersized frames */
  917. u64 oversized_frm; /* Rx oversized frames */
  918. u64 bad_eof_frm; /* Rx frames with bad EOF */
  919. u64 error_frames; /* Errored frames */
  920. u64 dropped_frames; /* Dropped frames */
  921. u64 link_failures; /* Link Failure (LF) count */
  922. u64 loss_of_syncs; /* Loss of sync count */
  923. u64 loss_of_signals; /* Loss of signal count */
  924. u64 primseq_errs; /* Primitive sequence protocol err. */
  925. u64 bad_os_count; /* Invalid ordered sets */
  926. u64 err_enc_out; /* Encoding err nonframe_8b10b */
  927. u64 err_enc; /* Encoding err frame_8b10b */
  928. };
  929. /*
  930. * Eth Physical Port statistics.
  931. */
  932. struct bfa_port_eth_stats_s {
  933. u64 secs_reset; /* Seconds since stats is reset */
  934. u64 frame_64; /* Frames 64 bytes */
  935. u64 frame_65_127; /* Frames 65-127 bytes */
  936. u64 frame_128_255; /* Frames 128-255 bytes */
  937. u64 frame_256_511; /* Frames 256-511 bytes */
  938. u64 frame_512_1023; /* Frames 512-1023 bytes */
  939. u64 frame_1024_1518; /* Frames 1024-1518 bytes */
  940. u64 frame_1519_1522; /* Frames 1519-1522 bytes */
  941. u64 tx_bytes; /* Tx bytes */
  942. u64 tx_packets; /* Tx packets */
  943. u64 tx_mcast_packets; /* Tx multicast packets */
  944. u64 tx_bcast_packets; /* Tx broadcast packets */
  945. u64 tx_control_frame; /* Tx control frame */
  946. u64 tx_drop; /* Tx drops */
  947. u64 tx_jabber; /* Tx jabber */
  948. u64 tx_fcs_error; /* Tx FCS errors */
  949. u64 tx_fragments; /* Tx fragments */
  950. u64 rx_bytes; /* Rx bytes */
  951. u64 rx_packets; /* Rx packets */
  952. u64 rx_mcast_packets; /* Rx multicast packets */
  953. u64 rx_bcast_packets; /* Rx broadcast packets */
  954. u64 rx_control_frames; /* Rx control frames */
  955. u64 rx_unknown_opcode; /* Rx unknown opcode */
  956. u64 rx_drop; /* Rx drops */
  957. u64 rx_jabber; /* Rx jabber */
  958. u64 rx_fcs_error; /* Rx FCS errors */
  959. u64 rx_alignment_error; /* Rx alignment errors */
  960. u64 rx_frame_length_error; /* Rx frame len errors */
  961. u64 rx_code_error; /* Rx code errors */
  962. u64 rx_fragments; /* Rx fragments */
  963. u64 rx_pause; /* Rx pause */
  964. u64 rx_zero_pause; /* Rx zero pause */
  965. u64 tx_pause; /* Tx pause */
  966. u64 tx_zero_pause; /* Tx zero pause */
  967. u64 rx_fcoe_pause; /* Rx FCoE pause */
  968. u64 rx_fcoe_zero_pause; /* Rx FCoE zero pause */
  969. u64 tx_fcoe_pause; /* Tx FCoE pause */
  970. u64 tx_fcoe_zero_pause; /* Tx FCoE zero pause */
  971. u64 rx_iscsi_pause; /* Rx iSCSI pause */
  972. u64 rx_iscsi_zero_pause; /* Rx iSCSI zero pause */
  973. u64 tx_iscsi_pause; /* Tx iSCSI pause */
  974. u64 tx_iscsi_zero_pause; /* Tx iSCSI zero pause */
  975. };
  976. /*
  977. * Port statistics.
  978. */
  979. union bfa_port_stats_u {
  980. struct bfa_port_fc_stats_s fc;
  981. struct bfa_port_eth_stats_s eth;
  982. };
  983. #endif /* __BFA_DEFS_SVC_H__ */