Commit 288addd6 authored by Suganath Prabu's avatar Suganath Prabu Committed by Martin K. Petersen

scsi: mpt3sas: Improve the threshold value and introduce module param

* Reduce the threshold value to 1/4 of the queue depth.

* With this FW can find enough entries to post the Reply Descriptors in the
  reply descriptor post queue.

* With module param, user can play with threshold value, the same
  irqpoll_weight is used as the budget in processing of reply descriptor
  post queues in _base_process_reply_queue.
Signed-off-by: default avatarSuganath Prabu <suganath-prabu.subramani@broadcom.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 51e3b2ad
...@@ -94,6 +94,11 @@ module_param(max_msix_vectors, int, 0); ...@@ -94,6 +94,11 @@ module_param(max_msix_vectors, int, 0);
MODULE_PARM_DESC(max_msix_vectors, MODULE_PARM_DESC(max_msix_vectors,
" max msix vectors"); " max msix vectors");
static int irqpoll_weight = -1;
module_param(irqpoll_weight, int, 0);
MODULE_PARM_DESC(irqpoll_weight,
"irq poll weight (default= one fourth of HBA queue depth)");
static int mpt3sas_fwfault_debug; static int mpt3sas_fwfault_debug;
MODULE_PARM_DESC(mpt3sas_fwfault_debug, MODULE_PARM_DESC(mpt3sas_fwfault_debug,
" enable detection of firmware fault and halt firmware - (default=0)"); " enable detection of firmware fault and halt firmware - (default=0)");
...@@ -1404,7 +1409,7 @@ static int ...@@ -1404,7 +1409,7 @@ static int
_base_process_reply_queue(struct adapter_reply_queue *reply_q) _base_process_reply_queue(struct adapter_reply_queue *reply_q)
{ {
union reply_descriptor rd; union reply_descriptor rd;
u32 completed_cmds; u64 completed_cmds;
u8 request_descript_type; u8 request_descript_type;
u16 smid; u16 smid;
u8 cb_idx; u8 cb_idx;
...@@ -1502,7 +1507,7 @@ _base_process_reply_queue(struct adapter_reply_queue *reply_q) ...@@ -1502,7 +1507,7 @@ _base_process_reply_queue(struct adapter_reply_queue *reply_q)
* So that FW can find enough entries to post the Reply * So that FW can find enough entries to post the Reply
* Descriptors in the reply descriptor post queue. * Descriptors in the reply descriptor post queue.
*/ */
if (completed_cmds > ioc->hba_queue_depth/3) { if (!base_mod64(completed_cmds, ioc->thresh_hold)) {
if (ioc->combined_reply_queue) { if (ioc->combined_reply_queue) {
writel(reply_q->reply_post_host_index | writel(reply_q->reply_post_host_index |
((msix_index & 7) << ((msix_index & 7) <<
...@@ -6612,6 +6617,11 @@ mpt3sas_base_attach(struct MPT3SAS_ADAPTER *ioc) ...@@ -6612,6 +6617,11 @@ mpt3sas_base_attach(struct MPT3SAS_ADAPTER *ioc)
if (r) if (r)
goto out_free_resources; goto out_free_resources;
if (irqpoll_weight > 0)
ioc->thresh_hold = irqpoll_weight;
else
ioc->thresh_hold = ioc->hba_queue_depth/4;
_base_init_irqpolls(ioc); _base_init_irqpolls(ioc);
init_waitqueue_head(&ioc->reset_wq); init_waitqueue_head(&ioc->reset_wq);
......
...@@ -1028,6 +1028,8 @@ typedef void (*MPT3SAS_FLUSH_RUNNING_CMDS)(struct MPT3SAS_ADAPTER *ioc); ...@@ -1028,6 +1028,8 @@ typedef void (*MPT3SAS_FLUSH_RUNNING_CMDS)(struct MPT3SAS_ADAPTER *ioc);
* @msix_load_balance: Enables load balancing of interrupts across * @msix_load_balance: Enables load balancing of interrupts across
* the multiple MSIXs * the multiple MSIXs
* @schedule_dead_ioc_flush_running_cmds: callback to flush pending commands * @schedule_dead_ioc_flush_running_cmds: callback to flush pending commands
* @thresh_hold: Max number of reply descriptors processed
* before updating Host Index
* @scsi_io_cb_idx: shost generated commands * @scsi_io_cb_idx: shost generated commands
* @tm_cb_idx: task management commands * @tm_cb_idx: task management commands
* @scsih_cb_idx: scsih internal commands * @scsih_cb_idx: scsih internal commands
...@@ -1205,6 +1207,7 @@ struct MPT3SAS_ADAPTER { ...@@ -1205,6 +1207,7 @@ struct MPT3SAS_ADAPTER {
u32 non_operational_loop; u32 non_operational_loop;
atomic64_t total_io_cnt; atomic64_t total_io_cnt;
bool msix_load_balance; bool msix_load_balance;
u16 thresh_hold;
/* internal commands, callback index */ /* internal commands, callback index */
u8 scsi_io_cb_idx; u8 scsi_io_cb_idx;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment