diff options
author | Anirban Chakraborty <anirban.chakraborty@qlogic.com> | 2009-06-03 12:55:16 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@HansenPartnership.com> | 2009-06-08 15:46:39 -0400 |
commit | 40859ae5f13534624cc35a05179b4f93ecbf531a (patch) | |
tree | 2023f47deed9d145c2a63ee77085ac2e8c90b798 /drivers/scsi | |
parent | 1b91a2e6712393cffc33eeff5cf857f7d5b62fed (diff) |
[SCSI] qla2xxx: Correct queue-creation bug when driver loaded in QoS mode.
Signed-off-by: Anirban Chakraborty <anirban.chakraborty@qlogic.com>
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers/scsi')
-rw-r--r-- | drivers/scsi/qla2xxx/qla_attr.c | 14 | ||||
-rw-r--r-- | drivers/scsi/qla2xxx/qla_def.h | 1 | ||||
-rw-r--r-- | drivers/scsi/qla2xxx/qla_os.c | 1 | ||||
-rw-r--r-- | drivers/scsi/qla2xxx/qla_sup.c | 8 |
4 files changed, 11 insertions, 13 deletions
diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c index 9aa00f25aa6a..2bd017ffb084 100644 --- a/drivers/scsi/qla2xxx/qla_attr.c +++ b/drivers/scsi/qla2xxx/qla_attr.c | |||
@@ -1651,13 +1651,13 @@ qla24xx_vport_create(struct fc_vport *fc_vport, bool disable) | |||
1651 | qla24xx_vport_disable(fc_vport, disable); | 1651 | qla24xx_vport_disable(fc_vport, disable); |
1652 | 1652 | ||
1653 | ret = 0; | 1653 | ret = 0; |
1654 | if (ha->cur_vport_count <= ha->flex_port_count || ql2xmultique_tag | 1654 | if (ql2xmaxqueues == 1 || ql2xmultique_tag || !ha->npiv_info) |
1655 | || ha->max_req_queues == 1 || !ha->npiv_info) | ||
1656 | goto vport_queue; | 1655 | goto vport_queue; |
1657 | /* Create a request queue in QoS mode for the vport */ | 1656 | /* Create a request queue in QoS mode for the vport */ |
1658 | for (cnt = ha->flex_port_count; cnt < ha->nvram_npiv_size; cnt++) { | 1657 | for (cnt = 0; cnt < ha->nvram_npiv_size; cnt++) { |
1659 | if (ha->npiv_info[cnt].port_name == vha->port_name && | 1658 | if (memcmp(ha->npiv_info[cnt].port_name, vha->port_name, 8) == 0 |
1660 | ha->npiv_info[cnt].node_name == vha->node_name) { | 1659 | && memcmp(ha->npiv_info[cnt].node_name, vha->node_name, |
1660 | 8) == 0) { | ||
1661 | qos = ha->npiv_info[cnt].q_qos; | 1661 | qos = ha->npiv_info[cnt].q_qos; |
1662 | break; | 1662 | break; |
1663 | } | 1663 | } |
@@ -1671,8 +1671,8 @@ qla24xx_vport_create(struct fc_vport *fc_vport, bool disable) | |||
1671 | vha->vp_idx); | 1671 | vha->vp_idx); |
1672 | else | 1672 | else |
1673 | DEBUG2(qla_printk(KERN_INFO, ha, | 1673 | DEBUG2(qla_printk(KERN_INFO, ha, |
1674 | "Request Que:%d created for vp_idx:%d\n", | 1674 | "Request Que:%d (QoS: %d) created for vp_idx:%d\n", |
1675 | ret, vha->vp_idx)); | 1675 | ret, qos, vha->vp_idx)); |
1676 | } | 1676 | } |
1677 | 1677 | ||
1678 | vport_queue: | 1678 | vport_queue: |
diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h index bb6bfd7b35f3..4e846ae928aa 100644 --- a/drivers/scsi/qla2xxx/qla_def.h +++ b/drivers/scsi/qla2xxx/qla_def.h | |||
@@ -2545,7 +2545,6 @@ struct qla_hw_data { | |||
2545 | uint16_t num_vsans; /* number of vsan created */ | 2545 | uint16_t num_vsans; /* number of vsan created */ |
2546 | uint16_t max_npiv_vports; /* 63 or 125 per topoloty */ | 2546 | uint16_t max_npiv_vports; /* 63 or 125 per topoloty */ |
2547 | int cur_vport_count; | 2547 | int cur_vport_count; |
2548 | uint16_t flex_port_count; | ||
2549 | 2548 | ||
2550 | struct qla_chip_state_84xx *cs84xx; | 2549 | struct qla_chip_state_84xx *cs84xx; |
2551 | struct qla_statistics qla_stats; | 2550 | struct qla_statistics qla_stats; |
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index 7415ead92154..181ed971a2ff 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c | |||
@@ -1853,6 +1853,7 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) | |||
1853 | ha->init_cb_size = sizeof(struct mid_init_cb_81xx); | 1853 | ha->init_cb_size = sizeof(struct mid_init_cb_81xx); |
1854 | ha->gid_list_info_size = 8; | 1854 | ha->gid_list_info_size = 8; |
1855 | ha->optrom_size = OPTROM_SIZE_81XX; | 1855 | ha->optrom_size = OPTROM_SIZE_81XX; |
1856 | ha->nvram_npiv_size = QLA_MAX_VPORTS_QLA25XX; | ||
1856 | ha->isp_ops = &qla81xx_isp_ops; | 1857 | ha->isp_ops = &qla81xx_isp_ops; |
1857 | ha->flash_conf_off = FARX_ACCESS_FLASH_CONF_81XX; | 1858 | ha->flash_conf_off = FARX_ACCESS_FLASH_CONF_81XX; |
1858 | ha->flash_data_off = FARX_ACCESS_FLASH_DATA_81XX; | 1859 | ha->flash_data_off = FARX_ACCESS_FLASH_DATA_81XX; |
diff --git a/drivers/scsi/qla2xxx/qla_sup.c b/drivers/scsi/qla2xxx/qla_sup.c index 22f97eb50cf9..e239203f19f7 100644 --- a/drivers/scsi/qla2xxx/qla_sup.c +++ b/drivers/scsi/qla2xxx/qla_sup.c | |||
@@ -920,12 +920,13 @@ qla2xxx_flash_npiv_conf(scsi_qla_host_t *vha) | |||
920 | 920 | ||
921 | entry = data + sizeof(struct qla_npiv_header); | 921 | entry = data + sizeof(struct qla_npiv_header); |
922 | cnt = le16_to_cpu(hdr.entries); | 922 | cnt = le16_to_cpu(hdr.entries); |
923 | ha->flex_port_count = cnt; | ||
924 | for (i = 0; cnt; cnt--, entry++, i++) { | 923 | for (i = 0; cnt; cnt--, entry++, i++) { |
925 | uint16_t flags; | 924 | uint16_t flags; |
926 | struct fc_vport_identifiers vid; | 925 | struct fc_vport_identifiers vid; |
927 | struct fc_vport *vport; | 926 | struct fc_vport *vport; |
928 | 927 | ||
928 | memcpy(&ha->npiv_info[i], entry, sizeof(struct qla_npiv_entry)); | ||
929 | |||
929 | flags = le16_to_cpu(entry->flags); | 930 | flags = le16_to_cpu(entry->flags); |
930 | if (flags == 0xffff) | 931 | if (flags == 0xffff) |
931 | continue; | 932 | continue; |
@@ -939,9 +940,7 @@ qla2xxx_flash_npiv_conf(scsi_qla_host_t *vha) | |||
939 | vid.port_name = wwn_to_u64(entry->port_name); | 940 | vid.port_name = wwn_to_u64(entry->port_name); |
940 | vid.node_name = wwn_to_u64(entry->node_name); | 941 | vid.node_name = wwn_to_u64(entry->node_name); |
941 | 942 | ||
942 | memcpy(&ha->npiv_info[i], entry, sizeof(struct qla_npiv_entry)); | 943 | DEBUG2(qla_printk(KERN_INFO, ha, "NPIV[%02x]: wwpn=%llx " |
943 | |||
944 | DEBUG2(qla_printk(KERN_DEBUG, ha, "NPIV[%02x]: wwpn=%llx " | ||
945 | "wwnn=%llx vf_id=0x%x Q_qos=0x%x F_qos=0x%x.\n", cnt, | 944 | "wwnn=%llx vf_id=0x%x Q_qos=0x%x F_qos=0x%x.\n", cnt, |
946 | vid.port_name, vid.node_name, le16_to_cpu(entry->vf_id), | 945 | vid.port_name, vid.node_name, le16_to_cpu(entry->vf_id), |
947 | entry->q_qos, entry->f_qos)); | 946 | entry->q_qos, entry->f_qos)); |
@@ -957,7 +956,6 @@ qla2xxx_flash_npiv_conf(scsi_qla_host_t *vha) | |||
957 | } | 956 | } |
958 | done: | 957 | done: |
959 | kfree(data); | 958 | kfree(data); |
960 | ha->npiv_info = NULL; | ||
961 | } | 959 | } |
962 | 960 | ||
963 | static int | 961 | static int |