Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 226844
b: refs/heads/master
c: 15821f0
h: refs/heads/master
v: v3
  • Loading branch information
Krishna Gudipati authored and James Bottomley committed Dec 21, 2010
1 parent 14b5db3 commit 401bc39
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 17 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: b704495c6707013806d1b66507a967896e2b4a7c
refs/heads/master: 15821f05b78dbeb2f897d1d22576449103a4d8d5
8 changes: 5 additions & 3 deletions trunk/drivers/scsi/bfa/bfa_fcpim.c
Original file line number Diff line number Diff line change
Expand Up @@ -1540,8 +1540,8 @@ bfa_ioim_sm_active(struct bfa_ioim_s *ioim, enum bfa_ioim_event event)
break;

case BFA_IOIM_SM_SQRETRY:
if (bfa_ioim_get_iotag(ioim) != BFA_TRUE) {
/* max retry completed free IO */
if (bfa_ioim_maxretry_reached(ioim)) {
/* max retry reached, free IO */
bfa_sm_set_state(ioim, bfa_ioim_sm_hcb_free);
bfa_ioim_move_to_comp_q(ioim);
bfa_cb_queue(ioim->bfa, &ioim->hcb_qe,
Expand Down Expand Up @@ -1569,6 +1569,7 @@ bfa_ioim_sm_cmnd_retry(struct bfa_ioim_s *ioim, enum bfa_ioim_event event)
switch (event) {
case BFA_IOIM_SM_FREE:
/* abts and rrq done. Now retry the IO with new tag */
bfa_ioim_update_iotag(ioim);
if (!bfa_ioim_send_ioreq(ioim)) {
bfa_sm_set_state(ioim, bfa_ioim_sm_qfull);
break;
Expand Down Expand Up @@ -2526,7 +2527,7 @@ bfa_ioim_good_comp_isr(struct bfa_s *bfa, struct bfi_msg_s *m)
iotag = be16_to_cpu(rsp->io_tag);

ioim = BFA_IOIM_FROM_TAG(fcpim, iotag);
bfa_assert(ioim->iotag == iotag);
bfa_assert(BFA_IOIM_TAG_2_ID(ioim->iotag) == iotag);

bfa_trc_fp(ioim->bfa, ioim->iotag);
bfa_ioim_cb_profile_comp(fcpim, ioim);
Expand Down Expand Up @@ -2629,6 +2630,7 @@ bfa_ioim_free(struct bfa_ioim_s *ioim)
bfa_stats(ioim->itnim, io_comps);
fcpim->ios_active--;

ioim->iotag &= BFA_IOIM_IOTAG_MASK;
list_del(&ioim->qe);
list_add_tail(&ioim->qe, &fcpim->ioim_free_q);
}
Expand Down
22 changes: 12 additions & 10 deletions trunk/drivers/scsi/bfa/bfa_fcpim.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
(__itnim->ioprofile.iocomps[__index]++)

#define BFA_IOIM_RETRY_TAG_OFFSET 11
#define BFA_IOIM_RETRY_TAG_MASK 0x07ff /* 2K IOs */
#define BFA_IOIM_IOTAG_MASK 0x07ff /* 2K IOs */
#define BFA_IOIM_RETRY_MAX 7

/* Buckets are are 512 bytes to 2MB */
Expand Down Expand Up @@ -189,29 +189,31 @@ struct bfa_itnim_s {

#define bfa_itnim_is_online(_itnim) ((_itnim)->is_online)
#define BFA_FCPIM_MOD(_hal) (&(_hal)->modules.fcpim_mod)
#define BFA_IOIM_TAG_2_ID(_iotag) ((_iotag) & BFA_IOIM_IOTAG_MASK)
#define BFA_IOIM_FROM_TAG(_fcpim, _iotag) \
(&fcpim->ioim_arr[(_iotag & BFA_IOIM_RETRY_TAG_MASK)])
(&fcpim->ioim_arr[(_iotag & BFA_IOIM_IOTAG_MASK)])
#define BFA_TSKIM_FROM_TAG(_fcpim, _tmtag) \
(&fcpim->tskim_arr[_tmtag & (fcpim->num_tskim_reqs - 1)])

#define bfa_io_profile_start_time(_bfa) \
(_bfa->modules.fcpim_mod.io_profile_start_time)
#define bfa_fcpim_get_io_profile(_bfa) \
(_bfa->modules.fcpim_mod.io_profile)
#define bfa_ioim_update_iotag(__ioim) do { \
uint16_t k = (__ioim)->iotag >> BFA_IOIM_RETRY_TAG_OFFSET; \
k++; (__ioim)->iotag &= BFA_IOIM_IOTAG_MASK; \
(__ioim)->iotag |= k << BFA_IOIM_RETRY_TAG_OFFSET; \
} while (0)

static inline bfa_boolean_t
bfa_ioim_get_iotag(struct bfa_ioim_s *ioim)
bfa_ioim_maxretry_reached(struct bfa_ioim_s *ioim)
{
u16 k = ioim->iotag;

k >>= BFA_IOIM_RETRY_TAG_OFFSET; k++;

if (k > BFA_IOIM_RETRY_MAX)
uint16_t k = ioim->iotag >> BFA_IOIM_RETRY_TAG_OFFSET;
if (k < BFA_IOIM_RETRY_MAX)
return BFA_FALSE;
ioim->iotag &= BFA_IOIM_RETRY_TAG_MASK;
ioim->iotag |= k<<BFA_IOIM_RETRY_TAG_OFFSET;
return BFA_TRUE;
}

/*
* function prototypes
*/
Expand Down
8 changes: 6 additions & 2 deletions trunk/drivers/scsi/bfa/bfa_fcs_lport.c
Original file line number Diff line number Diff line change
Expand Up @@ -604,6 +604,7 @@ bfa_fcs_lport_uf_recv(struct bfa_fcs_lport_s *lport,
struct fc_els_cmd_s *els_cmd = (struct fc_els_cmd_s *) (fchs + 1);

bfa_stats(lport, uf_recvs);
bfa_trc(lport->fcs, fchs->type);

if (!bfa_fcs_lport_is_online(lport)) {
bfa_stats(lport, uf_recv_drops);
Expand Down Expand Up @@ -663,8 +664,11 @@ bfa_fcs_lport_uf_recv(struct bfa_fcs_lport_s *lport,
* Only handles ELS frames for now.
*/
if (fchs->type != FC_TYPE_ELS) {
bfa_trc(lport->fcs, fchs->type);
bfa_assert(0);
bfa_trc(lport->fcs, fchs->s_id);
bfa_trc(lport->fcs, fchs->d_id);
/* ignore type FC_TYPE_FC_FSS */
if (fchs->type != FC_TYPE_FC_FSS)
bfa_sm_fault(lport->fcs, fchs->type);
return;
}

Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/scsi/bfa/bfad_im.c
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ bfad_im_info(struct Scsi_Host *shost)
bfa_get_adapter_model(bfa, model);

memset(bfa_buf, 0, sizeof(bfa_buf));
if (ioc->ctdev)
if (ioc->ctdev && !ioc->fcmode)
snprintf(bfa_buf, sizeof(bfa_buf),
"Brocade FCOE Adapter, " "model: %s hwpath: %s driver: %s",
model, bfad->pci_name, BFAD_DRIVER_VERSION);
Expand Down

0 comments on commit 401bc39

Please sign in to comment.