Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 204194
b: refs/heads/master
c: b85d045
h: refs/heads/master
v: v3
  • Loading branch information
Jing Huang authored and James Bottomley committed Jul 27, 2010
1 parent 8588bb2 commit ab05f4a
Show file tree
Hide file tree
Showing 17 changed files with 106 additions and 56 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 15b64a835def4c784c6e62ad762677f5cb56eba2
refs/heads/master: b85d045ee866011df535565bf12d684e8e5b7a9d
1 change: 1 addition & 0 deletions trunk/drivers/scsi/bfa/bfa_fcpim_priv.h
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ struct bfa_itnim_s {
struct bfa_reqq_wait_s reqq_wait; /* to wait for room in reqq */
struct bfa_fcpim_mod_s *fcpim; /* fcpim module */
struct bfa_itnim_hal_stats_s stats;
struct bfa_itnim_latency_s io_latency;
};

#define bfa_itnim_is_online(_itnim) ((_itnim)->is_online)
Expand Down
25 changes: 23 additions & 2 deletions trunk/drivers/scsi/bfa/bfa_fcport.c
Original file line number Diff line number Diff line change
Expand Up @@ -888,6 +888,7 @@ bfa_fcport_attach(struct bfa_s *bfa, void *bfad, struct bfa_iocfc_cfg_s *cfg,
struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa);
struct bfa_pport_cfg_s *port_cfg = &fcport->cfg;
struct bfa_fcport_ln_s *ln = &fcport->ln;
struct bfa_timeval_s tv;

bfa_os_memset(fcport, 0, sizeof(struct bfa_fcport_s));
fcport->bfa = bfa;
Expand All @@ -898,6 +899,12 @@ bfa_fcport_attach(struct bfa_s *bfa, void *bfad, struct bfa_iocfc_cfg_s *cfg,
bfa_sm_set_state(fcport, bfa_fcport_sm_uninit);
bfa_sm_set_state(ln, bfa_fcport_ln_sm_dn);

/**
* initialize time stamp for stats reset
*/
bfa_os_gettimeofday(&tv);
fcport->stats_reset_time = tv.tv_sec;

/**
* initialize and set default configuration
*/
Expand Down Expand Up @@ -1126,16 +1133,22 @@ __bfa_cb_fcport_stats_get(void *cbarg, bfa_boolean_t complete)

if (complete) {
if (fcport->stats_status == BFA_STATUS_OK) {
struct bfa_timeval_s tv;

/* Swap FC QoS or FCoE stats */
if (bfa_ioc_get_fcmode(&fcport->bfa->ioc))
if (bfa_ioc_get_fcmode(&fcport->bfa->ioc)) {
bfa_fcport_qos_stats_swap(
&fcport->stats_ret->fcqos,
&fcport->stats->fcqos);
else
} else {
bfa_fcport_fcoe_stats_swap(
&fcport->stats_ret->fcoe,
&fcport->stats->fcoe);

bfa_os_gettimeofday(&tv);
fcport->stats_ret->fcoe.secs_reset =
tv.tv_sec - fcport->stats_reset_time;
}
}
fcport->stats_cbfn(fcport->stats_cbarg, fcport->stats_status);
} else {
Expand Down Expand Up @@ -1191,6 +1204,14 @@ __bfa_cb_fcport_stats_clr(void *cbarg, bfa_boolean_t complete)
struct bfa_fcport_s *fcport = cbarg;

if (complete) {
struct bfa_timeval_s tv;

/**
* re-initialize time stamp for stats reset
*/
bfa_os_gettimeofday(&tv);
fcport->stats_reset_time = tv.tv_sec;

fcport->stats_cbfn(fcport->stats_cbarg, fcport->stats_status);
} else {
fcport->stats_busy = BFA_FALSE;
Expand Down
27 changes: 25 additions & 2 deletions trunk/drivers/scsi/bfa/bfa_port.c
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,14 @@ bfa_port_get_stats_isr(struct bfa_port_s *port, bfa_status_t status)
port->stats_busy = BFA_FALSE;

if (status == BFA_STATUS_OK) {
struct bfa_timeval_s tv;

memcpy(port->stats, port->stats_dma.kva,
sizeof(union bfa_pport_stats_u));
bfa_port_stats_swap(port, port->stats);

bfa_os_gettimeofday(&tv);
port->stats->fc.secs_reset = tv.tv_sec - port->stats_reset_time;
}

if (port->stats_cbfn) {
Expand All @@ -125,9 +130,17 @@ bfa_port_get_stats_isr(struct bfa_port_s *port, bfa_status_t status)
static void
bfa_port_clear_stats_isr(struct bfa_port_s *port, bfa_status_t status)
{
struct bfa_timeval_s tv;

port->stats_status = status;
port->stats_busy = BFA_FALSE;

/**
* re-initialize time stamp for stats reset
*/
bfa_os_gettimeofday(&tv);
port->stats_reset_time = tv.tv_sec;

if (port->stats_cbfn) {
port->stats_cbfn(port->stats_cbarg, status);
port->stats_cbfn = NULL;
Expand Down Expand Up @@ -428,20 +441,30 @@ void
bfa_port_attach(struct bfa_port_s *port, struct bfa_ioc_s *ioc, void *dev,
struct bfa_trc_mod_s *trcmod, struct bfa_log_mod_s *logmod)
{
struct bfa_timeval_s tv;

bfa_assert(port);

port->dev = dev;
port->ioc = ioc;
port->trcmod = trcmod;
port->logmod = logmod;

port->stats_busy = port->endis_pending = BFA_FALSE;
port->stats_cbfn = port->endis_cbfn = NULL;
port->stats_busy = BFA_FALSE;
port->endis_pending = BFA_FALSE;
port->stats_cbfn = NULL;
port->endis_cbfn = NULL;

bfa_ioc_mbox_regisr(port->ioc, BFI_MC_PORT, bfa_port_isr, port);
bfa_ioc_hbfail_init(&port->hbfail, bfa_port_hbfail, port);
bfa_ioc_hbfail_register(port->ioc, &port->hbfail);

/**
* initialize time stamp for stats reset
*/
bfa_os_gettimeofday(&tv);
port->stats_reset_time = tv.tv_sec;

bfa_trc(port, 0);
}

Expand Down
3 changes: 2 additions & 1 deletion trunk/drivers/scsi/bfa/bfa_port_priv.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,9 @@ struct bfa_fcport_s {
bfa_status_t stats_status; /* stats/statsclr status */
bfa_boolean_t stats_busy; /* outstanding stats/statsclr */
bfa_boolean_t stats_qfull;
u32 stats_reset_time; /* stats reset time stamp */
bfa_cb_pport_t stats_cbfn; /* driver callback function */
void *stats_cbarg; /* *!< user callback arg */
void *stats_cbarg; /* user callback arg */
bfa_boolean_t diag_busy; /* diag busy status */
bfa_boolean_t beacon; /* port beacon status */
bfa_boolean_t link_e2e_beacon; /* link beacon status */
Expand Down
13 changes: 0 additions & 13 deletions trunk/drivers/scsi/bfa/bfad_drv.h
Original file line number Diff line number Diff line change
Expand Up @@ -141,18 +141,6 @@ struct bfad_cfg_param_s {
u32 binding_method;
};

union bfad_tmp_buf {
/* From struct bfa_adapter_attr_s */
char manufacturer[BFA_ADAPTER_MFG_NAME_LEN];
char serial_num[BFA_ADAPTER_SERIAL_NUM_LEN];
char model[BFA_ADAPTER_MODEL_NAME_LEN];
char fw_ver[BFA_VERSION_LEN];
char optrom_ver[BFA_VERSION_LEN];

/* From struct bfa_ioc_pci_attr_s */
u8 chip_rev[BFA_IOC_CHIP_REV_LEN]; /* chip revision */
};

/*
* BFAD (PCI function) data structure
*/
Expand Down Expand Up @@ -195,7 +183,6 @@ struct bfad_s {
struct bfa_plog_s plog_buf;
int ref_count;
bfa_boolean_t ipfc_enabled;
union bfad_tmp_buf tmp_buf;
struct fc_host_statistics link_stats;
struct list_head pbc_pcfg_list;
};
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/scsi/bfa/fcpim.c
Original file line number Diff line number Diff line change
Expand Up @@ -738,6 +738,7 @@ bfa_fcs_itnim_attr_get(struct bfa_fcs_port_s *port, wwn_t rpwwn,
attr->rec_support = itnim->rec_support;
attr->conf_comp = itnim->conf_comp;
attr->task_retry_id = itnim->task_retry_id;
bfa_os_memset(&attr->io_latency, 0, sizeof(struct bfa_itnim_latency_s));

return BFA_STATUS_OK;
}
Expand Down
2 changes: 2 additions & 0 deletions trunk/drivers/scsi/bfa/include/bfa.h
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,8 @@ struct bfa_sge_s {
bfa_ioc_get_type(&(__bfa)->ioc)
#define bfa_get_mac(__bfa) \
bfa_ioc_get_mac(&(__bfa)->ioc)
#define bfa_get_fw_clock_res(__bfa) \
((__bfa)->iocfc.cfgrsp->fwcfg.fw_tick_res)

/*
* bfa API functions
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/scsi/bfa/include/cna/port/bfa_port.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ struct bfa_port_s {
bfa_port_stats_cbfn_t stats_cbfn;
void *stats_cbarg;
bfa_status_t stats_status;
u32 stats_reset_time;
union bfa_pport_stats_u *stats;
struct bfa_dma_s stats_dma;
bfa_boolean_t endis_pending;
Expand Down
6 changes: 3 additions & 3 deletions trunk/drivers/scsi/bfa/include/defs/bfa_defs_auth.h
Original file line number Diff line number Diff line change
Expand Up @@ -125,10 +125,10 @@ struct bfa_auth_attr_s {
enum bfa_auth_status status;
enum bfa_auth_algo algo;
enum bfa_auth_group dh_grp;
u16 rjt_code;
u16 rjt_code_exp;
enum bfa_auth_rej_code rjt_code;
enum bfa_auth_rej_code_exp rjt_code_exp;
u8 secret_set;
u8 resv[7];
u8 resv[3];
};

#endif /* __BFA_DEFS_AUTH_H__ */
26 changes: 10 additions & 16 deletions trunk/drivers/scsi/bfa/include/defs/bfa_defs_fcport.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ struct bfa_fcoe_stats_s {
u64 disc_fcf_unavail; /* Discovery FCF not avail */
u64 linksvc_unsupp; /* FIP link service req unsupp. */
u64 linksvc_err; /* FIP link service req errors */
u64 logo_req; /* FIP logo */
u64 logo_req; /* FIP logos received */
u64 clrvlink_req; /* Clear virtual link requests */
u64 op_unsupp; /* FIP operation unsupp. */
u64 untagged; /* FIP untagged frames */
Expand All @@ -64,21 +64,15 @@ struct bfa_fcoe_stats_s {
u64 txf_timeout; /* Tx timeouts */
u64 txf_parity_errors; /* Transmit parity err */
u64 txf_fid_parity_errors; /* Transmit FID parity err */
u64 tx_pause; /* Tx pause frames */
u64 tx_zero_pause; /* Tx zero pause frames */
u64 tx_first_pause; /* Tx first pause frames */
u64 rx_pause; /* Rx pause frames */
u64 rx_zero_pause; /* Rx zero pause frames */
u64 rx_first_pause; /* Rx first pause frames */
u64 rxf_ucast_octets; /* Rx unicast octets */
u64 rxf_ucast; /* Rx unicast frames */
u64 rxf_ucast_vlan; /* Rx unicast vlan frames */
u64 rxf_mcast_octets; /* Rx multicast octets */
u64 rxf_mcast; /* Rx multicast frames */
u64 rxf_mcast_vlan; /* Rx multicast vlan frames */
u64 rxf_bcast_octets; /* Rx broadcast octests */
u64 rxf_bcast; /* Rx broadcast frames */
u64 rxf_bcast_vlan; /* Rx broadcast vlan frames */
u64 rxf_ucast_octets; /* Rx FCoE unicast octets */
u64 rxf_ucast; /* Rx FCoE unicast frames */
u64 rxf_ucast_vlan; /* Rx FCoE unicast vlan frames */
u64 rxf_mcast_octets; /* Rx FCoE multicast octets */
u64 rxf_mcast; /* Rx FCoE multicast frames */
u64 rxf_mcast_vlan; /* Rx FCoE multicast vlan frames */
u64 rxf_bcast_octets; /* Rx FCoE broadcast octets */
u64 rxf_bcast; /* Rx FCoE broadcast frames */
u64 rxf_bcast_vlan; /* Rx FCoE broadcast vlan frames */
};

/**
Expand Down
12 changes: 8 additions & 4 deletions trunk/drivers/scsi/bfa/include/defs/bfa_defs_iocfc.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,10 @@ struct bfa_iocfc_fwcfg_s {
u16 num_tsktm_reqs; /* TM task management requests*/
u16 num_fcxp_reqs; /* unassisted FC exchanges */
u16 num_uf_bufs; /* unsolicited recv buffers */
u8 num_cqs;
u8 rsvd[5];
u8 num_cqs;
u8 fw_tick_res; /*!< FW clock resolution in ms */
u8 rsvd[4];

};

struct bfa_iocfc_drvcfg_s {
Expand Down Expand Up @@ -176,10 +178,10 @@ struct bfa_fw_port_fpg_stats_s {
u32 nos_rx;
u32 lip_rx;
u32 arbf0_rx;
u32 arb_rx;
u32 mrk_rx;
u32 const_mrk_rx;
u32 prim_unknown;
u32 rsvd;
};


Expand All @@ -200,6 +202,8 @@ struct bfa_fw_port_lksm_stats_s {
u32 lrr_tx; /* No. of times LRR tx started */
u32 ols_tx; /* No. of times OLS tx started */
u32 nos_tx; /* No. of times NOS tx started */
u32 hwsm_lrr_rx; /* No. of times LRR rx-ed by HWSM */
u32 hwsm_lr_rx; /* No. of times LR rx-ed by HWSM */
};


Expand Down Expand Up @@ -239,7 +243,7 @@ struct bfa_fw_fip_stats_s {
u32 disc_fcf_unavail; /* Discovery FCF Not Avail. */
u32 linksvc_unsupp; /* Unsupported link service req */
u32 linksvc_err; /* Parse error in link service req */
u32 logo_req; /* Number of FIP logos received */
u32 logo_req; /* FIP logos received */
u32 clrvlink_req; /* Clear virtual link req */
u32 op_unsupp; /* Unsupported FIP operation */
u32 untagged; /* Untagged frames (ignored) */
Expand Down
10 changes: 10 additions & 0 deletions trunk/drivers/scsi/bfa/include/defs/bfa_defs_itnim.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,15 @@ enum bfa_itnim_state {
BFA_ITNIM_INITIATIOR = 7, /* initiator */
};

struct bfa_itnim_latency_s {
u32 min;
u32 max;
u32 count;
u32 clock_res;
u32 avg;
u32 rsvd;
};

struct bfa_itnim_hal_stats_s {
u32 onlines; /* ITN nexus onlines (PRLI done) */
u32 offlines; /* ITN Nexus offlines */
Expand Down Expand Up @@ -91,6 +100,7 @@ struct bfa_itnim_attr_s {
u8 task_retry_id; /* task retry ident support */
u8 rec_support; /* REC supported */
u8 conf_comp; /* confirmed completion supp */
struct bfa_itnim_latency_s io_latency; /* IO latency */
};

/**
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/scsi/bfa/include/defs/bfa_defs_port.h
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ struct bfa_port_stats_s {
u32 ms_plogi_rsp_err;
u32 ms_plogi_acc_err;
u32 ms_plogi_accepts;
u32 ms_rejects; /* NS command rejects */
u32 ms_rejects; /* MS command rejects */
u32 ms_plogi_unknown_rsp;
u32 ms_plogi_alloc_wait;

Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/scsi/bfa/include/defs/bfa_defs_pport.h
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ struct bfa_pport_fc_stats_s {
u64 secs_reset; /* Seconds since stats is reset */
u64 tx_frames; /* Tx frames */
u64 tx_words; /* Tx words */
u64 tx_lip; /* TX LIP */
u64 tx_lip; /* Tx LIP */
u64 tx_nos; /* Tx NOS */
u64 tx_ols; /* Tx OLS */
u64 tx_lr; /* Tx LR */
Expand Down Expand Up @@ -312,7 +312,7 @@ struct bfa_pport_eth_stats_s {
u64 rx_zero_pause; /* Rx zero pause */
u64 tx_pause; /* Tx pause */
u64 tx_zero_pause; /* Tx zero pause */
u64 rx_fcoe_pause; /* Rx fcoe pause */
u64 rx_fcoe_pause; /* Rx FCoE pause */
u64 rx_fcoe_zero_pause; /* Rx FCoE zero pause */
u64 tx_fcoe_pause; /* Tx FCoE pause */
u64 tx_fcoe_zero_pause; /* Tx FCoE zero pause */
Expand Down
Loading

0 comments on commit ab05f4a

Please sign in to comment.