aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/qla2xxx
diff options
context:
space:
mode:
authorJoe Carnuccio <joe.carnuccio@qlogic.com>2012-05-15 14:34:21 -0400
committerJames Bottomley <JBottomley@Parallels.com>2012-05-22 06:38:40 -0400
commitc0822b63ccbf3b019059f384c290b080cae859f1 (patch)
tree07ec551c6ea4bcb279b20f18605933433b9bdbd0 /drivers/scsi/qla2xxx
parentc6d39e23d5f260a051b597a357d314698c33a58f (diff)
[SCSI] qla2xxx: Optimize existing port name server query matching.
Signed-off-by: Joe Carnuccio <joe.carnuccio@qlogic.com> Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/qla2xxx')
-rw-r--r--drivers/scsi/qla2xxx/qla_def.h3
-rw-r--r--drivers/scsi/qla2xxx/qla_init.c14
2 files changed, 8 insertions, 9 deletions
diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h
index f601a938fe9f..7aedd9011501 100644
--- a/drivers/scsi/qla2xxx/qla_def.h
+++ b/drivers/scsi/qla2xxx/qla_def.h
@@ -1723,6 +1723,9 @@ typedef struct fc_port {
1723 uint8_t scan_state; 1723 uint8_t scan_state;
1724} fc_port_t; 1724} fc_port_t;
1725 1725
1726#define QLA_FCPORT_SCAN_NONE 0
1727#define QLA_FCPORT_SCAN_FOUND 1
1728
1726/* 1729/*
1727 * Fibre channel port/lun states. 1730 * Fibre channel port/lun states.
1728 */ 1731 */
diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c
index 6c26e049c662..33a23eb1cf51 100644
--- a/drivers/scsi/qla2xxx/qla_init.c
+++ b/drivers/scsi/qla2xxx/qla_init.c
@@ -2499,6 +2499,7 @@ qla2x00_alloc_fcport(scsi_qla_host_t *vha, gfp_t flags)
2499 fcport->loop_id = FC_NO_LOOP_ID; 2499 fcport->loop_id = FC_NO_LOOP_ID;
2500 qla2x00_set_fcport_state(fcport, FCS_UNCONFIGURED); 2500 qla2x00_set_fcport_state(fcport, FCS_UNCONFIGURED);
2501 fcport->supported_classes = FC_COS_UNSPECIFIED; 2501 fcport->supported_classes = FC_COS_UNSPECIFIED;
2502 fcport->scan_state = QLA_FCPORT_SCAN_NONE;
2502 2503
2503 return fcport; 2504 return fcport;
2504} 2505}
@@ -2985,13 +2986,6 @@ qla2x00_configure_fabric(scsi_qla_host_t *vha)
2985 } 2986 }
2986 } 2987 }
2987 2988
2988#define QLA_FCPORT_SCAN 1
2989#define QLA_FCPORT_FOUND 2
2990
2991 list_for_each_entry(fcport, &vha->vp_fcports, list) {
2992 fcport->scan_state = QLA_FCPORT_SCAN;
2993 }
2994
2995 rval = qla2x00_find_all_fabric_devs(vha, &new_fcports); 2989 rval = qla2x00_find_all_fabric_devs(vha, &new_fcports);
2996 if (rval != QLA_SUCCESS) 2990 if (rval != QLA_SUCCESS)
2997 break; 2991 break;
@@ -3007,7 +3001,7 @@ qla2x00_configure_fabric(scsi_qla_host_t *vha)
3007 if ((fcport->flags & FCF_FABRIC_DEVICE) == 0) 3001 if ((fcport->flags & FCF_FABRIC_DEVICE) == 0)
3008 continue; 3002 continue;
3009 3003
3010 if (fcport->scan_state == QLA_FCPORT_SCAN && 3004 if (fcport->scan_state != QLA_FCPORT_SCAN_FOUND &&
3011 atomic_read(&fcport->state) == FCS_ONLINE) { 3005 atomic_read(&fcport->state) == FCS_ONLINE) {
3012 qla2x00_mark_device_lost(vha, fcport, 3006 qla2x00_mark_device_lost(vha, fcport,
3013 ql2xplogiabsentdevice, 0); 3007 ql2xplogiabsentdevice, 0);
@@ -3022,7 +3016,9 @@ qla2x00_configure_fabric(scsi_qla_host_t *vha)
3022 fcport->d_id.b.al_pa); 3016 fcport->d_id.b.al_pa);
3023 fcport->loop_id = FC_NO_LOOP_ID; 3017 fcport->loop_id = FC_NO_LOOP_ID;
3024 } 3018 }
3019 continue;
3025 } 3020 }
3021 fcport->scan_state = QLA_FCPORT_SCAN_NONE;
3026 } 3022 }
3027 3023
3028 /* Starting free loop ID. */ 3024 /* Starting free loop ID. */
@@ -3277,7 +3273,7 @@ qla2x00_find_all_fabric_devs(scsi_qla_host_t *vha,
3277 WWN_SIZE)) 3273 WWN_SIZE))
3278 continue; 3274 continue;
3279 3275
3280 fcport->scan_state = QLA_FCPORT_FOUND; 3276 fcport->scan_state = QLA_FCPORT_SCAN_FOUND;
3281 3277
3282 found++; 3278 found++;
3283 3279