aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJayamohan Kallickal <jayamohank@serverengines.com>2010-02-19 21:35:07 -0500
committerJames Bottomley <James.Bottomley@suse.de>2010-03-03 08:00:06 -0500
commited58ea2ab58c7d80a07a829a1cc2c4161c300494 (patch)
treebf05922f8cf98270b16a31680d8dc7dcb1fb51c6
parent90a289e87648f80b63178c463aa7daaf5205805c (diff)
[SCSI] be2iscsi: Fixing memory allocation for connection
This patch fixes some situations where enough resources were not avaialable when targets exceeded a certain limit Signed-off-by: Jayamohan Kallickal <jayamohank@serverengines.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
-rw-r--r--drivers/scsi/be2iscsi/be_main.c4
-rw-r--r--drivers/scsi/be2iscsi/be_main.h4
2 files changed, 3 insertions, 5 deletions
diff --git a/drivers/scsi/be2iscsi/be_main.c b/drivers/scsi/be2iscsi/be_main.c
index b5dca45bae96..5887d7a0e3ff 100644
--- a/drivers/scsi/be2iscsi/be_main.c
+++ b/drivers/scsi/be2iscsi/be_main.c
@@ -359,7 +359,7 @@ static void beiscsi_get_params(struct beiscsi_hba *phba)
359 + BE2_TMFS 359 + BE2_TMFS
360 + BE2_NOPOUT_REQ)); 360 + BE2_NOPOUT_REQ));
361 phba->params.cxns_per_ctrl = phba->fw_config.iscsi_cid_count; 361 phba->params.cxns_per_ctrl = phba->fw_config.iscsi_cid_count;
362 phba->params.asyncpdus_per_ctrl = phba->fw_config.iscsi_cid_count;; 362 phba->params.asyncpdus_per_ctrl = phba->fw_config.iscsi_cid_count * 2;
363 phba->params.icds_per_ctrl = phba->fw_config.iscsi_icd_count;; 363 phba->params.icds_per_ctrl = phba->fw_config.iscsi_icd_count;;
364 phba->params.num_sge_per_io = BE2_SGE; 364 phba->params.num_sge_per_io = BE2_SGE;
365 phba->params.defpdu_hdr_sz = BE2_DEFPDU_HDR_SZ; 365 phba->params.defpdu_hdr_sz = BE2_DEFPDU_HDR_SZ;
@@ -2169,7 +2169,7 @@ static void beiscsi_init_wrb_handle(struct beiscsi_hba *phba)
2169 num_cxn_wrb = (mem_descr_wrb->mem_array[idx].size) / 2169 num_cxn_wrb = (mem_descr_wrb->mem_array[idx].size) /
2170 ((sizeof(struct iscsi_wrb) * 2170 ((sizeof(struct iscsi_wrb) *
2171 phba->params.wrbs_per_cxn)); 2171 phba->params.wrbs_per_cxn));
2172 for (index = 0; index < phba->params.cxns_per_ctrl; index += 2) { 2172 for (index = 0; index < phba->params.cxns_per_ctrl * 2; index += 2) {
2173 pwrb_context = &phwi_ctrlr->wrb_context[index]; 2173 pwrb_context = &phwi_ctrlr->wrb_context[index];
2174 if (num_cxn_wrb) { 2174 if (num_cxn_wrb) {
2175 for (j = 0; j < phba->params.wrbs_per_cxn; j++) { 2175 for (j = 0; j < phba->params.wrbs_per_cxn; j++) {
diff --git a/drivers/scsi/be2iscsi/be_main.h b/drivers/scsi/be2iscsi/be_main.h
index d4d31dc09088..87ec21280a37 100644
--- a/drivers/scsi/be2iscsi/be_main.h
+++ b/drivers/scsi/be2iscsi/be_main.h
@@ -498,8 +498,6 @@ struct hwi_async_entry {
498 struct list_head data_busy_list; 498 struct list_head data_busy_list;
499}; 499};
500 500
501#define BE_MIN_ASYNC_ENTRIES 128
502
503struct hwi_async_pdu_context { 501struct hwi_async_pdu_context {
504 struct { 502 struct {
505 struct be_bus_address pa_base; 503 struct be_bus_address pa_base;
@@ -540,7 +538,7 @@ struct hwi_async_pdu_context {
540 * This is a varying size list! Do not add anything 538 * This is a varying size list! Do not add anything
541 * after this entry!! 539 * after this entry!!
542 */ 540 */
543 struct hwi_async_entry async_entry[BE_MIN_ASYNC_ENTRIES]; 541 struct hwi_async_entry async_entry[BE2_MAX_SESSIONS * 2];
544}; 542};
545 543
546#define PDUCQE_CODE_MASK 0x0000003F 544#define PDUCQE_CODE_MASK 0x0000003F