diff options
author | Anirban Chakraborty <anirban.chakraborty@qlogic.com> | 2009-04-07 01:33:41 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@HansenPartnership.com> | 2009-05-20 18:21:08 -0400 |
commit | 68ca949cdb04b4dc71451a999148fbc5f187a220 (patch) | |
tree | d1d06940e8f128804529386ccea9c0757e61db0f /drivers/scsi/qla2xxx/qla_iocb.c | |
parent | 2afa19a9377ca61b9489e44bf50029574fbe63be (diff) |
[SCSI] qla2xxx: Add CPU affinity support.
Set the module parameter ql2xmultique_tag to 1 to enable this
feature. In this mode, the total number of response queues
created is equal to the number of online cpus. Turning the block
layer's rq_affinity mode on enables requests to be routed to the
proper cpu and at the same time it enables completion of the IO
in a response queue that is affined to the cpu in the request
path.
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_iocb.c')
-rw-r--r-- | drivers/scsi/qla2xxx/qla_iocb.c | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/drivers/scsi/qla2xxx/qla_iocb.c b/drivers/scsi/qla2xxx/qla_iocb.c index 94b69d86482d..7b15ded991cb 100644 --- a/drivers/scsi/qla2xxx/qla_iocb.c +++ b/drivers/scsi/qla2xxx/qla_iocb.c | |||
@@ -15,6 +15,7 @@ static request_t *qla2x00_req_pkt(struct scsi_qla_host *, struct req_que *, | |||
15 | struct rsp_que *rsp); | 15 | struct rsp_que *rsp); |
16 | static void qla2x00_isp_cmd(struct scsi_qla_host *, struct req_que *); | 16 | static void qla2x00_isp_cmd(struct scsi_qla_host *, struct req_que *); |
17 | 17 | ||
18 | static void qla25xx_set_que(srb_t *, struct req_que **, struct rsp_que **); | ||
18 | /** | 19 | /** |
19 | * qla2x00_get_cmd_direction() - Determine control_flag data direction. | 20 | * qla2x00_get_cmd_direction() - Determine control_flag data direction. |
20 | * @cmd: SCSI command | 21 | * @cmd: SCSI command |
@@ -726,8 +727,7 @@ qla24xx_start_scsi(srb_t *sp) | |||
726 | /* Setup device pointers. */ | 727 | /* Setup device pointers. */ |
727 | ret = 0; | 728 | ret = 0; |
728 | 729 | ||
729 | req = vha->req; | 730 | qla25xx_set_que(sp, &req, &rsp); |
730 | rsp = ha->rsp_q_map[0]; | ||
731 | sp->que = req; | 731 | sp->que = req; |
732 | 732 | ||
733 | /* So we know we haven't pci_map'ed anything yet */ | 733 | /* So we know we haven't pci_map'ed anything yet */ |
@@ -850,3 +850,21 @@ queuing_error: | |||
850 | 850 | ||
851 | return QLA_FUNCTION_FAILED; | 851 | return QLA_FUNCTION_FAILED; |
852 | } | 852 | } |
853 | |||
854 | static void qla25xx_set_que(srb_t *sp, struct req_que **req, | ||
855 | struct rsp_que **rsp) | ||
856 | { | ||
857 | struct scsi_cmnd *cmd = sp->cmd; | ||
858 | struct scsi_qla_host *vha = sp->fcport->vha; | ||
859 | struct qla_hw_data *ha = sp->fcport->vha->hw; | ||
860 | int affinity = cmd->request->cpu; | ||
861 | |||
862 | if (ql2xmultique_tag && affinity >= 0 && | ||
863 | affinity < ha->max_rsp_queues - 1) { | ||
864 | *rsp = ha->rsp_q_map[affinity + 1]; | ||
865 | *req = ha->req_q_map[1]; | ||
866 | } else { | ||
867 | *req = vha->req; | ||
868 | *rsp = ha->rsp_q_map[0]; | ||
869 | } | ||
870 | } | ||