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