diff mbox

[RFC,2/2] mpt3sas/megaraid_sas : reply queue load balancing

Message ID b55ae2b79eca26ca0ec58a50698ae18b@mail.gmail.com (mailing list archive)
State Changes Requested
Headers show

Commit Message

Kashyap Desai Jan. 15, 2018, 12:13 p.m. UTC
Patch for Fix-2 explained in PATCH 0.

Signed-off-by: Kashyap Desai < kashyap.desai@broadcom.com>
---
 mpt3sas/mpt3sas_base.c | 5 ++++-
 mpt3sas/mpt3sas_base.h | 1 +
 2 files changed, 5 insertions(+), 1 deletion(-)

--
2.5.5
diff mbox

Patch

diff --git a/mpt3sas/mpt3sas_base.c b/mpt3sas/mpt3sas_base.c index
0b351d4..20bf2ad 100644
--- a/mpt3sas/mpt3sas_base.c
+++ b/mpt3sas/mpt3sas_base.c
@@ -2811,7 +2811,8 @@  mpt3sas_base_get_reply_virt_addr(struct
MPT3SAS_ADAPTER *ioc, u32 phys_addr)  static inline u8
_base_get_msix_index(struct MPT3SAS_ADAPTER *ioc)  {
-	return ioc->cpu_msix_table[raw_smp_processor_id()];
+	return ioc->reply_queue_count ? (atomic64_add_return(1,
+	    &ioc->total_io_cnt) % ioc->reply_queue_count) : 0;
 }

 /**
@@ -5775,6 +5776,8 @@  _base_make_ioc_operational(struct MPT3SAS_ADAPTER
*ioc)
 	dinitprintk(ioc, pr_info(MPT3SAS_FMT "%s\n", ioc->name,
 	    __func__));

+	atomic64_set(&ioc->total_io_cnt, 0);
+
 	/* clean the delayed target reset list */
 	list_for_each_entry_safe(delayed_tr, delayed_tr_next,
 	    &ioc->delayed_tr_list, list) {
diff --git a/mpt3sas/mpt3sas_base.h b/mpt3sas/mpt3sas_base.h index
456d928..1c39107 100644
--- a/mpt3sas/mpt3sas_base.h
+++ b/mpt3sas/mpt3sas_base.h
@@ -1357,6 +1357,7 @@  struct MPT3SAS_ADAPTER {
 	u8		is_gen35_ioc;
 	u8		atomic_desc_capable;
 	u32		irqpoll_weight;
+	atomic64_t	total_io_cnt;
 	PUT_SMID_IO_FP_HIP put_smid_scsi_io;
 	PUT_SMID_IO_FP_HIP put_smid_fast_path;
 	PUT_SMID_IO_FP_HIP put_smid_hi_priority;