aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/mpt2sas
diff options
context:
space:
mode:
authorSreekanth Reddy <Sreekanth.Reddy@lsi.com>2013-02-01 11:32:04 -0500
committerJames Bottomley <JBottomley@Parallels.com>2013-06-24 15:52:47 -0400
commit148124d9310f3870fb016bd2637057841d5b7705 (patch)
tree5f01c767f24d7b8eb820e7883041b3d01a9d205b /drivers/scsi/mpt2sas
parent48ba2efc382f94fae16ca8ca011e5961a81ad1ea (diff)
[SCSI] mpt2sas: Calulate the Reply post queue depth calculation as per the MPI spec
[jejb: checkpatch fixes] Signed-off-by: Sreekanth Reddy <Sreekanth.Reddy@lsi.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/mpt2sas')
-rw-r--r--drivers/scsi/mpt2sas/mpt2sas_base.c26
1 files changed, 14 insertions, 12 deletions
diff --git a/drivers/scsi/mpt2sas/mpt2sas_base.c b/drivers/scsi/mpt2sas/mpt2sas_base.c
index 8bb1fe96f21e..ccd6d5a97ec3 100644
--- a/drivers/scsi/mpt2sas/mpt2sas_base.c
+++ b/drivers/scsi/mpt2sas/mpt2sas_base.c
@@ -2503,23 +2503,25 @@ _base_allocate_memory_pools(struct MPT2SAS_ADAPTER *ioc, int sleep_flag)
2503 /* reply free queue sizing - taking into account for 64 FW events */ 2503 /* reply free queue sizing - taking into account for 64 FW events */
2504 ioc->reply_free_queue_depth = ioc->hba_queue_depth + 64; 2504 ioc->reply_free_queue_depth = ioc->hba_queue_depth + 64;
2505 2505
2506 /* calculate reply descriptor post queue depth */
2507 ioc->reply_post_queue_depth = ioc->hba_queue_depth +
2508 ioc->reply_free_queue_depth + 1;
2506 /* align the reply post queue on the next 16 count boundary */ 2509 /* align the reply post queue on the next 16 count boundary */
2507 if (!ioc->reply_free_queue_depth % 16) 2510 if (ioc->reply_post_queue_depth % 16)
2508 ioc->reply_post_queue_depth = ioc->reply_free_queue_depth + 16; 2511 ioc->reply_post_queue_depth += 16 -
2509 else 2512 (ioc->reply_post_queue_depth % 16);
2510 ioc->reply_post_queue_depth = ioc->reply_free_queue_depth + 2513
2511 32 - (ioc->reply_free_queue_depth % 16); 2514
2512 if (ioc->reply_post_queue_depth > 2515 if (ioc->reply_post_queue_depth >
2513 facts->MaxReplyDescriptorPostQueueDepth) { 2516 facts->MaxReplyDescriptorPostQueueDepth) {
2514 ioc->reply_post_queue_depth = min_t(u16, 2517 ioc->reply_post_queue_depth =
2515 (facts->MaxReplyDescriptorPostQueueDepth - 2518 facts->MaxReplyDescriptorPostQueueDepth -
2516 (facts->MaxReplyDescriptorPostQueueDepth % 16)), 2519 (facts->MaxReplyDescriptorPostQueueDepth % 16);
2517 (ioc->hba_queue_depth - (ioc->hba_queue_depth % 16))); 2520 ioc->hba_queue_depth =
2518 ioc->reply_free_queue_depth = ioc->reply_post_queue_depth - 16; 2521 ((ioc->reply_post_queue_depth - 64) / 2) - 1;
2519 ioc->hba_queue_depth = ioc->reply_free_queue_depth - 64; 2522 ioc->reply_free_queue_depth = ioc->hba_queue_depth + 64;
2520 } 2523 }
2521 2524
2522
2523 dinitprintk(ioc, printk(MPT2SAS_INFO_FMT "scatter gather: " 2525 dinitprintk(ioc, printk(MPT2SAS_INFO_FMT "scatter gather: "
2524 "sge_in_main_msg(%d), sge_per_chain(%d), sge_per_io(%d), " 2526 "sge_in_main_msg(%d), sge_per_chain(%d), sge_per_io(%d), "
2525 "chains_per_io(%d)\n", ioc->name, ioc->max_sges_in_main_message, 2527 "chains_per_io(%d)\n", ioc->name, ioc->max_sges_in_main_message,