summaryrefslogtreecommitdiffstats
path: root/sys/dev/amr/amr_cam.c
diff options
context:
space:
mode:
authorscottl <scottl@FreeBSD.org>2005-12-14 03:26:49 +0000
committerscottl <scottl@FreeBSD.org>2005-12-14 03:26:49 +0000
commit1d0dc5ce336d54e5547e8d296ec1445c3564a414 (patch)
tree831a51fc62191543452a8379ed6e4bd857df82d6 /sys/dev/amr/amr_cam.c
parentdbd94fcd442b994abe665d34aeab2f591f98f217 (diff)
downloadFreeBSD-src-1d0dc5ce336d54e5547e8d296ec1445c3564a414.zip
FreeBSD-src-1d0dc5ce336d54e5547e8d296ec1445c3564a414.tar.gz
Mega update to the LSI MegaRAID driver:
1. Implement a large set of ioctl shims so that the Linux management apps from LSI will work. This includes infrastructure to support adding, deleting and rescanning arrays at runtime. This is based on work from Doug Ambrosko, heavily augmented by LSI and Yahoo. 2. Implement full 64-bit DMA support. Systems with more than 4GB of RAM can now operate without the cost of bounce buffers. Cards that cannot do 64-bit DMA will automatically revert to using bounce buffers. This option can be forced off by setting the 'hw.amr.force_sg32" tunable in the loader. It should only be turned off for debugging purposes. This work was sponsored by Yahoo. 3. Streamline the command delivery and interrupt handler paths after much discussion with Dell and LSI. The logic now closely matches the intended design, making it both more robust and much faster. Certain i/o failures under heavy load should be fixed with this. 4. Optimize the locking. In the interrupt handler, the card can be checked for completed commands without any locks held, due to the handler being implicitely serialized and there being no need to look at any shared data. Only grab the lock to return the command structure to the free pool. A small optimization can still be made to collect all of the completions together and then free them together under a single lock. Items 3 and 4 significantly increase the performance of the driver. On an LSI 320-2X card, transactions per second went from 13,000 to 31,000 in my testing with these changes. However, these changes are still fairly experimental and shouldn't be merged to 6.x until there is more testing. Thanks to Doug Ambrosko, LSI, Dell, and Yahoo for contributing towards this.
Diffstat (limited to 'sys/dev/amr/amr_cam.c')
-rw-r--r--sys/dev/amr/amr_cam.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/sys/dev/amr/amr_cam.c b/sys/dev/amr/amr_cam.c
index 51d5c6f..251ec6b 100644
--- a/sys/dev/amr/amr_cam.c
+++ b/sys/dev/amr/amr_cam.c
@@ -253,10 +253,10 @@ amr_cam_action(struct cam_sim *sim, union ccb *ccb)
/* save the channel number in the ccb */
csio->ccb_h.sim_priv.entries[0].field = cam_sim_bus(sim);
- mtx_lock(&sc->amr_io_lock);
+ mtx_lock(&sc->amr_list_lock);
amr_enqueue_ccb(sc, ccb);
amr_startio(sc);
- mtx_unlock(&sc->amr_io_lock);
+ mtx_unlock(&sc->amr_list_lock);
return;
}
break;
@@ -456,11 +456,17 @@ amr_cam_command(struct amr_softc *sc, struct amr_command **acp)
ac->ac_length = sizeof(*aep);
ac->ac_complete = amr_cam_complete_extcdb;
ac->ac_mailbox.mb_command = AMR_CMD_EXTPASS;
+ if (AMR_IS_SG64(sc))
+ ac->ac_flags |= AMR_CMD_SG64;
} else {
ac->ac_data = ap;
ac->ac_length = sizeof(*ap);
ac->ac_complete = amr_cam_complete;
- ac->ac_mailbox.mb_command = AMR_CMD_PASS;
+ if (AMR_IS_SG64(sc)) {
+ ac->ac_mailbox.mb_command = AMR_CMD_PASS_64;
+ ac->ac_flags |= AMR_CMD_SG64;
+ } else
+ ac->ac_mailbox.mb_command = AMR_CMD_PASS;
}
out:
@@ -484,11 +490,8 @@ out:
static void
amr_cam_poll(struct cam_sim *sim)
{
- struct amr_softc *sc = cam_sim_softc(sim);
- mtx_lock(&sc->amr_io_lock);
amr_done(cam_sim_softc(sim));
- mtx_unlock(&sc->amr_io_lock);
}
/********************************************************************************
OpenPOWER on IntegriCloud