diff options
author | Saurav Kashyap <saurav.kashyap@qlogic.com> | 2011-11-18 12:03:19 -0500 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2011-12-15 01:55:10 -0500 |
commit | a00f6296aaf92ebe89c72eb98c440410992a33c4 (patch) | |
tree | 2f26b6cce7ac888009b1eb549f9a00cdf864a382 | |
parent | 5162cf0c4e3962b28a9c8bc1ce89d266db67aa55 (diff) |
[SCSI] qla2xxx: Implement FCP priority tagging for 82xx adapters.
This provides a capability to set a priority in the FCP packet.
Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com>
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
-rw-r--r-- | drivers/scsi/qla2xxx/qla_bsg.c | 2 | ||||
-rw-r--r-- | drivers/scsi/qla2xxx/qla_init.c | 7 | ||||
-rw-r--r-- | drivers/scsi/qla2xxx/qla_iocb.c | 9 |
3 files changed, 16 insertions, 2 deletions
diff --git a/drivers/scsi/qla2xxx/qla_bsg.c b/drivers/scsi/qla2xxx/qla_bsg.c index 371d0de7e30b..c0bc0c6f084d 100644 --- a/drivers/scsi/qla2xxx/qla_bsg.c +++ b/drivers/scsi/qla2xxx/qla_bsg.c | |||
@@ -102,7 +102,7 @@ qla24xx_proc_fcp_prio_cfg_cmd(struct fc_bsg_job *bsg_job) | |||
102 | 102 | ||
103 | bsg_job->reply->reply_payload_rcv_len = 0; | 103 | bsg_job->reply->reply_payload_rcv_len = 0; |
104 | 104 | ||
105 | if (!(IS_QLA24XX_TYPE(ha) || IS_QLA25XX(ha))) { | 105 | if (!(IS_QLA24XX_TYPE(ha) || IS_QLA25XX(ha) || IS_QLA82XX(ha))) { |
106 | ret = -EINVAL; | 106 | ret = -EINVAL; |
107 | goto exit_fcp_prio_cfg; | 107 | goto exit_fcp_prio_cfg; |
108 | } | 108 | } |
diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c index ec73cc191273..05931e6469aa 100644 --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c | |||
@@ -5642,6 +5642,11 @@ qla24xx_update_fcport_fcp_prio(scsi_qla_host_t *vha, fc_port_t *fcport) | |||
5642 | if (priority < 0) | 5642 | if (priority < 0) |
5643 | return QLA_FUNCTION_FAILED; | 5643 | return QLA_FUNCTION_FAILED; |
5644 | 5644 | ||
5645 | if (IS_QLA82XX(vha->hw)) { | ||
5646 | fcport->fcp_prio = priority & 0xf; | ||
5647 | return QLA_SUCCESS; | ||
5648 | } | ||
5649 | |||
5645 | ret = qla24xx_set_fcp_prio(vha, fcport->loop_id, priority, mb); | 5650 | ret = qla24xx_set_fcp_prio(vha, fcport->loop_id, priority, mb); |
5646 | if (ret == QLA_SUCCESS) { | 5651 | if (ret == QLA_SUCCESS) { |
5647 | if (fcport->fcp_prio != priority) | 5652 | if (fcport->fcp_prio != priority) |
@@ -5650,7 +5655,7 @@ qla24xx_update_fcport_fcp_prio(scsi_qla_host_t *vha, fc_port_t *fcport) | |||
5650 | "port_id=%02x%02x%02x.\n", priority, | 5655 | "port_id=%02x%02x%02x.\n", priority, |
5651 | fcport->loop_id, fcport->d_id.b.domain, | 5656 | fcport->loop_id, fcport->d_id.b.domain, |
5652 | fcport->d_id.b.area, fcport->d_id.b.al_pa); | 5657 | fcport->d_id.b.area, fcport->d_id.b.al_pa); |
5653 | fcport->fcp_prio = priority; | 5658 | fcport->fcp_prio = priority & 0xf; |
5654 | } else | 5659 | } else |
5655 | ql_dbg(ql_dbg_user, vha, 0x704f, | 5660 | ql_dbg(ql_dbg_user, vha, 0x704f, |
5656 | "Unable to update FCP_CMND priority - ret=0x%x for " | 5661 | "Unable to update FCP_CMND priority - ret=0x%x for " |
diff --git a/drivers/scsi/qla2xxx/qla_iocb.c b/drivers/scsi/qla2xxx/qla_iocb.c index d2cc0ccfc202..841ffb34d416 100644 --- a/drivers/scsi/qla2xxx/qla_iocb.c +++ b/drivers/scsi/qla2xxx/qla_iocb.c | |||
@@ -2432,6 +2432,11 @@ sufficient_dsds: | |||
2432 | } | 2432 | } |
2433 | } | 2433 | } |
2434 | 2434 | ||
2435 | /* Populate the FCP_PRIO. */ | ||
2436 | if (ha->flags.fcp_prio_enabled) | ||
2437 | ctx->fcp_cmnd->task_attribute |= | ||
2438 | sp->fcport->fcp_prio << 3; | ||
2439 | |||
2435 | memcpy(ctx->fcp_cmnd->cdb, cmd->cmnd, cmd->cmd_len); | 2440 | memcpy(ctx->fcp_cmnd->cdb, cmd->cmnd, cmd->cmd_len); |
2436 | 2441 | ||
2437 | fcp_dl = (uint32_t *)(ctx->fcp_cmnd->cdb + 16 + | 2442 | fcp_dl = (uint32_t *)(ctx->fcp_cmnd->cdb + 16 + |
@@ -2501,6 +2506,10 @@ sufficient_dsds: | |||
2501 | } | 2506 | } |
2502 | } | 2507 | } |
2503 | 2508 | ||
2509 | /* Populate the FCP_PRIO. */ | ||
2510 | if (ha->flags.fcp_prio_enabled) | ||
2511 | cmd_pkt->task |= sp->fcport->fcp_prio << 3; | ||
2512 | |||
2504 | /* Load SCSI command packet. */ | 2513 | /* Load SCSI command packet. */ |
2505 | memcpy(cmd_pkt->fcp_cdb, cmd->cmnd, cmd->cmd_len); | 2514 | memcpy(cmd_pkt->fcp_cdb, cmd->cmnd, cmd->cmd_len); |
2506 | host_to_fcp_swap(cmd_pkt->fcp_cdb, sizeof(cmd_pkt->fcp_cdb)); | 2515 | host_to_fcp_swap(cmd_pkt->fcp_cdb, sizeof(cmd_pkt->fcp_cdb)); |