summaryrefslogtreecommitdiff
path: root/sys/scsi
AgeCommit message (Collapse)Author
2013-09-03DELL MD3060e worksDavid Gwynne
2013-08-29rename scsi_sem_{enter,leave} to scsi_pending_{start,finish}. these areDavid Gwynne
the wrappers around handling of pending work, theyre not semaphores. names from tedu@ ok krw@ guenther@
2013-08-27make path driver match routes return 8 so they will definitely be higherDavid Gwynne
than the real device drivers. ses returns 3 on some dells, which could be confusing for autoconf if it has to decide between that and a path driver.
2013-08-27get rid of the different path scheduler types, which simplifies theDavid Gwynne
code that picks the next path. we assume roundrobin within a group of paths now. the asym sym(4) devices work around this by putting every path in its own group.
2013-08-27these were forgotten in the change from pointing paths to groups insteadDavid Gwynne
of devices. fixes compilation when theyre enabled. how embarrassment.
2013-08-27make scsi_sem_leave only run again once, no matter how many timesDavid Gwynne
other things scsi_sem_enter. the things protected by this do as much work as they can, so they only need to be told to try again once. this isnt a semaphore anymore (and probably never was) so there's a name change coming too.
2013-08-26implement handling of group failover.David Gwynne
if a controller sends sense data back, the path driver can tell mpath that its indicating failover which kicks off an iteration over all the groups until one says its active. if no groups claim to be active, a timeout fires the process off again after a second. you can start controller handover on rdac (well, an md3200i is all i had to test with, others might need more work) and everything keeps going. ill try to get to emc and hds working when i can poke hardware again.
2013-08-26feng shuiDavid Gwynne
2013-08-26all paths are considered active, not in some unknown state.David Gwynne
2013-08-26all FUJITSU MA disks ive found seem ok with being behind mpath.David Gwynne
2013-08-26pull rdac_c9 apart and use its guts to implement the status checkDavid Gwynne
handler for the mpath midlayer to call. the status check is completely event driven. a group is considered active if the VOLACCESSCTL vpd page has some bits set.
2013-08-26rename rdac_c8 to rdac_extdevid and use less magic numbers in the process.David Gwynne
2013-08-26when i first imagined how paths on mpath worked, i thought theDavid Gwynne
midlayer would be able to call things on paths to explicitely online or offline them. turns out thats not how the Real World(tm) works, instead its better to wait for failure and probe for the status of paths, and pick the active group of paths from that. there's even evidence that the mechanisms for forcing controllers into active/passive roles from the scsi initiator are being deprecated. they expect hosts to be able to cope with arbitrary controller role changes and failover accordingly. this replaces the online and offline function pointers in the path_ops structure with a status check function pointer. instead of returning a state, the checker is expected to call mpath_path_status() when its finished figuring out what the state is.
2013-08-26my DELL MD3000i seems to return skey illegal request + asc 0x94 +David Gwynne
ascq 0x01, or skey unit attention + asc 0x8b + ascq 0x02 when i tell it to change controller ownership of a volume. i wish i knew what the numbers really meant, but alas, there's no doco cos this is all magical and unique apparently. anyway, empirically this can be used in rdac_checksense to return MPATH_SENSE_FAILOVER.
2013-08-26checksense handlers in path drivers can return MPATH_SENSE_DECLINEDDavid Gwynne
(who can tell ive spent time in web servers) to say they decline interpreting the sense data, or MPATH_SENSE_FAILOVER to say the sense data is from the controller saying its failed over. all path drivers currently decline handling sense data.
2013-08-26free the dev slot on group allocation failure if we're building a new dev.David Gwynne
2013-08-26introduce the idea of groups of paths. mpath had stuff to managedDavid Gwynne
devices and paths. devices are what mpath presents as targets on its scsibus, and paths are the things attached to hardware controllers that are available to shove io down to the actual real target. all paths were considered usable for handling io on behalf of a device. this adds groups in between devices and paths. only paths on the first group in the list will now be used to handle io now. sym devices will only have one group. asym devices will treat each path as a different group. rdac, emc, and hds will group paths based on which controller in the array theyre connected to. in the future we will intercept sense data from passive controllers and use that to start running checks to pick a new primary group so we can handle controller failover situations. the group id in hds(4) is currently busted, everything else should be correct.
2013-08-26rdac_groupid queries which controller the path is attached to, which we'llDavid Gwynne
use as the group id later on.
2013-08-26now that mpath is attached before any hardware, we can simplify the code.David Gwynne
firstly, move the array of targets that mpath presents into the softc. secondly, when paths call the mpath api we can simply check if the softc global is not null rather than walk through autoconf data. mpath will either have already attached or will never attach in the future.
2013-08-26make scsi_{xsh,ioh}_{add,del} return whether they moved somethingDavid Gwynne
on or off the queues so things calling them can tell if something is or isnt going to happen.
2013-08-25move the prototypes of scsi_sem_{enter,leave} into a header so thingsDavid Gwynne
other than scsi_base.c can use them.
2013-07-05Tweak calculations of resid to avoid unsigned vs signed comparison andKenneth R Westerback
make code clearer. Pointed out by brad@ and his friend llvm.
2013-06-11final removal of daddr64_t. daddr_t has been 64 bit for a long enoughTheo de Raadt
test period; i think 3 years ago the last bugs fell out. ok otto beck others
2013-06-10spelling in comment fix (for real, there's no code change here).David Gwynne
2013-06-10we dont need mpath ccbs if all theyre used for is storing xfers on a list.David Gwynne
we can just use the SIMPLEQ bits that are in xfers directly. this cuts out a bunch of pools and iopools goo. less is more.
2013-06-10toshiba disks in an md1220 work fineDavid Gwynne
2013-06-06Fix EOM handling. Makes Bacula much happier by allowing the use ofKenneth R Westerback
both 'Fast Forward Space File = yes' and 'Hardware End of Medium = yes'. Mostly taken from FreeBSD. Constant prodding by robert@, testing actual backup and restore by ajacoutot@.
2013-05-30typo: thing -> thin provisioningTed Unangst
2013-03-28do not include machine/cpu.h from a .c file; it is the responsibility ofTheo de Raadt
.h files to pull it in, if needed ok tedu
2013-03-04replace the LIST_ENTRY in scsi_xfer with a SIMPLEQ_ENTRY. the things thatDavid Gwynne
use it want something they can add to the end of they do horrible things to be able to do that with the LIST_ENTRY. this makes those horrible things a bit less horrible, and makes it easier to use lists of scsi_xfers in other things.
2013-02-04some stuff i found in old storedge 3500 disk trays seem to work fine.David Gwynne
2012-12-19Temporarily bring back the shutdown hook, but only use it to flush the diskMark Kettenis
cache. This shouldn't interfere with the hibernate code and makes sure we still flush the cache for controller that don't pass DVACT_POWRDOWN down to their children yet. This will be removed when the autoconf subsystem gets changed to do that for us by default. ok deraadt@
2012-10-16#if SCSIDEBUG -> #ifdef SCSIDEBUGJonathan Gray
matches the rest of the scsi code.
2012-10-15In DVACT_SUSPEND, do a flush of the disk. We do this in DVACT_POWERDOWNTheo de Raadt
as well, but it might be wise to flush before a hibernate operation, in case hiberate looks at blocks which are in the buffer cache. ok krw
2012-10-08Revamp the sequences for suspend/hibernate -> resume so that the codeTheo de Raadt
paths are reflexive. It is now possible to fail part-way through a suspend sequence, and recover along the resume code path. Split DVACT_SUSPEND by adding a new DVACT_POWERDOWN method is used after hibernate (and suspend too) to finish the job. Some drivers must be converted at the same time to use this instead of shutdown hooks (the others will follow at a later time) ok kettenis mlarkin
2012-07-09Revert previous.Kenneth R Westerback
The standards gpds are jealous gods. kettenis@ and beck@ have shown EROFS is the wrong thing to return. So revert to EACCES until a better error code is decided on.
2012-07-08Return EROFS when a read-write mount of a read-only sd(4) deviceKenneth R Westerback
is attempted. This is instead of the current EACCES and is intended to result in better error messages from mount(8). Tweak default EROFS error text to mention fsck'ing in mount_ext2fs and mount_msdos since they both have fsck's like ffs. ok deraadt@ aja@ ian@ phessler@
2012-07-01Do not try to send a 10 byte MODE_SENSE request to non-ATAPI non-UMASSMiod Vallat
devices which advertize themselves as non-SCSI2-aware, since this command appeared in the SCSI-2 specification. This makes the Insite Floptical work when connected to a controller which correctly handles spontaneous deselection (which happens when a non-zero lun on said floptical device is addressed), such an esp(4) but not wdsc(4). This is step one of getting Floptical devices working on SGI systems. feedback and ok krw@
2012-07-01Nuke unused _[23]ltol() and _lto[23]l() inline functions. MoveKenneth R Westerback
_4ltol() and _lto4l() to bha, the only place they were used. ok dlg@
2012-06-10Do NOT make all check condition results report EIO. Only use EIOKenneth R Westerback
when b_error has not already been set to something more informative, e.g. EROFS. DO check the result of ffs_sbupdate() and error out of a mount() call when ffs_sbupdate() reports EROFS while attempting a rw mount. Letting RW mounts proceed regardless of EROFS led to crashes and usb problems for Oliver Seufer while using the RW/RO switches on some usb devices. Fix developed using devices kindly supplied by Oliver & Co. ok miod@
2012-03-23Add an entry to the asym list for the NetBSD iSCSI target.Claudio Jeker
OK dlg@
2011-10-10Put the drive in standby mode when we're powering down the machine.Mark Kettenis
tested by dcoppa@, ok krw@, miod@
2011-09-22Fix order of arguments passed to malloc(9) - type first then flags.Joel Sing
2011-09-02generate a devid from vpd page 80 if vpd page 83 doesnt exist or work.David Gwynne
ok krw@
2011-07-18Fix an off-by-1 error and a 32-bit integer arithmetic overflow bugMatthew Dempsky
that caused large disks to appear offline. Discovered and tested by mlarkin@; ok dlg@
2011-07-17Backout a bunch of my SCSI commits from c2k11. At least one of theseMatthew Dempsky
is causing problems when trying to boot sparc64 from an isp(4). Verified to fix the sparc64/isp(4) regression by krw@; ok deraadt@
2011-07-12fix some notyet codeDavid Gwynne
2011-07-12now that we know if a disk is thin provisioned (or an ssd), we can chooseDavid Gwynne
to use the fifo bufq sorting on such disks. there's no point ordering io if the real blocks arent in the order we think they are. ok krw@ tedu@ miod@
2011-07-11ask the disk about unmap (read trim) parameters. check if we have theDavid Gwynne
required vpd pages, then read them for the values we want. we look for the max blocks per unmap, the max descriptors per unmap, and which scsi command to use for unmapping (unmap will be preferred). two fixes and ok matthew@
2011-07-11support "failover" style access to volumes, ie, only use one activeDavid Gwynne
path when talking to an array until it goes away, then you fail over to the next active path. im using this to talk to ses(4) in my dell, and allows us to support arrays that have multiple controllers but have no way of reporting which one is active. using the MRU semantic means we can talk to them without them flipping the active role between its controllers all the time. claudios transtec iscsi box is like this.