bfa_defs_svc.h 37 KB

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