diff options
author | Quinn Tran <quinn.tran@cavium.com> | 2017-06-13 20:47:24 -0700 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2017-06-27 21:21:41 -0400 |
commit | 8abfa9e2268337cdcd458e24008345973328e2e2 (patch) | |
tree | 01fa78608154bbc9e71650a9847167ef7b180ff9 /drivers/scsi/qla2xxx/qla_os.c | |
parent | af7bb3826a49b774332a5e8ff3f68877bdfd21c9 (diff) |
scsi: qla2xxx: Add function call to qpair for door bell
Add call back to door bell for qpair. This help reduce access to
qla_hw_data structure, in order to reduce cach thrash.
Signed-off-by: Quinn Tran <quinn.tran@cavium.com>
Signed-off-by: Himanshu Madhani <himanshu.madhani@cavium.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/qla2xxx/qla_os.c')
-rw-r--r-- | drivers/scsi/qla2xxx/qla_os.c | 35 |
1 files changed, 23 insertions, 12 deletions
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index 1d66954b7e5a..88e115fcea60 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c @@ -351,6 +351,28 @@ int qla2xxx_mqueuecommand(struct Scsi_Host *host, struct scsi_cmnd *cmd, struct qla_qpair *qpair); /* -------------------------------------------------------------------------- */ +static void qla_init_base_qpair(struct scsi_qla_host *vha, struct req_que *req, + struct rsp_que *rsp) +{ + struct qla_hw_data *ha = vha->hw; + rsp->qpair = ha->base_qpair; + rsp->req = req; + ha->base_qpair->req = req; + ha->base_qpair->rsp = rsp; + ha->base_qpair->vha = vha; + ha->base_qpair->qp_lock_ptr = &ha->hardware_lock; + ha->base_qpair->use_shadow_reg = IS_SHADOW_REG_CAPABLE(ha) ? 1 : 0; + ha->base_qpair->msix = &ha->msix_entries[QLA_MSIX_RSP_Q]; + INIT_LIST_HEAD(&ha->base_qpair->hints_list); + ha->base_qpair->enable_class_2 = ql2xenableclass2; + /* init qpair to this cpu. Will adjust at run time. */ + qla_cpu_update(rsp->qpair, smp_processor_id()); + ha->base_qpair->pdev = ha->pdev; + + if (IS_QLA27XX(ha) || IS_QLA83XX(ha)) + ha->base_qpair->reqq_start_iocbs = qla_83xx_start_iocbs; +} + static int qla2x00_alloc_queues(struct qla_hw_data *ha, struct req_que *req, struct rsp_que *rsp) { @@ -378,18 +400,7 @@ static int qla2x00_alloc_queues(struct qla_hw_data *ha, struct req_que *req, goto fail_base_qpair; } - rsp->qpair = ha->base_qpair; - rsp->req = req; - ha->base_qpair->req = req; - ha->base_qpair->rsp = rsp; - ha->base_qpair->vha = vha; - ha->base_qpair->qp_lock_ptr = &ha->hardware_lock; - ha->base_qpair->use_shadow_reg = IS_SHADOW_REG_CAPABLE(ha) ? 1 : 0; - /* init qpair to this cpu. Will adjust at run time. */ - ha->base_qpair->msix = &ha->msix_entries[QLA_MSIX_RSP_Q]; - INIT_LIST_HEAD(&ha->base_qpair->hints_list); - ha->base_qpair->enable_class_2 = ql2xenableclass2; - qla_cpu_update(rsp->qpair, smp_processor_id()); + qla_init_base_qpair(vha, req, rsp); if (ql2xmqsupport && ha->max_qpairs) { ha->queue_pair_map = kcalloc(ha->max_qpairs, sizeof(struct qla_qpair *), |