diff options
author | Anirban Chakraborty <anirban.chakraborty@qlogic.com> | 2009-04-07 01:33:40 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@HansenPartnership.com> | 2009-05-20 18:21:07 -0400 |
commit | 2afa19a9377ca61b9489e44bf50029574fbe63be (patch) | |
tree | cdfa3878eb04d833bbcd9ce92196bc4456b5ccf5 /drivers/scsi/qla2xxx/qla_attr.c | |
parent | 7640335ea5b1a2da0d64303e6003012c619ae01a (diff) |
[SCSI] qla2xxx: Add QoS support.
Set the number of request queues to the module paramater
ql2xmaxqueues. Each vport gets a request queue. The QoS value
set to the request queues determines priority control for queued
IOs. If QoS value is not specified, the vports use the default
queue 0.
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/qla2xxx/qla_attr.c')
-rw-r--r-- | drivers/scsi/qla2xxx/qla_attr.c | 47 |
1 files changed, 30 insertions, 17 deletions
diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c index 5d44e3e6488c..bda6658d4fbf 100644 --- a/drivers/scsi/qla2xxx/qla_attr.c +++ b/drivers/scsi/qla2xxx/qla_attr.c | |||
@@ -1469,11 +1469,12 @@ static int | |||
1469 | qla24xx_vport_create(struct fc_vport *fc_vport, bool disable) | 1469 | qla24xx_vport_create(struct fc_vport *fc_vport, bool disable) |
1470 | { | 1470 | { |
1471 | int ret = 0; | 1471 | int ret = 0; |
1472 | int cnt = 0; | 1472 | uint8_t qos = 0; |
1473 | uint8_t qos = QLA_DEFAULT_QUE_QOS; | ||
1474 | scsi_qla_host_t *base_vha = shost_priv(fc_vport->shost); | 1473 | scsi_qla_host_t *base_vha = shost_priv(fc_vport->shost); |
1475 | scsi_qla_host_t *vha = NULL; | 1474 | scsi_qla_host_t *vha = NULL; |
1476 | struct qla_hw_data *ha = base_vha->hw; | 1475 | struct qla_hw_data *ha = base_vha->hw; |
1476 | uint16_t options = 0; | ||
1477 | int cnt; | ||
1477 | 1478 | ||
1478 | ret = qla24xx_vport_create_req_sanity_check(fc_vport); | 1479 | ret = qla24xx_vport_create_req_sanity_check(fc_vport); |
1479 | if (ret) { | 1480 | if (ret) { |
@@ -1529,23 +1530,35 @@ qla24xx_vport_create(struct fc_vport *fc_vport, bool disable) | |||
1529 | 1530 | ||
1530 | qla24xx_vport_disable(fc_vport, disable); | 1531 | qla24xx_vport_disable(fc_vport, disable); |
1531 | 1532 | ||
1532 | /* Create a queue pair for the vport */ | 1533 | ret = 0; |
1533 | if (ha->mqenable) { | 1534 | if (ha->cur_vport_count <= ha->flex_port_count |
1534 | if (ha->npiv_info) { | 1535 | || ha->max_req_queues == 1 || !ha->npiv_info) |
1535 | for (; cnt < ha->nvram_npiv_size; cnt++) { | 1536 | goto vport_queue; |
1536 | if (ha->npiv_info[cnt].port_name == | 1537 | /* Create a request queue in QoS mode for the vport */ |
1537 | vha->port_name && | 1538 | for (cnt = ha->flex_port_count; cnt < ha->nvram_npiv_size; cnt++) { |
1538 | ha->npiv_info[cnt].node_name == | 1539 | if (ha->npiv_info[cnt].port_name == vha->port_name && |
1539 | vha->node_name) { | 1540 | ha->npiv_info[cnt].node_name == vha->node_name) { |
1540 | qos = ha->npiv_info[cnt].q_qos; | 1541 | qos = ha->npiv_info[cnt].q_qos; |
1541 | break; | 1542 | break; |
1542 | } | ||
1543 | } | ||
1544 | } | 1543 | } |
1545 | qla25xx_create_queues(vha, qos); | 1544 | } |
1545 | if (qos) { | ||
1546 | ret = qla25xx_create_req_que(ha, options, vha->vp_idx, 0, 0, | ||
1547 | qos); | ||
1548 | if (!ret) | ||
1549 | qla_printk(KERN_WARNING, ha, | ||
1550 | "Can't create request queue for vp_idx:%d\n", | ||
1551 | vha->vp_idx); | ||
1552 | else | ||
1553 | DEBUG2(qla_printk(KERN_INFO, ha, | ||
1554 | "Request Que:%d created for vp_idx:%d\n", | ||
1555 | ret, vha->vp_idx)); | ||
1546 | } | 1556 | } |
1547 | 1557 | ||
1558 | vport_queue: | ||
1559 | vha->req = ha->req_q_map[ret]; | ||
1548 | return 0; | 1560 | return 0; |
1561 | |||
1549 | vport_create_failed_2: | 1562 | vport_create_failed_2: |
1550 | qla24xx_disable_vp(vha); | 1563 | qla24xx_disable_vp(vha); |
1551 | qla24xx_deallocate_vp_id(vha); | 1564 | qla24xx_deallocate_vp_id(vha); |
@@ -1586,8 +1599,8 @@ qla24xx_vport_delete(struct fc_vport *fc_vport) | |||
1586 | vha->host_no, vha->vp_idx, vha)); | 1599 | vha->host_no, vha->vp_idx, vha)); |
1587 | } | 1600 | } |
1588 | 1601 | ||
1589 | if (ha->mqenable) { | 1602 | if (vha->req->id) { |
1590 | if (qla25xx_delete_queues(vha, 0) != QLA_SUCCESS) | 1603 | if (qla25xx_delete_req_que(vha, vha->req) != QLA_SUCCESS) |
1591 | qla_printk(KERN_WARNING, ha, | 1604 | qla_printk(KERN_WARNING, ha, |
1592 | "Queue delete failed.\n"); | 1605 | "Queue delete failed.\n"); |
1593 | } | 1606 | } |