aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi')
-rw-r--r--drivers/scsi/bfa/bfa_fcpim_priv.h1
-rw-r--r--drivers/scsi/bfa/bfa_fcport.c25
-rw-r--r--drivers/scsi/bfa/bfa_port.c27
-rw-r--r--drivers/scsi/bfa/bfa_port_priv.h3
-rw-r--r--drivers/scsi/bfa/bfad_drv.h13
-rw-r--r--drivers/scsi/bfa/fcpim.c1
-rw-r--r--drivers/scsi/bfa/include/bfa.h2
-rw-r--r--drivers/scsi/bfa/include/cna/port/bfa_port.h1
-rw-r--r--drivers/scsi/bfa/include/defs/bfa_defs_auth.h6
-rw-r--r--drivers/scsi/bfa/include/defs/bfa_defs_fcport.h26
-rw-r--r--drivers/scsi/bfa/include/defs/bfa_defs_iocfc.h12
-rw-r--r--drivers/scsi/bfa/include/defs/bfa_defs_itnim.h10
-rw-r--r--drivers/scsi/bfa/include/defs/bfa_defs_port.h2
-rw-r--r--drivers/scsi/bfa/include/defs/bfa_defs_pport.h4
-rw-r--r--drivers/scsi/bfa/include/defs/bfa_defs_status.h24
-rw-r--r--drivers/scsi/bfa/ms.c3
16 files changed, 105 insertions, 55 deletions
diff --git a/drivers/scsi/bfa/bfa_fcpim_priv.h b/drivers/scsi/bfa/bfa_fcpim_priv.h
index 5cf418460f75..3db39da72427 100644
--- a/drivers/scsi/bfa/bfa_fcpim_priv.h
+++ b/drivers/scsi/bfa/bfa_fcpim_priv.h
@@ -141,6 +141,7 @@ struct bfa_itnim_s {
141 struct bfa_reqq_wait_s reqq_wait; /* to wait for room in reqq */ 141 struct bfa_reqq_wait_s reqq_wait; /* to wait for room in reqq */
142 struct bfa_fcpim_mod_s *fcpim; /* fcpim module */ 142 struct bfa_fcpim_mod_s *fcpim; /* fcpim module */
143 struct bfa_itnim_hal_stats_s stats; 143 struct bfa_itnim_hal_stats_s stats;
144 struct bfa_itnim_latency_s io_latency;
144}; 145};
145 146
146#define bfa_itnim_is_online(_itnim) ((_itnim)->is_online) 147#define bfa_itnim_is_online(_itnim) ((_itnim)->is_online)
diff --git a/drivers/scsi/bfa/bfa_fcport.c b/drivers/scsi/bfa/bfa_fcport.c
index d28b721acaf8..18d33072bec5 100644
--- a/drivers/scsi/bfa/bfa_fcport.c
+++ b/drivers/scsi/bfa/bfa_fcport.c
@@ -888,6 +888,7 @@ bfa_fcport_attach(struct bfa_s *bfa, void *bfad, struct bfa_iocfc_cfg_s *cfg,
888 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); 888 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa);
889 struct bfa_pport_cfg_s *port_cfg = &fcport->cfg; 889 struct bfa_pport_cfg_s *port_cfg = &fcport->cfg;
890 struct bfa_fcport_ln_s *ln = &fcport->ln; 890 struct bfa_fcport_ln_s *ln = &fcport->ln;
891 struct bfa_timeval_s tv;
891 892
892 bfa_os_memset(fcport, 0, sizeof(struct bfa_fcport_s)); 893 bfa_os_memset(fcport, 0, sizeof(struct bfa_fcport_s));
893 fcport->bfa = bfa; 894 fcport->bfa = bfa;
@@ -899,6 +900,12 @@ bfa_fcport_attach(struct bfa_s *bfa, void *bfad, struct bfa_iocfc_cfg_s *cfg,
899 bfa_sm_set_state(ln, bfa_fcport_ln_sm_dn); 900 bfa_sm_set_state(ln, bfa_fcport_ln_sm_dn);
900 901
901 /** 902 /**
903 * initialize time stamp for stats reset
904 */
905 bfa_os_gettimeofday(&tv);
906 fcport->stats_reset_time = tv.tv_sec;
907
908 /**
902 * initialize and set default configuration 909 * initialize and set default configuration
903 */ 910 */
904 port_cfg->topology = BFA_PPORT_TOPOLOGY_P2P; 911 port_cfg->topology = BFA_PPORT_TOPOLOGY_P2P;
@@ -1126,16 +1133,22 @@ __bfa_cb_fcport_stats_get(void *cbarg, bfa_boolean_t complete)
1126 1133
1127 if (complete) { 1134 if (complete) {
1128 if (fcport->stats_status == BFA_STATUS_OK) { 1135 if (fcport->stats_status == BFA_STATUS_OK) {
1136 struct bfa_timeval_s tv;
1129 1137
1130 /* Swap FC QoS or FCoE stats */ 1138 /* Swap FC QoS or FCoE stats */
1131 if (bfa_ioc_get_fcmode(&fcport->bfa->ioc)) 1139 if (bfa_ioc_get_fcmode(&fcport->bfa->ioc)) {
1132 bfa_fcport_qos_stats_swap( 1140 bfa_fcport_qos_stats_swap(
1133 &fcport->stats_ret->fcqos, 1141 &fcport->stats_ret->fcqos,
1134 &fcport->stats->fcqos); 1142 &fcport->stats->fcqos);
1135 else 1143 } else {
1136 bfa_fcport_fcoe_stats_swap( 1144 bfa_fcport_fcoe_stats_swap(
1137 &fcport->stats_ret->fcoe, 1145 &fcport->stats_ret->fcoe,
1138 &fcport->stats->fcoe); 1146 &fcport->stats->fcoe);
1147
1148 bfa_os_gettimeofday(&tv);
1149 fcport->stats_ret->fcoe.secs_reset =
1150 tv.tv_sec - fcport->stats_reset_time;
1151 }
1139 } 1152 }
1140 fcport->stats_cbfn(fcport->stats_cbarg, fcport->stats_status); 1153 fcport->stats_cbfn(fcport->stats_cbarg, fcport->stats_status);
1141 } else { 1154 } else {
@@ -1191,6 +1204,14 @@ __bfa_cb_fcport_stats_clr(void *cbarg, bfa_boolean_t complete)
1191 struct bfa_fcport_s *fcport = cbarg; 1204 struct bfa_fcport_s *fcport = cbarg;
1192 1205
1193 if (complete) { 1206 if (complete) {
1207 struct bfa_timeval_s tv;
1208
1209 /**
1210 * re-initialize time stamp for stats reset
1211 */
1212 bfa_os_gettimeofday(&tv);
1213 fcport->stats_reset_time = tv.tv_sec;
1214
1194 fcport->stats_cbfn(fcport->stats_cbarg, fcport->stats_status); 1215 fcport->stats_cbfn(fcport->stats_cbarg, fcport->stats_status);
1195 } else { 1216 } else {
1196 fcport->stats_busy = BFA_FALSE; 1217 fcport->stats_busy = BFA_FALSE;
diff --git a/drivers/scsi/bfa/bfa_port.c b/drivers/scsi/bfa/bfa_port.c
index cab19028361a..6773e2282ddc 100644
--- a/drivers/scsi/bfa/bfa_port.c
+++ b/drivers/scsi/bfa/bfa_port.c
@@ -102,9 +102,14 @@ bfa_port_get_stats_isr(struct bfa_port_s *port, bfa_status_t status)
102 port->stats_busy = BFA_FALSE; 102 port->stats_busy = BFA_FALSE;
103 103
104 if (status == BFA_STATUS_OK) { 104 if (status == BFA_STATUS_OK) {
105 struct bfa_timeval_s tv;
106
105 memcpy(port->stats, port->stats_dma.kva, 107 memcpy(port->stats, port->stats_dma.kva,
106 sizeof(union bfa_pport_stats_u)); 108 sizeof(union bfa_pport_stats_u));
107 bfa_port_stats_swap(port, port->stats); 109 bfa_port_stats_swap(port, port->stats);
110
111 bfa_os_gettimeofday(&tv);
112 port->stats->fc.secs_reset = tv.tv_sec - port->stats_reset_time;
108 } 113 }
109 114
110 if (port->stats_cbfn) { 115 if (port->stats_cbfn) {
@@ -125,9 +130,17 @@ bfa_port_get_stats_isr(struct bfa_port_s *port, bfa_status_t status)
125static void 130static void
126bfa_port_clear_stats_isr(struct bfa_port_s *port, bfa_status_t status) 131bfa_port_clear_stats_isr(struct bfa_port_s *port, bfa_status_t status)
127{ 132{
133 struct bfa_timeval_s tv;
134
128 port->stats_status = status; 135 port->stats_status = status;
129 port->stats_busy = BFA_FALSE; 136 port->stats_busy = BFA_FALSE;
130 137
138 /**
139 * re-initialize time stamp for stats reset
140 */
141 bfa_os_gettimeofday(&tv);
142 port->stats_reset_time = tv.tv_sec;
143
131 if (port->stats_cbfn) { 144 if (port->stats_cbfn) {
132 port->stats_cbfn(port->stats_cbarg, status); 145 port->stats_cbfn(port->stats_cbarg, status);
133 port->stats_cbfn = NULL; 146 port->stats_cbfn = NULL;
@@ -428,6 +441,8 @@ void
428bfa_port_attach(struct bfa_port_s *port, struct bfa_ioc_s *ioc, void *dev, 441bfa_port_attach(struct bfa_port_s *port, struct bfa_ioc_s *ioc, void *dev,
429 struct bfa_trc_mod_s *trcmod, struct bfa_log_mod_s *logmod) 442 struct bfa_trc_mod_s *trcmod, struct bfa_log_mod_s *logmod)
430{ 443{
444 struct bfa_timeval_s tv;
445
431 bfa_assert(port); 446 bfa_assert(port);
432 447
433 port->dev = dev; 448 port->dev = dev;
@@ -435,13 +450,21 @@ bfa_port_attach(struct bfa_port_s *port, struct bfa_ioc_s *ioc, void *dev,
435 port->trcmod = trcmod; 450 port->trcmod = trcmod;
436 port->logmod = logmod; 451 port->logmod = logmod;
437 452
438 port->stats_busy = port->endis_pending = BFA_FALSE; 453 port->stats_busy = BFA_FALSE;
439 port->stats_cbfn = port->endis_cbfn = NULL; 454 port->endis_pending = BFA_FALSE;
455 port->stats_cbfn = NULL;
456 port->endis_cbfn = NULL;
440 457
441 bfa_ioc_mbox_regisr(port->ioc, BFI_MC_PORT, bfa_port_isr, port); 458 bfa_ioc_mbox_regisr(port->ioc, BFI_MC_PORT, bfa_port_isr, port);
442 bfa_ioc_hbfail_init(&port->hbfail, bfa_port_hbfail, port); 459 bfa_ioc_hbfail_init(&port->hbfail, bfa_port_hbfail, port);
443 bfa_ioc_hbfail_register(port->ioc, &port->hbfail); 460 bfa_ioc_hbfail_register(port->ioc, &port->hbfail);
444 461
462 /**
463 * initialize time stamp for stats reset
464 */
465 bfa_os_gettimeofday(&tv);
466 port->stats_reset_time = tv.tv_sec;
467
445 bfa_trc(port, 0); 468 bfa_trc(port, 0);
446} 469}
447 470
diff --git a/drivers/scsi/bfa/bfa_port_priv.h b/drivers/scsi/bfa/bfa_port_priv.h
index c52fe56df0bd..c9ebe0426fa6 100644
--- a/drivers/scsi/bfa/bfa_port_priv.h
+++ b/drivers/scsi/bfa/bfa_port_priv.h
@@ -75,8 +75,9 @@ struct bfa_fcport_s {
75 bfa_status_t stats_status; /* stats/statsclr status */ 75 bfa_status_t stats_status; /* stats/statsclr status */
76 bfa_boolean_t stats_busy; /* outstanding stats/statsclr */ 76 bfa_boolean_t stats_busy; /* outstanding stats/statsclr */
77 bfa_boolean_t stats_qfull; 77 bfa_boolean_t stats_qfull;
78 u32 stats_reset_time; /* stats reset time stamp */
78 bfa_cb_pport_t stats_cbfn; /* driver callback function */ 79 bfa_cb_pport_t stats_cbfn; /* driver callback function */
79 void *stats_cbarg; /* *!< user callback arg */ 80 void *stats_cbarg; /* user callback arg */
80 bfa_boolean_t diag_busy; /* diag busy status */ 81 bfa_boolean_t diag_busy; /* diag busy status */
81 bfa_boolean_t beacon; /* port beacon status */ 82 bfa_boolean_t beacon; /* port beacon status */
82 bfa_boolean_t link_e2e_beacon; /* link beacon status */ 83 bfa_boolean_t link_e2e_beacon; /* link beacon status */
diff --git a/drivers/scsi/bfa/bfad_drv.h b/drivers/scsi/bfa/bfad_drv.h
index 2b58b29fe303..8629f64a5287 100644
--- a/drivers/scsi/bfa/bfad_drv.h
+++ b/drivers/scsi/bfa/bfad_drv.h
@@ -141,18 +141,6 @@ struct bfad_cfg_param_s {
141 u32 binding_method; 141 u32 binding_method;
142}; 142};
143 143
144union bfad_tmp_buf {
145 /* From struct bfa_adapter_attr_s */
146 char manufacturer[BFA_ADAPTER_MFG_NAME_LEN];
147 char serial_num[BFA_ADAPTER_SERIAL_NUM_LEN];
148 char model[BFA_ADAPTER_MODEL_NAME_LEN];
149 char fw_ver[BFA_VERSION_LEN];
150 char optrom_ver[BFA_VERSION_LEN];
151
152 /* From struct bfa_ioc_pci_attr_s */
153 u8 chip_rev[BFA_IOC_CHIP_REV_LEN]; /* chip revision */
154};
155
156/* 144/*
157 * BFAD (PCI function) data structure 145 * BFAD (PCI function) data structure
158 */ 146 */
@@ -195,7 +183,6 @@ struct bfad_s {
195 struct bfa_plog_s plog_buf; 183 struct bfa_plog_s plog_buf;
196 int ref_count; 184 int ref_count;
197 bfa_boolean_t ipfc_enabled; 185 bfa_boolean_t ipfc_enabled;
198 union bfad_tmp_buf tmp_buf;
199 struct fc_host_statistics link_stats; 186 struct fc_host_statistics link_stats;
200 struct list_head pbc_pcfg_list; 187 struct list_head pbc_pcfg_list;
201}; 188};
diff --git a/drivers/scsi/bfa/fcpim.c b/drivers/scsi/bfa/fcpim.c
index 8ae4a2cfa85b..412018196bd2 100644
--- a/drivers/scsi/bfa/fcpim.c
+++ b/drivers/scsi/bfa/fcpim.c
@@ -738,6 +738,7 @@ bfa_fcs_itnim_attr_get(struct bfa_fcs_port_s *port, wwn_t rpwwn,
738 attr->rec_support = itnim->rec_support; 738 attr->rec_support = itnim->rec_support;
739 attr->conf_comp = itnim->conf_comp; 739 attr->conf_comp = itnim->conf_comp;
740 attr->task_retry_id = itnim->task_retry_id; 740 attr->task_retry_id = itnim->task_retry_id;
741 bfa_os_memset(&attr->io_latency, 0, sizeof(struct bfa_itnim_latency_s));
741 742
742 return BFA_STATUS_OK; 743 return BFA_STATUS_OK;
743} 744}
diff --git a/drivers/scsi/bfa/include/bfa.h b/drivers/scsi/bfa/include/bfa.h
index 1f5966cfbd16..9519a6d81045 100644
--- a/drivers/scsi/bfa/include/bfa.h
+++ b/drivers/scsi/bfa/include/bfa.h
@@ -126,6 +126,8 @@ struct bfa_sge_s {
126 bfa_ioc_get_type(&(__bfa)->ioc) 126 bfa_ioc_get_type(&(__bfa)->ioc)
127#define bfa_get_mac(__bfa) \ 127#define bfa_get_mac(__bfa) \
128 bfa_ioc_get_mac(&(__bfa)->ioc) 128 bfa_ioc_get_mac(&(__bfa)->ioc)
129#define bfa_get_fw_clock_res(__bfa) \
130 ((__bfa)->iocfc.cfgrsp->fwcfg.fw_tick_res)
129 131
130/* 132/*
131 * bfa API functions 133 * bfa API functions
diff --git a/drivers/scsi/bfa/include/cna/port/bfa_port.h b/drivers/scsi/bfa/include/cna/port/bfa_port.h
index 7cbf17d3141b..d7babaf97848 100644
--- a/drivers/scsi/bfa/include/cna/port/bfa_port.h
+++ b/drivers/scsi/bfa/include/cna/port/bfa_port.h
@@ -37,6 +37,7 @@ struct bfa_port_s {
37 bfa_port_stats_cbfn_t stats_cbfn; 37 bfa_port_stats_cbfn_t stats_cbfn;
38 void *stats_cbarg; 38 void *stats_cbarg;
39 bfa_status_t stats_status; 39 bfa_status_t stats_status;
40 u32 stats_reset_time;
40 union bfa_pport_stats_u *stats; 41 union bfa_pport_stats_u *stats;
41 struct bfa_dma_s stats_dma; 42 struct bfa_dma_s stats_dma;
42 bfa_boolean_t endis_pending; 43 bfa_boolean_t endis_pending;
diff --git a/drivers/scsi/bfa/include/defs/bfa_defs_auth.h b/drivers/scsi/bfa/include/defs/bfa_defs_auth.h
index 45df32820911..f56ed871bb99 100644
--- a/drivers/scsi/bfa/include/defs/bfa_defs_auth.h
+++ b/drivers/scsi/bfa/include/defs/bfa_defs_auth.h
@@ -125,10 +125,10 @@ struct bfa_auth_attr_s {
125 enum bfa_auth_status status; 125 enum bfa_auth_status status;
126 enum bfa_auth_algo algo; 126 enum bfa_auth_algo algo;
127 enum bfa_auth_group dh_grp; 127 enum bfa_auth_group dh_grp;
128 u16 rjt_code; 128 enum bfa_auth_rej_code rjt_code;
129 u16 rjt_code_exp; 129 enum bfa_auth_rej_code_exp rjt_code_exp;
130 u8 secret_set; 130 u8 secret_set;
131 u8 resv[7]; 131 u8 resv[3];
132}; 132};
133 133
134#endif /* __BFA_DEFS_AUTH_H__ */ 134#endif /* __BFA_DEFS_AUTH_H__ */
diff --git a/drivers/scsi/bfa/include/defs/bfa_defs_fcport.h b/drivers/scsi/bfa/include/defs/bfa_defs_fcport.h
index a07ef4a3cd78..af86a6396439 100644
--- a/drivers/scsi/bfa/include/defs/bfa_defs_fcport.h
+++ b/drivers/scsi/bfa/include/defs/bfa_defs_fcport.h
@@ -48,7 +48,7 @@ struct bfa_fcoe_stats_s {
48 u64 disc_fcf_unavail; /* Discovery FCF not avail */ 48 u64 disc_fcf_unavail; /* Discovery FCF not avail */
49 u64 linksvc_unsupp; /* FIP link service req unsupp. */ 49 u64 linksvc_unsupp; /* FIP link service req unsupp. */
50 u64 linksvc_err; /* FIP link service req errors */ 50 u64 linksvc_err; /* FIP link service req errors */
51 u64 logo_req; /* FIP logo */ 51 u64 logo_req; /* FIP logos received */
52 u64 clrvlink_req; /* Clear virtual link requests */ 52 u64 clrvlink_req; /* Clear virtual link requests */
53 u64 op_unsupp; /* FIP operation unsupp. */ 53 u64 op_unsupp; /* FIP operation unsupp. */
54 u64 untagged; /* FIP untagged frames */ 54 u64 untagged; /* FIP untagged frames */
@@ -64,21 +64,15 @@ struct bfa_fcoe_stats_s {
64 u64 txf_timeout; /* Tx timeouts */ 64 u64 txf_timeout; /* Tx timeouts */
65 u64 txf_parity_errors; /* Transmit parity err */ 65 u64 txf_parity_errors; /* Transmit parity err */
66 u64 txf_fid_parity_errors; /* Transmit FID parity err */ 66 u64 txf_fid_parity_errors; /* Transmit FID parity err */
67 u64 tx_pause; /* Tx pause frames */ 67 u64 rxf_ucast_octets; /* Rx FCoE unicast octets */
68 u64 tx_zero_pause; /* Tx zero pause frames */ 68 u64 rxf_ucast; /* Rx FCoE unicast frames */
69 u64 tx_first_pause; /* Tx first pause frames */ 69 u64 rxf_ucast_vlan; /* Rx FCoE unicast vlan frames */
70 u64 rx_pause; /* Rx pause frames */ 70 u64 rxf_mcast_octets; /* Rx FCoE multicast octets */
71 u64 rx_zero_pause; /* Rx zero pause frames */ 71 u64 rxf_mcast; /* Rx FCoE multicast frames */
72 u64 rx_first_pause; /* Rx first pause frames */ 72 u64 rxf_mcast_vlan; /* Rx FCoE multicast vlan frames */
73 u64 rxf_ucast_octets; /* Rx unicast octets */ 73 u64 rxf_bcast_octets; /* Rx FCoE broadcast octets */
74 u64 rxf_ucast; /* Rx unicast frames */ 74 u64 rxf_bcast; /* Rx FCoE broadcast frames */
75 u64 rxf_ucast_vlan; /* Rx unicast vlan frames */ 75 u64 rxf_bcast_vlan; /* Rx FCoE broadcast vlan frames */
76 u64 rxf_mcast_octets; /* Rx multicast octets */
77 u64 rxf_mcast; /* Rx multicast frames */
78 u64 rxf_mcast_vlan; /* Rx multicast vlan frames */
79 u64 rxf_bcast_octets; /* Rx broadcast octests */
80 u64 rxf_bcast; /* Rx broadcast frames */
81 u64 rxf_bcast_vlan; /* Rx broadcast vlan frames */
82}; 76};
83 77
84/** 78/**
diff --git a/drivers/scsi/bfa/include/defs/bfa_defs_iocfc.h b/drivers/scsi/bfa/include/defs/bfa_defs_iocfc.h
index c290fb13d2d1..31e728a631ed 100644
--- a/drivers/scsi/bfa/include/defs/bfa_defs_iocfc.h
+++ b/drivers/scsi/bfa/include/defs/bfa_defs_iocfc.h
@@ -51,8 +51,10 @@ struct bfa_iocfc_fwcfg_s {
51 u16 num_tsktm_reqs; /* TM task management requests*/ 51 u16 num_tsktm_reqs; /* TM task management requests*/
52 u16 num_fcxp_reqs; /* unassisted FC exchanges */ 52 u16 num_fcxp_reqs; /* unassisted FC exchanges */
53 u16 num_uf_bufs; /* unsolicited recv buffers */ 53 u16 num_uf_bufs; /* unsolicited recv buffers */
54 u8 num_cqs; 54 u8 num_cqs;
55 u8 rsvd[5]; 55 u8 fw_tick_res; /*!< FW clock resolution in ms */
56 u8 rsvd[4];
57
56}; 58};
57 59
58struct bfa_iocfc_drvcfg_s { 60struct bfa_iocfc_drvcfg_s {
@@ -176,10 +178,10 @@ struct bfa_fw_port_fpg_stats_s {
176 u32 nos_rx; 178 u32 nos_rx;
177 u32 lip_rx; 179 u32 lip_rx;
178 u32 arbf0_rx; 180 u32 arbf0_rx;
181 u32 arb_rx;
179 u32 mrk_rx; 182 u32 mrk_rx;
180 u32 const_mrk_rx; 183 u32 const_mrk_rx;
181 u32 prim_unknown; 184 u32 prim_unknown;
182 u32 rsvd;
183}; 185};
184 186
185 187
@@ -200,6 +202,8 @@ struct bfa_fw_port_lksm_stats_s {
200 u32 lrr_tx; /* No. of times LRR tx started */ 202 u32 lrr_tx; /* No. of times LRR tx started */
201 u32 ols_tx; /* No. of times OLS tx started */ 203 u32 ols_tx; /* No. of times OLS tx started */
202 u32 nos_tx; /* No. of times NOS 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 */
203}; 207};
204 208
205 209
@@ -239,7 +243,7 @@ struct bfa_fw_fip_stats_s {
239 u32 disc_fcf_unavail; /* Discovery FCF Not Avail. */ 243 u32 disc_fcf_unavail; /* Discovery FCF Not Avail. */
240 u32 linksvc_unsupp; /* Unsupported link service req */ 244 u32 linksvc_unsupp; /* Unsupported link service req */
241 u32 linksvc_err; /* Parse error in link service req */ 245 u32 linksvc_err; /* Parse error in link service req */
242 u32 logo_req; /* Number of FIP logos received */ 246 u32 logo_req; /* FIP logos received */
243 u32 clrvlink_req; /* Clear virtual link req */ 247 u32 clrvlink_req; /* Clear virtual link req */
244 u32 op_unsupp; /* Unsupported FIP operation */ 248 u32 op_unsupp; /* Unsupported FIP operation */
245 u32 untagged; /* Untagged frames (ignored) */ 249 u32 untagged; /* Untagged frames (ignored) */
diff --git a/drivers/scsi/bfa/include/defs/bfa_defs_itnim.h b/drivers/scsi/bfa/include/defs/bfa_defs_itnim.h
index 2ec769903d24..d77788b3999a 100644
--- a/drivers/scsi/bfa/include/defs/bfa_defs_itnim.h
+++ b/drivers/scsi/bfa/include/defs/bfa_defs_itnim.h
@@ -34,6 +34,15 @@ enum bfa_itnim_state {
34 BFA_ITNIM_INITIATIOR = 7, /* initiator */ 34 BFA_ITNIM_INITIATIOR = 7, /* initiator */
35}; 35};
36 36
37struct bfa_itnim_latency_s {
38 u32 min;
39 u32 max;
40 u32 count;
41 u32 clock_res;
42 u32 avg;
43 u32 rsvd;
44};
45
37struct bfa_itnim_hal_stats_s { 46struct bfa_itnim_hal_stats_s {
38 u32 onlines; /* ITN nexus onlines (PRLI done) */ 47 u32 onlines; /* ITN nexus onlines (PRLI done) */
39 u32 offlines; /* ITN Nexus offlines */ 48 u32 offlines; /* ITN Nexus offlines */
@@ -91,6 +100,7 @@ struct bfa_itnim_attr_s {
91 u8 task_retry_id; /* task retry ident support */ 100 u8 task_retry_id; /* task retry ident support */
92 u8 rec_support; /* REC supported */ 101 u8 rec_support; /* REC supported */
93 u8 conf_comp; /* confirmed completion supp */ 102 u8 conf_comp; /* confirmed completion supp */
103 struct bfa_itnim_latency_s io_latency; /* IO latency */
94}; 104};
95 105
96/** 106/**
diff --git a/drivers/scsi/bfa/include/defs/bfa_defs_port.h b/drivers/scsi/bfa/include/defs/bfa_defs_port.h
index 752a81293d5a..ebdf0d1731a4 100644
--- a/drivers/scsi/bfa/include/defs/bfa_defs_port.h
+++ b/drivers/scsi/bfa/include/defs/bfa_defs_port.h
@@ -159,7 +159,7 @@ struct bfa_port_stats_s {
159 u32 ms_plogi_rsp_err; 159 u32 ms_plogi_rsp_err;
160 u32 ms_plogi_acc_err; 160 u32 ms_plogi_acc_err;
161 u32 ms_plogi_accepts; 161 u32 ms_plogi_accepts;
162 u32 ms_rejects; /* NS command rejects */ 162 u32 ms_rejects; /* MS command rejects */
163 u32 ms_plogi_unknown_rsp; 163 u32 ms_plogi_unknown_rsp;
164 u32 ms_plogi_alloc_wait; 164 u32 ms_plogi_alloc_wait;
165 165
diff --git a/drivers/scsi/bfa/include/defs/bfa_defs_pport.h b/drivers/scsi/bfa/include/defs/bfa_defs_pport.h
index de6181cf9677..2c2cec5ee278 100644
--- a/drivers/scsi/bfa/include/defs/bfa_defs_pport.h
+++ b/drivers/scsi/bfa/include/defs/bfa_defs_pport.h
@@ -246,7 +246,7 @@ struct bfa_pport_fc_stats_s {
246 u64 secs_reset; /* Seconds since stats is reset */ 246 u64 secs_reset; /* Seconds since stats is reset */
247 u64 tx_frames; /* Tx frames */ 247 u64 tx_frames; /* Tx frames */
248 u64 tx_words; /* Tx words */ 248 u64 tx_words; /* Tx words */
249 u64 tx_lip; /* TX LIP */ 249 u64 tx_lip; /* Tx LIP */
250 u64 tx_nos; /* Tx NOS */ 250 u64 tx_nos; /* Tx NOS */
251 u64 tx_ols; /* Tx OLS */ 251 u64 tx_ols; /* Tx OLS */
252 u64 tx_lr; /* Tx LR */ 252 u64 tx_lr; /* Tx LR */
@@ -312,7 +312,7 @@ struct bfa_pport_eth_stats_s {
312 u64 rx_zero_pause; /* Rx zero pause */ 312 u64 rx_zero_pause; /* Rx zero pause */
313 u64 tx_pause; /* Tx pause */ 313 u64 tx_pause; /* Tx pause */
314 u64 tx_zero_pause; /* Tx zero pause */ 314 u64 tx_zero_pause; /* Tx zero pause */
315 u64 rx_fcoe_pause; /* Rx fcoe pause */ 315 u64 rx_fcoe_pause; /* Rx FCoE pause */
316 u64 rx_fcoe_zero_pause; /* Rx FCoE zero pause */ 316 u64 rx_fcoe_zero_pause; /* Rx FCoE zero pause */
317 u64 tx_fcoe_pause; /* Tx FCoE pause */ 317 u64 tx_fcoe_pause; /* Tx FCoE pause */
318 u64 tx_fcoe_zero_pause; /* Tx FCoE zero pause */ 318 u64 tx_fcoe_zero_pause; /* Tx FCoE zero pause */
diff --git a/drivers/scsi/bfa/include/defs/bfa_defs_status.h b/drivers/scsi/bfa/include/defs/bfa_defs_status.h
index 819db5abf461..7cef900707c5 100644
--- a/drivers/scsi/bfa/include/defs/bfa_defs_status.h
+++ b/drivers/scsi/bfa/include/defs/bfa_defs_status.h
@@ -84,8 +84,9 @@ enum bfa_status {
84 BFA_STATUS_BADFRMHDR = 48, /* Bad frame header */ 84 BFA_STATUS_BADFRMHDR = 48, /* Bad frame header */
85 BFA_STATUS_BADFRMSZ = 49, /* Bad frame size check and replace 85 BFA_STATUS_BADFRMSZ = 49, /* Bad frame size check and replace
86 * SFP/cable */ 86 * SFP/cable */
87 BFA_STATUS_MISSINGFRM = 50, /* Missing frame check and replace 87 BFA_STATUS_MISSINGFRM = 50, /* Missing frame check and replace
88 * SFP/cable */ 88 * SFP/cable or for Mezz card check and
89 * replace pass through module */
89 BFA_STATUS_LINKTIMEOUT = 51, /* Link timeout check and replace 90 BFA_STATUS_LINKTIMEOUT = 51, /* Link timeout check and replace
90 * SFP/cable */ 91 * SFP/cable */
91 BFA_STATUS_NO_FCPIM_NEXUS = 52, /* No FCP Nexus exists with the 92 BFA_STATUS_NO_FCPIM_NEXUS = 52, /* No FCP Nexus exists with the
@@ -173,7 +174,7 @@ enum bfa_status {
173 BFA_STATUS_LEDTEST_OP = 109, /* LED test is operating */ 174 BFA_STATUS_LEDTEST_OP = 109, /* LED test is operating */
174 BFA_STATUS_CEE_NOT_DN = 110, /* eth port is not at down state, please 175 BFA_STATUS_CEE_NOT_DN = 110, /* eth port is not at down state, please
175 * bring down first */ 176 * bring down first */
176 BFA_STATUS_10G_SPD = 111, /* Speed setting not valid for 10G HBA */ 177 BFA_STATUS_10G_SPD = 111, /* Speed setting not valid for 10G CNA */
177 BFA_STATUS_IM_INV_TEAM_NAME = 112, /* Invalid team name */ 178 BFA_STATUS_IM_INV_TEAM_NAME = 112, /* Invalid team name */
178 BFA_STATUS_IM_DUP_TEAM_NAME = 113, /* Given team name already 179 BFA_STATUS_IM_DUP_TEAM_NAME = 113, /* Given team name already
179 * exists */ 180 * exists */
@@ -215,11 +216,11 @@ enum bfa_status {
215 BFA_STATUS_BAD_ASICBLK = 132, /* Bad ASIC block */ 216 BFA_STATUS_BAD_ASICBLK = 132, /* Bad ASIC block */
216 BFA_STATUS_NO_DRIVER = 133, /* Brocade adapter/driver not installed 217 BFA_STATUS_NO_DRIVER = 133, /* Brocade adapter/driver not installed
217 * or loaded */ 218 * or loaded */
218 BFA_STATUS_INVALID_MAC = 134, /* Invalid mac address */ 219 BFA_STATUS_INVALID_MAC = 134, /* Invalid MAC address */
219 BFA_STATUS_IM_NO_VLAN = 135, /* No VLANs configured on the adapter */ 220 BFA_STATUS_IM_NO_VLAN = 135, /* No VLANs configured on the adapter */
220 BFA_STATUS_IM_ETH_LB_FAILED = 136, /* Ethernet loopback test failed */ 221 BFA_STATUS_IM_ETH_LB_FAILED = 136, /* Ethernet loopback test failed */
221 BFA_STATUS_IM_PVID_REMOVE = 137, /* Cannot remove port vlan (PVID) */ 222 BFA_STATUS_IM_PVID_REMOVE = 137, /* Cannot remove port VLAN (PVID) */
222 BFA_STATUS_IM_PVID_EDIT = 138, /* Cannot edit port vlan (PVID) */ 223 BFA_STATUS_IM_PVID_EDIT = 138, /* Cannot edit port VLAN (PVID) */
223 BFA_STATUS_CNA_NO_BOOT = 139, /* Boot upload not allowed for CNA */ 224 BFA_STATUS_CNA_NO_BOOT = 139, /* Boot upload not allowed for CNA */
224 BFA_STATUS_IM_PVID_NON_ZERO = 140, /* Port VLAN ID (PVID) is Set to 225 BFA_STATUS_IM_PVID_NON_ZERO = 140, /* Port VLAN ID (PVID) is Set to
225 * Non-Zero Value */ 226 * Non-Zero Value */
@@ -233,14 +234,15 @@ enum bfa_status {
233 BFA_STATUS_INSUFFICIENT_PERMS = 144, /* User doesn't have sufficient 234 BFA_STATUS_INSUFFICIENT_PERMS = 144, /* User doesn't have sufficient
234 * permissions to execute the BCU 235 * permissions to execute the BCU
235 * application */ 236 * application */
236 BFA_STATUS_IM_INV_VLAN_NAME = 145, /* Invalid/Reserved Vlan name 237 BFA_STATUS_IM_INV_VLAN_NAME = 145, /* Invalid/Reserved VLAN name
237 * string. The name is not allowed 238 * string. The name is not allowed
238 * for the normal Vlans */ 239 * for the normal VLAN */
239 BFA_STATUS_CMD_NOTSUPP_CNA = 146, /* Command not supported for CNA */ 240 BFA_STATUS_CMD_NOTSUPP_CNA = 146, /* Command not supported for CNA */
240 BFA_STATUS_IM_PASSTHRU_EDIT = 147, /* Can not edit passthru vlan id */ 241 BFA_STATUS_IM_PASSTHRU_EDIT = 147, /* Can not edit passthrough VLAN
241 BFA_STATUS_IM_BIND_FAILED = 148, /*! < IM Driver bind operation 242 * id */
243 BFA_STATUS_IM_BIND_FAILED = 148, /* IM Driver bind operation
242 * failed */ 244 * failed */
243 BFA_STATUS_IM_UNBIND_FAILED = 149, /* ! < IM Driver unbind operation 245 BFA_STATUS_IM_UNBIND_FAILED = 149, /* IM Driver unbind operation
244 * failed */ 246 * failed */
245 BFA_STATUS_IM_PORT_IN_TEAM = 150, /* Port is already part of the 247 BFA_STATUS_IM_PORT_IN_TEAM = 150, /* Port is already part of the
246 * team */ 248 * team */
diff --git a/drivers/scsi/bfa/ms.c b/drivers/scsi/bfa/ms.c
index 5e8c8dee6c97..e776bcb49604 100644
--- a/drivers/scsi/bfa/ms.c
+++ b/drivers/scsi/bfa/ms.c
@@ -157,6 +157,7 @@ bfa_fcs_port_ms_sm_plogi(struct bfa_fcs_port_ms_s *ms, enum port_ms_event event)
157 * Start timer for a delayed retry 157 * Start timer for a delayed retry
158 */ 158 */
159 bfa_sm_set_state(ms, bfa_fcs_port_ms_sm_plogi_retry); 159 bfa_sm_set_state(ms, bfa_fcs_port_ms_sm_plogi_retry);
160 ms->port->stats.ms_retries++;
160 bfa_timer_start(BFA_FCS_GET_HAL_FROM_PORT(ms->port), &ms->timer, 161 bfa_timer_start(BFA_FCS_GET_HAL_FROM_PORT(ms->port), &ms->timer,
161 bfa_fcs_port_ms_timeout, ms, 162 bfa_fcs_port_ms_timeout, ms,
162 BFA_FCS_RETRY_TIMEOUT); 163 BFA_FCS_RETRY_TIMEOUT);
@@ -279,6 +280,7 @@ bfa_fcs_port_ms_sm_gmal(struct bfa_fcs_port_ms_s *ms, enum port_ms_event event)
279 */ 280 */
280 if (ms->retry_cnt++ < BFA_FCS_MS_CMD_MAX_RETRIES) { 281 if (ms->retry_cnt++ < BFA_FCS_MS_CMD_MAX_RETRIES) {
281 bfa_sm_set_state(ms, bfa_fcs_port_ms_sm_gmal_retry); 282 bfa_sm_set_state(ms, bfa_fcs_port_ms_sm_gmal_retry);
283 ms->port->stats.ms_retries++;
282 bfa_timer_start(BFA_FCS_GET_HAL_FROM_PORT(ms->port), 284 bfa_timer_start(BFA_FCS_GET_HAL_FROM_PORT(ms->port),
283 &ms->timer, bfa_fcs_port_ms_timeout, ms, 285 &ms->timer, bfa_fcs_port_ms_timeout, ms,
284 BFA_FCS_RETRY_TIMEOUT); 286 BFA_FCS_RETRY_TIMEOUT);
@@ -479,6 +481,7 @@ bfa_fcs_port_ms_sm_gfn(struct bfa_fcs_port_ms_s *ms, enum port_ms_event event)
479 */ 481 */
480 if (ms->retry_cnt++ < BFA_FCS_MS_CMD_MAX_RETRIES) { 482 if (ms->retry_cnt++ < BFA_FCS_MS_CMD_MAX_RETRIES) {
481 bfa_sm_set_state(ms, bfa_fcs_port_ms_sm_gfn_retry); 483 bfa_sm_set_state(ms, bfa_fcs_port_ms_sm_gfn_retry);
484 ms->port->stats.ms_retries++;
482 bfa_timer_start(BFA_FCS_GET_HAL_FROM_PORT(ms->port), 485 bfa_timer_start(BFA_FCS_GET_HAL_FROM_PORT(ms->port),
483 &ms->timer, bfa_fcs_port_ms_timeout, ms, 486 &ms->timer, bfa_fcs_port_ms_timeout, ms,
484 BFA_FCS_RETRY_TIMEOUT); 487 BFA_FCS_RETRY_TIMEOUT);