bfa_defs_svc.h 37 KB

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