diff options
author | Jayamohan Kallickal <jayamohank@gmail.com> | 2013-09-29 02:35:38 +0400 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2013-10-25 12:58:04 +0400 |
commit | 15a90fe05c91d15ac46b68e3644e5f9f1bb51917 (patch) | |
tree | bdb203c66ddd1d1937e3fbe7ed88c777a3a8b068 /drivers/scsi/be2iscsi/be_main.c | |
parent | f69098c54a4ee8d151505d6b6b03d86ff373b1f6 (diff) | |
download | linux-15a90fe05c91d15ac46b68e3644e5f9f1bb51917.tar.xz |
[SCSI] be2iscsi: Fix Template HDR IOCTL
Allocating memory in the Host which will be used by the
TOE functionality during Session Offload. This fix will
allow performance improvement as adapter memory contention
will be reduced.
Signed-off-by: John Soni Jose <sony.john-n@emulex.com>
Signed-off-by: Jayamohan Kallickal <jayamohan.kallickal@emulex.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/be2iscsi/be_main.c')
-rw-r--r-- | drivers/scsi/be2iscsi/be_main.c | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/drivers/scsi/be2iscsi/be_main.c b/drivers/scsi/be2iscsi/be_main.c index a1f5ac7a9806..0abed0a954eb 100644 --- a/drivers/scsi/be2iscsi/be_main.c +++ b/drivers/scsi/be2iscsi/be_main.c @@ -2517,6 +2517,8 @@ static void beiscsi_find_mem_req(struct beiscsi_hba *phba) phba->params.icds_per_ctrl; phba->mem_req[HWI_MEM_SGE] = sizeof(struct iscsi_sge) * phba->params.num_sge_per_io * phba->params.icds_per_ctrl; + phba->mem_req[HWI_MEM_TEMPLATE_HDR] = phba->params.cxns_per_ctrl * + BEISCSI_TEMPLATE_HDR_PER_CXN_SIZE; phba->mem_req[HWI_MEM_ASYNC_HEADER_BUF] = num_async_pdu_buf_pages * PAGE_SIZE; @@ -3258,6 +3260,36 @@ beiscsi_create_def_data(struct beiscsi_hba *phba, return 0; } + +static int +beiscsi_post_template_hdr(struct beiscsi_hba *phba) +{ + struct be_mem_descriptor *mem_descr; + struct mem_array *pm_arr; + struct be_dma_mem sgl; + int status, i; + + mem_descr = phba->init_mem; + mem_descr += HWI_MEM_TEMPLATE_HDR; + pm_arr = mem_descr->mem_array; + + for (i = 0; i < mem_descr->num_elements; i++) { + hwi_build_be_sgl_arr(phba, pm_arr, &sgl); + status = be_cmd_iscsi_post_template_hdr(&phba->ctrl, &sgl); + + if (status != 0) { + beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_INIT, + "BM_%d : Post Template HDR Failed\n"); + return status; + } + } + + beiscsi_log(phba, KERN_INFO, BEISCSI_LOG_INIT, + "BM_%d : Template HDR Pages Posted\n"); + + return 0; +} + static int beiscsi_post_pages(struct beiscsi_hba *phba) { @@ -3437,6 +3469,9 @@ static void hwi_cleanup(struct beiscsi_hba *phba) phwi_ctrlr = phba->phwi_ctrlr; phwi_context = phwi_ctrlr->phwi_ctxt; + + be_cmd_iscsi_remove_template_hdr(ctrl); + for (i = 0; i < phba->params.cxns_per_ctrl; i++) { q = &phwi_context->be_wrbq[i]; if (q->created) @@ -3611,6 +3646,12 @@ static int hwi_init_port(struct beiscsi_hba *phba) goto error; } + status = beiscsi_post_template_hdr(phba); + if (status != 0) { + beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_INIT, + "BM_%d : Template HDR Posting for CXN Failed\n"); + } + status = beiscsi_create_wrb_rings(phba, phwi_context, phwi_ctrlr); if (status != 0) { beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_INIT, |