aboutsummaryrefslogtreecommitdiffstats
path: root/include/scsi
diff options
context:
space:
mode:
authorVasu Dev <vasu.dev@intel.com>2009-08-25 16:58:53 -0400
committerJames Bottomley <James.Bottomley@suse.de>2009-09-05 10:47:37 -0400
commitb2f0091fbf8b475fa09b5e1712e0ab84cb3e1ca4 (patch)
tree98d3427aaae0b3d20d5fd077023b4ea23f5b575c /include/scsi
parente4bc50bedf0dd6c63f20a7bc0a2b46667664fba1 (diff)
[SCSI] fcoe, libfc: fully makes use of per cpu exch pool and then removes em_lock
1. Updates fcoe_rcv() to queue incoming frames to the fcoe per cpu thread on which this frame's exch was originated and simply use current cpu for request exch not originated by initiator. It is redundant to add this code under CONFIG_SMP, so removes CONFIG_SMP uses around this code. 2. Updates fc_exch_em_alloc, fc_exch_delete, fc_exch_find to use per cpu exch pools, here fc_exch_delete is rename of older fc_exch_mgr_delete_ep since ep/exch are now deleted in pools of EM and so brief new name is sufficient and better name. Updates these functions to map exch id to their index into exch pool using fc_cpu_mask, fc_cpu_order and EM min_xid. This mapping is as per detailed explanation about this in last patch and basically this is just as lower fc_cpu_mask bits of exch id as cpu number and upper bit sum of EM min_xid and exch index in pool. Uses pool next_index to keep track of exch allocation from pool along with pool_max_index as upper bound of exches array in pool. 3. Adds exch pool ptr to fc_exch to free exch to its pool in fc_exch_delete. 4. Updates fc_exch_mgr_reset to reset all exch pools of an EM, this required adding fc_exch_pool_reset func to reset exches in pool and then have fc_exch_mgr_reset call fc_exch_pool_reset for each pool within each EM for a lport. 5. Removes no longer needed exches array, em_lock, next_xid, and total_exches from struct fc_exch_mgr, these are not needed after use of per cpu exch pool, also removes not used max_read, last_read from struct fc_exch_mgr. 6. Updates locking notes for exch pool lock with fc_exch lock and uses pool lock in exch allocation, lookup and reset. Signed-off-by: Vasu Dev <vasu.dev@intel.com> Signed-off-by: Robert Love <robert.w.love@intel.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'include/scsi')
-rw-r--r--include/scsi/libfc.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/include/scsi/libfc.h b/include/scsi/libfc.h
index 32063389c4b0..53b38814d38a 100644
--- a/include/scsi/libfc.h
+++ b/include/scsi/libfc.h
@@ -368,6 +368,7 @@ struct fc_seq {
368 */ 368 */
369struct fc_exch { 369struct fc_exch {
370 struct fc_exch_mgr *em; /* exchange manager */ 370 struct fc_exch_mgr *em; /* exchange manager */
371 struct fc_exch_pool *pool; /* per cpu exches pool */
371 u32 state; /* internal driver state */ 372 u32 state; /* internal driver state */
372 u16 xid; /* our exchange ID */ 373 u16 xid; /* our exchange ID */
373 struct list_head ex_list; /* free or busy list linkage */ 374 struct list_head ex_list; /* free or busy list linkage */
@@ -1045,10 +1046,12 @@ struct fc_exch *fc_exch_alloc(struct fc_lport *lport, struct fc_frame *fp);
1045 */ 1046 */
1046struct fc_seq *fc_seq_start_next(struct fc_seq *sp); 1047struct fc_seq *fc_seq_start_next(struct fc_seq *sp);
1047 1048
1049
1048/* 1050/*
1049 * Reset an exchange manager, completing all sequences and exchanges. 1051 * Reset all EMs of a lport, releasing its all sequences and
1050 * If s_id is non-zero, reset only exchanges originating from that FID. 1052 * exchanges. If sid is non-zero, then reset only exchanges
1051 * If d_id is non-zero, reset only exchanges sending to that FID. 1053 * we sourced from that FID. If did is non-zero, reset only
1054 * exchanges destined to that FID.
1052 */ 1055 */
1053void fc_exch_mgr_reset(struct fc_lport *, u32 s_id, u32 d_id); 1056void fc_exch_mgr_reset(struct fc_lport *, u32 s_id, u32 d_id);
1054 1057