summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/isci/isci.h
diff options
context:
space:
mode:
authorDan Williams <dan.j.williams@intel.com>2011-06-09 16:04:28 -0700
committerDan Williams <dan.j.williams@intel.com>2011-07-03 04:04:51 -0700
commit994a9303d33f8238d57f58c26067b6d4ac9af222 (patch)
tree8a7a1f680761ee3cfb2a258c2784194eea69b703 /drivers/scsi/isci/isci.h
parentdd047c8e2bca22856050dbe0378a37cf44eecc97 (diff)
isci: cleanup/optimize queue increment macros
Every single i/o or event completion incurs a test and branch to see if the cycle bit changed. For power-of-2 queue sizes the cycle bit can be read directly from the rollover of the queue pointer. Likely premature optimization, but the hidden if() and hidden assignments / side-effects in the macros were already asking to be cleaned up. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers/scsi/isci/isci.h')
-rw-r--r--drivers/scsi/isci/isci.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/scsi/isci/isci.h b/drivers/scsi/isci/isci.h
index 81bade421b9..207328369ed 100644
--- a/drivers/scsi/isci/isci.h
+++ b/drivers/scsi/isci/isci.h
@@ -90,7 +90,8 @@ enum sci_controller_mode {
#define SCI_MAX_DOMAINS SCI_MAX_PORTS
#define SCU_MAX_CRITICAL_NOTIFICATIONS (384)
-#define SCU_MAX_EVENTS (128)
+#define SCU_MAX_EVENTS_SHIFT (7)
+#define SCU_MAX_EVENTS (1 << SCU_MAX_EVENTS_SHIFT)
#define SCU_MAX_UNSOLICITED_FRAMES (128)
#define SCU_MAX_COMPLETION_QUEUE_SCRATCH (128)
#define SCU_MAX_COMPLETION_QUEUE_ENTRIES (SCU_MAX_CRITICAL_NOTIFICATIONS \
@@ -98,6 +99,7 @@ enum sci_controller_mode {
+ SCU_MAX_UNSOLICITED_FRAMES \
+ SCI_MAX_IO_REQUESTS \
+ SCU_MAX_COMPLETION_QUEUE_SCRATCH)
+#define SCU_MAX_COMPLETION_QUEUE_SHIFT (ilog2(SCU_MAX_COMPLETION_QUEUE_ENTRIES))
#define SCU_ABSOLUTE_MAX_UNSOLICITED_FRAMES (4096)
#define SCU_UNSOLICITED_FRAME_BUFFER_SIZE (1024)