Code Review for illumos-gate

Prepared by:Install User (install) on 2014-Jun-12 17:42 +0100 BST
Workspace:/code/illumos-gate (at 27470a8cfda2)
Compare against: 568de22b24c124cbb9 (at 568de22b24c1)
Summary of changes: 6991 lines changed: 4963 ins; 948 del; 1080 mod; 33948 unchg
Patch of changes: illumos-gate.patch
Printable review: illumos-gate.pdf

Cdiffs Udiffs Wdiffs Sdiffs Frames Old New Patch Raw usr/src/cmd/mdb/Makefile.common

Add mpt_sas3 to (k)mdb make list.
1 line changed: 1 ins; 0 del; 0 mod; 107 unchg

Cdiffs Udiffs Wdiffs Sdiffs Frames Old New Patch Raw usr/src/cmd/mdb/common/modules/mpt_sas/mpt_sas.c

Merge fixes for Illumos issue 4819, fix mpt_sas command timeout handling.
Add rolling buffer for *all* debug messages.
Improve mdb module and seperate out into mpt_sas3.
219 lines changed: 71 ins; 50 del; 98 mod; 723 unchg

------ ------ ------ ------ ------ --- New Patch Raw usr/src/cmd/mdb/common/modules/mpt_sas3/mpt_sas3.c

hg changesets 607a5b46a793..b706c96317c3
Fix ncpus for early boot config
Purge the ack to the interrupt before exiting mptsas_intr()
Changes from code review
Enable Fast Path for capable devices.
Merge fixes for Illumos issue 4819, fix mpt_sas command timeout handling.
Improve the tx_waitq code path.
Major rework of mutexes.
During normal operation do not grab m_mutex during interrupt.
Use reply post queues instead.
Add rolling buffer for *all* debug messages.
Improve mdb module and seperate out into mpt_sas3.
912 lines changed: 912 ins; 0 del; 0 mod; 0 unchg

------ ------ ------ ------ ------ --- New Patch Raw usr/src/cmd/mdb/intel/amd64/mpt_sas3/Makefile

Add rolling buffer for *all* debug messages.
Improve mdb module and seperate out into mpt_sas3.
37 lines changed: 37 ins; 0 del; 0 mod; 0 unchg

------ ------ ------ ------ ------ --- New Patch Raw usr/src/cmd/mdb/intel/ia32/mpt_sas3/Makefile

Add rolling buffer for *all* debug messages.
Improve mdb module and seperate out into mpt_sas3.
37 lines changed: 37 ins; 0 del; 0 mod; 0 unchg

------ ------ ------ ------ ------ --- New Patch Raw usr/src/cmd/mdb/sparc/v9/mpt_sas3/Makefile

Add rolling buffer for *all* debug messages.
Improve mdb module and seperate out into mpt_sas3.
37 lines changed: 37 ins; 0 del; 0 mod; 0 unchg

Cdiffs Udiffs Wdiffs Sdiffs Frames Old New Patch Raw usr/src/man/man7d/Makefile

Added man page.
1 line changed: 1 ins; 0 del; 0 mod; 294 unchg

------ ------ ------ ------ ------ --- New Patch Raw usr/src/man/man7d/mpt_sas3.7d

Added man page.
140 lines changed: 140 ins; 0 del; 0 mod; 0 unchg

Cdiffs Udiffs Wdiffs Sdiffs Frames Old New Patch Raw usr/src/pkg/manifests/developer-debug-mdb.mf

Add rolling buffer for *all* debug messages.
Improve mdb module and seperate out into mpt_sas3.
4 lines changed: 4 ins; 0 del; 0 mod; 387 unchg

------ ------ ------ ------ ------ --- New Patch Raw usr/src/pkg/manifests/driver-storage-mpt_sas3.mf

Changes to enable driver to compile.
Header paths, object lists, etc.
50 lines changed: 50 ins; 0 del; 0 mod; 0 unchg

Cdiffs Udiffs Wdiffs Sdiffs Frames Old New Patch Raw usr/src/uts/common/Makefile.files

Changes to enable driver to compile.
Header paths, object lists, etc.
3 lines changed: 3 ins; 0 del; 0 mod; 2075 unchg

Cdiffs Udiffs Wdiffs Sdiffs Frames Old New Patch Raw usr/src/uts/common/Makefile.rules

Use MSI-X interrupts, just one for now.
Pre-allocate array for request sense buffers, similar to command frames.
No more messing about with scsi_alloc_consistent_buf().
Changes to enable driver to compile.
Header paths, object lists, etc.
7 lines changed: 7 ins; 0 del; 0 mod; 2707 unchg

Cdiffs Udiffs Wdiffs Sdiffs Frames Old New Patch Raw usr/src/uts/common/io/scsi/adapters/mpt_sas3/mptsas3.c

Code reconciliation with other base.
hg changesets 607a5b46a793..b706c96317c3
Fix ncpus for early boot config
Purge the ack to the interrupt before exiting mptsas_intr()
Changes from code review
Optimise slot alocation through rotor and the use
of per target mutex in start path.
Update tx waitq's code.
Create 2 threads, divide the workflow and deliver
to the hardware from the threads.
Optimise mutex's and code paths.
Split out offline target code.
Test timeouts code
Add support for more than 8 MSI-X interrupts.
Tidy up interrupt assignement and card ID messages.
Enable Fast Path for capable devices.
Merge fixes for Illumos issue 4819, fix mpt_sas command timeout handling.
Tweeks debug flags.
Default to process done commands all in threads if only 1 interrupt.
Lint and cstyle fixes.
Fix problem with running against 64bit msgaddr attributes for DMA.
Default is now to run like this.
Don't take tx_waiq_mutex if draining isn't set.
Fixes for Illumos issue 4682.
Fix hang bug to do with tx_wq.
Re-arrange mptsas_poll() to disable interrupts before issuing the
command.
Improve the tx_waitq code path.
Major rework of mutexes.
During normal operation do not grab m_mutex during interrupt.
Use reply post queues instead.
Make a few variable non static so you can change in /etc/system.
Fixes to some address arithmetic using 32bit values.
Distribute command done processing around the threads.
Improved auto-request sense memory usage.
Fix for Nexenta commit 36c74113a21
OS-91 mptsas does inquiry without setting pkt_time
Add comment about testing.
Test firmware version of 2008 controllers for MSI-X Compatibility.
Re-arrange mptsas_intr() to reduce number of spurious interrupts.
Fix bug in mptsas_free_post_queue().
Change mptsas_doneq_mv() to not loop.
Should not need m_in_callback flag. It prevents concurrent
command completion processing.
Added code to support using MSI-X interrupts across multiple
reply queues. Not tested with anything other than 3008 yet.
Change output "mptsas%d" -> "mptsas3%d".
Add SAS3 specific messages (12.0Gb).
Allow over-ride for interrupt type.
Restrict pre MPI2.5 to MSI interrupts.
Allow watchdog timout to work for mptsas_smhba_setup() in attach().
Merge fixes for "4403 mpt_sas panic when pulling a drive", commit f7d0d869a9ae78d
Use MSI-X interrupts, just one for now.
Pre-allocate array for request sense buffers, similar to command frames.
No more messing about with scsi_alloc_consistent_buf().
Add rolling buffer for *all* debug messages.
Improve mdb module and seperate out into mpt_sas3.
Initial modifications using the code changes present between
the LSI source code for FreeBSD drivers. Specifically the changes
between from mpslsi-source-17.00.00.00 -> mpslsi-source-03.00.00.00.
This mainly involves using a different scatter/gather element in
frame setup.
Change some obvious references sas -> sas3.
Changes to enable driver to compile.
Header paths, object lists, etc.
4097 lines changed: 2534 ins; 815 del; 748 mod; 13918 unchg

Cdiffs Udiffs Wdiffs Sdiffs Frames Old New Patch Raw usr/src/uts/common/io/scsi/adapters/mpt_sas3/mptsas3_hash.c

hg changesets 607a5b46a793..b706c96317c3
Fix ncpus for early boot config
Purge the ack to the interrupt before exiting mptsas_intr()
Changes from code review
Changes to enable driver to compile.
Header paths, object lists, etc.
2 lines changed: 1 ins; 0 del; 1 mod; 214 unchg

Cdiffs Udiffs Wdiffs Sdiffs Frames Old New Patch Raw usr/src/uts/common/io/scsi/adapters/mpt_sas3/mptsas3_impl.c

Update tx waitq's code.
Create 2 threads, divide the workflow and deliver
to the hardware from the threads.
Enable Fast Path for capable devices.
Lint and cstyle fixes.
Fix problem with running against 64bit msgaddr attributes for DMA.
Default is now to run like this.
Major rework of mutexes.
During normal operation do not grab m_mutex during interrupt.
Use reply post queues instead.
Fixes to some address arithmetic using 32bit values.
Merge fixes for "4403 mpt_sas panic when pulling a drive", commit f7d0d869a9ae78d
Initial modifications using the code changes present between
the LSI source code for FreeBSD drivers. Specifically the changes
between from mpslsi-source-17.00.00.00 -> mpslsi-source-03.00.00.00.
This mainly involves using a different scatter/gather element in
frame setup.
Changes to enable driver to compile.
Header paths, object lists, etc.
231 lines changed: 155 ins; 26 del; 50 mod; 2605 unchg

Cdiffs Udiffs Wdiffs Sdiffs Frames Old New Patch Raw usr/src/uts/common/io/scsi/adapters/mpt_sas3/mptsas3_init.c

Fix identifying 2308 cards
Add support for more than 8 MSI-X interrupts.
Tidy up interrupt assignement and card ID messages.
Added code to support using MSI-X interrupts across multiple
reply queues. Not tested with anything other than 3008 yet.
Use MSI-X interrupts, just one for now.
Pre-allocate array for request sense buffers, similar to command frames.
No more messing about with scsi_alloc_consistent_buf().
Initial modifications using the code changes present between
the LSI source code for FreeBSD drivers. Specifically the changes
between from mpslsi-source-17.00.00.00 -> mpslsi-source-03.00.00.00.
This mainly involves using a different scatter/gather element in
frame setup.
Changes to enable driver to compile.
Header paths, object lists, etc.
79 lines changed: 62 ins; 0 del; 17 mod; 679 unchg

Cdiffs Udiffs Wdiffs Sdiffs Frames Old New Patch Raw usr/src/uts/common/io/scsi/adapters/mpt_sas3/mptsas3_raid.c

hg changesets 607a5b46a793..b706c96317c3
Fix ncpus for early boot config
Purge the ack to the interrupt before exiting mptsas_intr()
Changes from code review
Update tx waitq's code.
Create 2 threads, divide the workflow and deliver
to the hardware from the threads.
Added code to support using MSI-X interrupts across multiple
reply queues. Not tested with anything other than 3008 yet.
Changes to enable driver to compile.
Header paths, object lists, etc.
23 lines changed: 6 ins; 0 del; 17 mod; 768 unchg

Cdiffs Udiffs Wdiffs Sdiffs Frames Old New Patch Raw usr/src/uts/common/io/scsi/adapters/mpt_sas3/mptsas3_smhba.c

hg changesets 607a5b46a793..b706c96317c3
Fix ncpus for early boot config
Purge the ack to the interrupt before exiting mptsas_intr()
Changes from code review
Change some obvious references sas -> sas3.
Changes to enable driver to compile.
Header paths, object lists, etc.
11 lines changed: 1 ins; 0 del; 10 mod; 523 unchg

Cdiffs Udiffs Wdiffs Sdiffs Frames Old New Patch Raw usr/src/uts/common/sys/scsi/adapters/mpt_sas3/mpi/mpi2.h

Add support for more than 8 MSI-X interrupts.
Tidy up interrupt assignement and card ID messages.
Initial modifications using the code changes present between
the LSI source code for FreeBSD drivers. Specifically the changes
between from mpslsi-source-17.00.00.00 -> mpslsi-source-03.00.00.00.
This mainly involves using a different scatter/gather element in
frame setup.
105 lines changed: 87 ins; 5 del; 13 mod; 1140 unchg

Cdiffs Udiffs Wdiffs Sdiffs Frames Old New Patch Raw usr/src/uts/common/sys/scsi/adapters/mpt_sas3/mpi/mpi2_cnfg.h

Initial modifications using the code changes present between
the LSI source code for FreeBSD drivers. Specifically the changes
between from mpslsi-source-17.00.00.00 -> mpslsi-source-03.00.00.00.
This mainly involves using a different scatter/gather element in
frame setup.
263 lines changed: 251 ins; 1 del; 11 mod; 2654 unchg

Cdiffs Udiffs Wdiffs Sdiffs Frames Old New Patch Raw usr/src/uts/common/sys/scsi/adapters/mpt_sas3/mpi/mpi2_init.h

Initial modifications using the code changes present between
the LSI source code for FreeBSD drivers. Specifically the changes
between from mpslsi-source-17.00.00.00 -> mpslsi-source-03.00.00.00.
This mainly involves using a different scatter/gather element in
frame setup.
165 lines changed: 147 ins; 15 del; 3 mod; 458 unchg

Cdiffs Udiffs Wdiffs Sdiffs Frames Old New Patch Raw usr/src/uts/common/sys/scsi/adapters/mpt_sas3/mpi/mpi2_ioc.h

Initial modifications using the code changes present between
the LSI source code for FreeBSD drivers. Specifically the changes
between from mpslsi-source-17.00.00.00 -> mpslsi-source-03.00.00.00.
This mainly involves using a different scatter/gather element in
frame setup.
256 lines changed: 240 ins; 1 del; 15 mod; 1381 unchg

Cdiffs Udiffs Wdiffs Sdiffs Frames Old New Patch Raw usr/src/uts/common/sys/scsi/adapters/mpt_sas3/mpi/mpi2_raid.h

Initial modifications using the code changes present between
the LSI source code for FreeBSD drivers. Specifically the changes
between from mpslsi-source-17.00.00.00 -> mpslsi-source-03.00.00.00.
This mainly involves using a different scatter/gather element in
frame setup.
6 lines changed: 2 ins; 1 del; 3 mod; 342 unchg

Cdiffs Udiffs Wdiffs Sdiffs Frames Old New Patch Raw usr/src/uts/common/sys/scsi/adapters/mpt_sas3/mpi/mpi2_sas.h

Initial modifications using the code changes present between
the LSI source code for FreeBSD drivers. Specifically the changes
between from mpslsi-source-17.00.00.00 -> mpslsi-source-03.00.00.00.
This mainly involves using a different scatter/gather element in
frame setup.
24 lines changed: 15 ins; 1 del; 8 mod; 318 unchg

Cdiffs Udiffs Wdiffs Sdiffs Frames Old New Patch Raw usr/src/uts/common/sys/scsi/adapters/mpt_sas3/mpi/mpi2_tool.h

Initial modifications using the code changes present between
the LSI source code for FreeBSD drivers. Specifically the changes
between from mpslsi-source-17.00.00.00 -> mpslsi-source-03.00.00.00.
This mainly involves using a different scatter/gather element in
frame setup.
51 lines changed: 47 ins; 1 del; 3 mod; 431 unchg

Cdiffs Udiffs Wdiffs Sdiffs Frames Old New Patch Raw usr/src/uts/common/sys/scsi/adapters/mpt_sas3/mpi/mpi2_type.h

Initial modifications using the code changes present between
the LSI source code for FreeBSD drivers. Specifically the changes
between from mpslsi-source-17.00.00.00 -> mpslsi-source-03.00.00.00.
This mainly involves using a different scatter/gather element in
frame setup.
2 lines changed: 0 ins; 1 del; 1 mod; 135 unchg

Cdiffs Udiffs Wdiffs Sdiffs Frames Old New Patch Raw usr/src/uts/common/sys/scsi/adapters/mpt_sas3/mptsas3_hash.h

hg changesets 607a5b46a793..b706c96317c3
Fix ncpus for early boot config
Purge the ack to the interrupt before exiting mptsas_intr()
Changes from code review
Changes to enable driver to compile.
Header paths, object lists, etc.
4 lines changed: 1 ins; 0 del; 3 mod; 58 unchg

Cdiffs Udiffs Wdiffs Sdiffs Frames Old New Patch Raw usr/src/uts/common/sys/scsi/adapters/mpt_sas3/mptsas3_ioctl.h

hg changesets 607a5b46a793..b706c96317c3
Fix ncpus for early boot config
Purge the ack to the interrupt before exiting mptsas_intr()
Changes from code review
Initial modifications using the code changes present between
the LSI source code for FreeBSD drivers. Specifically the changes
between from mpslsi-source-17.00.00.00 -> mpslsi-source-03.00.00.00.
This mainly involves using a different scatter/gather element in
frame setup.
Changes to enable driver to compile.
Header paths, object lists, etc.
6 lines changed: 1 ins; 0 del; 5 mod; 355 unchg

Cdiffs Udiffs Wdiffs Sdiffs Frames Old New Patch Raw usr/src/uts/common/sys/scsi/adapters/mpt_sas3/mptsas3_smhba.h

hg changesets 607a5b46a793..b706c96317c3
Fix ncpus for early boot config
Purge the ack to the interrupt before exiting mptsas_intr()
Changes from code review
Changes to enable driver to compile.
Header paths, object lists, etc.
5 lines changed: 1 ins; 0 del; 4 mod; 78 unchg

Cdiffs Udiffs Wdiffs Sdiffs Frames Old New Patch Raw usr/src/uts/common/sys/scsi/adapters/mpt_sas3/mptsas3_var.h

Code reconciliation with other base.
Update tx waitq's code.
Create 2 threads, divide the workflow and deliver
to the hardware from the threads.
Optimise mutex's and code paths.
Split out offline target code.
Enable Fast Path for capable devices.
Merge fixes for Illumos issue 4819, fix mpt_sas command timeout handling.
Tweeks debug flags.
Lint and cstyle fixes.
Fix problem with running against 64bit msgaddr attributes for DMA.
Default is now to run like this.
Fixes for Illumos issue 4682.
Fix hang bug to do with tx_wq.
Re-arrange mptsas_poll() to disable interrupts before issuing the
command.
Improve the tx_waitq code path.
Major rework of mutexes.
During normal operation do not grab m_mutex during interrupt.
Use reply post queues instead.
Distribute command done processing around the threads.
Improved auto-request sense memory usage.
Re-arrange mptsas_intr() to reduce number of spurious interrupts.
Should not need m_in_callback flag. It prevents concurrent
command completion processing.
Added code to support using MSI-X interrupts across multiple
reply queues. Not tested with anything other than 3008 yet.
Use MSI-X interrupts, just one for now.
Pre-allocate array for request sense buffers, similar to command frames.
No more messing about with scsi_alloc_consistent_buf().
Add rolling buffer for *all* debug messages.
Improve mdb module and seperate out into mpt_sas3.
Initial modifications using the code changes present between
the LSI source code for FreeBSD drivers. Specifically the changes
between from mpslsi-source-17.00.00.00 -> mpslsi-source-03.00.00.00.
This mainly involves using a different scatter/gather element in
frame setup.
Changes to enable driver to compile.
Header paths, object lists, etc.
195 lines changed: 110 ins; 31 del; 54 mod; 1355 unchg

Cdiffs Udiffs Wdiffs Sdiffs Frames Old New Patch Raw usr/src/uts/intel/mpt_sas3/Makefile

Changes to enable driver to compile.
Header paths, object lists, etc.
8 lines changed: 1 ins; 0 del; 7 mod; 120 unchg

Cdiffs Udiffs Wdiffs Sdiffs Frames Old New Patch Raw usr/src/uts/sparc/mpt_sas3/Makefile

Changes to enable driver to compile.
Header paths, object lists, etc.
10 lines changed: 1 ins; 0 del; 9 mod; 123 unchg

This code review page was prepared using /opt/onbld/bin/webrev. Webrev is maintained by the illumos project. The latest version may be obtained here.