Skip to content

Commit

Permalink
[SCSI] libfc: avoid exchanges collision during lport reset
Browse files Browse the repository at this point in the history
Currently timer delay is large and is using msleep to avoid
avoid exchanges collision across lport reset, so instead
do this by initializing exches pool indexes during
reset also.

Signed-off-by: Vasu Dev <vasu.dev@intel.com>
Tested-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com>
Signed-off-by: Yi Zou <yi.zou@intel.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
  • Loading branch information
Vasu Dev authored and James Bottomley committed Oct 31, 2011
1 parent 14fc315 commit b6e3c84
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
4 changes: 4 additions & 0 deletions drivers/scsi/libfc/fc_exch.c
Original file line number Diff line number Diff line change
Expand Up @@ -1793,6 +1793,9 @@ static void fc_exch_pool_reset(struct fc_lport *lport,
goto restart;
}
}
pool->next_index = 0;
pool->left = FC_XID_UNKNOWN;
pool->right = FC_XID_UNKNOWN;
spin_unlock_bh(&pool->lock);
}

Expand Down Expand Up @@ -2281,6 +2284,7 @@ struct fc_exch_mgr *fc_exch_mgr_alloc(struct fc_lport *lport,
goto free_mempool;
for_each_possible_cpu(cpu) {
pool = per_cpu_ptr(mp->pool, cpu);
pool->next_index = 0;
pool->left = FC_XID_UNKNOWN;
pool->right = FC_XID_UNKNOWN;
spin_lock_init(&pool->lock);
Expand Down
10 changes: 1 addition & 9 deletions drivers/scsi/libfc/fc_lport.c
Original file line number Diff line number Diff line change
Expand Up @@ -1030,16 +1030,8 @@ static void fc_lport_enter_reset(struct fc_lport *lport)
FCH_EVT_LIPRESET, 0);
fc_vports_linkchange(lport);
fc_lport_reset_locked(lport);
if (lport->link_up) {
/*
* Wait upto resource allocation time out before
* doing re-login since incomplete FIP exchanged
* from last session may collide with exchanges
* in new session.
*/
msleep(lport->r_a_tov);
if (lport->link_up)
fc_lport_enter_flogi(lport);
}
}

/**
Expand Down

0 comments on commit b6e3c84

Please sign in to comment.