OpenBSD CVS

CVS log for src/sys/scsi/mpath.c


[BACK] Up to [local] / src / sys / scsi

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.58 / (download) - annotate - [select for diffs], Mon May 13 01:15:53 2024 UTC (4 weeks ago) by jsg
Branch: MAIN
CVS Tags: HEAD
Changes since 1.57: +1 -2 lines
Diff to previous 1.57 (colored)

remove prototypes with no matching function
ok mpi@

Revision 1.57 / (download) - annotate - [select for diffs], Sat Jul 2 08:50:42 2022 UTC (23 months, 1 week ago) by visa
Branch: MAIN
CVS Tags: OPENBSD_7_5_BASE, OPENBSD_7_5, OPENBSD_7_4_BASE, OPENBSD_7_4, OPENBSD_7_3_BASE, OPENBSD_7_3, OPENBSD_7_2_BASE, OPENBSD_7_2
Changes since 1.56: +1 -3 lines
Diff to previous 1.56 (colored)

Remove unused device poll functions.

Also remove unneeded includes of <sys/poll.h> and <sys/select.h>.

Some addenda from jsg@.

OK miod@ mpi@

Revision 1.56 / (download) - annotate - [select for diffs], Sat Apr 16 19:19:59 2022 UTC (2 years, 1 month ago) by naddy
Branch: MAIN
Changes since 1.55: +2 -2 lines
Diff to previous 1.55 (colored)

constify SCSI adapter entry points

ok krw@

Revision 1.55 / (download) - annotate - [select for diffs], Sun Oct 24 16:57:30 2021 UTC (2 years, 7 months ago) by mpi
Branch: MAIN
CVS Tags: OPENBSD_7_1_BASE, OPENBSD_7_1
Changes since 1.54: +2 -2 lines
Diff to previous 1.54 (colored)

Constify struct cfattach.

ok visa@ a long time ago, ok krw@

Revision 1.54 / (download) - annotate - [select for diffs], Tue Sep 22 19:32:53 2020 UTC (3 years, 8 months ago) by krw
Branch: MAIN
CVS Tags: OPENBSD_7_0_BASE, OPENBSD_7_0, OPENBSD_6_9_BASE, OPENBSD_6_9, OPENBSD_6_8_BASE, OPENBSD_6_8
Changes since 1.53: +3 -3 lines
Diff to previous 1.53 (colored)

Since dlg@'s 2009 scsi midlayer refactoring the 'struct scsi_generic *cmd'
member of 'struct scsi_xfer' has always been pointed at the 'struct scsi_generic
cmdstore' member of the same instance. So nuke 'cmdstore' and remove the '*'
from cmd. Take the address of cmd as required by the various casts.

No intentional functional change.

luna88k test by aoyama@, sparc64 test by jmatthew@

Identification of 2009's last *cmd use and ok jmatthew@

Revision 1.53 / (download) - annotate - [select for diffs], Wed Jul 22 13:16:05 2020 UTC (3 years, 10 months ago) by krw
Branch: MAIN
Changes since 1.52: +1 -2 lines
Diff to previous 1.52 (colored)

Nuke unused struct scsi_link members of adapter softc's where the
driver successfully compiles on one or more of amd64, i386, hppa.

Revision 1.52 / (download) - annotate - [select for diffs], Mon Jul 20 14:41:14 2020 UTC (3 years, 10 months ago) by krw
Branch: MAIN
Changes since 1.51: +5 -4 lines
Diff to previous 1.51 (colored)

Move remaining scsi bus initialization info from "prototype scsi link"
fields to struct scsibus_attach_args. Nuke the struct scsi_link *
(saa_sc_link) in scaibus_attach_args.

Explicitly initialize each field in scsibus_attach_args variables.

Revision 1.51 / (download) - annotate - [select for diffs], Sun Jul 19 18:57:58 2020 UTC (3 years, 10 months ago) by krw
Branch: MAIN
Changes since 1.50: +6 -6 lines
Diff to previous 1.50 (colored)

Move the adapter related items (luns, adapter, adapter_target,
adapter_buswidth, adapter_softc) from struct scsi_link to struct
scsibus_attach_args.

Additional compile tests by jmatthew@ (sparc64) and aoyam@ (luna88k).

Revision 1.50 / (download) - annotate - [select for diffs], Thu Jul 16 14:44:55 2020 UTC (3 years, 10 months ago) by krw
Branch: MAIN
Changes since 1.49: +9 -8 lines
Diff to previous 1.49 (colored)

Access scsibus_softc info (luns, adapter, adapter_target,
adapter_softc, adapter_buswidth) via link->bus rather than using
copies currently residing in the link.

Revision 1.49 / (download) - annotate - [select for diffs], Sat Jun 27 14:29:45 2020 UTC (3 years, 11 months ago) by krw
Branch: MAIN
Changes since 1.48: +1 -2 lines
Diff to previous 1.48 (colored)

No need to bzero()/memset() 'struct scsibus_attach_args' variables
immediately before initializing the only field in the struct.

Revision 1.48 / (download) - annotate - [select for diffs], Wed Jun 24 18:59:30 2020 UTC (3 years, 11 months ago) by krw
Branch: MAIN
Changes since 1.47: +2 -2 lines
Diff to previous 1.47 (colored)

Use SDEV_NO_ADAPTER_TARGET instead of the value that is being
aassigned to adapter_buswidth to indicate the adapter is not a target
on the bus.

ok dlg@ as part of a larger diff.

Revision 1.47 / (download) - annotate - [select for diffs], Wed Feb 5 21:50:41 2020 UTC (4 years, 4 months ago) by krw
Branch: MAIN
CVS Tags: OPENBSD_6_7_BASE, OPENBSD_6_7
Changes since 1.46: +3 -2 lines
Diff to previous 1.46 (colored)

Ooops. Missed a file in nuke of scsi_minphys. mpath_minphys() needs to
check dev_minphys for NULL before calling it.

Revision 1.46 / (download) - annotate - [select for diffs], Wed Feb 5 16:29:30 2020 UTC (4 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.45: +2 -2 lines
Diff to previous 1.45 (colored)

Nuke unnecessary abstraction 'scsi_minphys()' which just calls
'minphys()'. Just use & check for NULL instead, since 'minphys()' is
always called on the code path ([cd|sd|st]minphys) that calls
physio().

Revision 1.45 / (download) - annotate - [select for diffs], Sun Jan 26 00:53:31 2020 UTC (4 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.44: +2 -2 lines
Diff to previous 1.44 (colored)

Shuffle some names around to make reading the code less headache
inducing. Rename scsi_adapter member 'scsi_minphys' to 'dev_minphys'
to reflect what it is supposed to do. Use consistent naming convention
(<dev>_minphys) for the actual device functions.

No functional change.

Revision 1.44 / (download) - annotate - [select for diffs], Thu Jan 23 07:53:00 2020 UTC (4 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.43: +2 -4 lines
Diff to previous 1.43 (colored)

Use a consistant idiom/format when declaring scsi_adapter structures
in drivers. Terse one liners, NULLs instead of 0's, explicitly specify
all members, etc.

Nuke #ifdef notyet blocks related to the scsi_adapter in aic.

No intentional functional change.

ok tedu@

Revision 1.43 / (download) - annotate - [select for diffs], Fri Sep 27 17:22:31 2019 UTC (4 years, 8 months ago) by krw
Branch: MAIN
CVS Tags: OPENBSD_6_6_BASE, OPENBSD_6_6
Changes since 1.42: +7 -7 lines
Diff to previous 1.42 (colored)

Add/tweak #endif comments to make spelunking via grep more rewarding.

Revision 1.42 / (download) - annotate - [select for diffs], Sun Feb 10 16:42:35 2019 UTC (5 years, 4 months ago) by phessler
Branch: MAIN
CVS Tags: OPENBSD_6_5_BASE, OPENBSD_6_5
Changes since 1.41: +4 -4 lines
Diff to previous 1.41 (colored)

"non-existant" is one of those words that don't exist, so use "non-existent"
instead

From Pamela Mosiejczuk, many thanks!
OK phessler@ deraadt@

Revision 1.41 / (download) - annotate - [select for diffs], Sun Aug 23 01:55:39 2015 UTC (8 years, 9 months ago) by tedu
Branch: MAIN
CVS Tags: OPENBSD_6_4_BASE, OPENBSD_6_4, OPENBSD_6_3_BASE, OPENBSD_6_3, OPENBSD_6_2_BASE, OPENBSD_6_2, OPENBSD_6_1_BASE, OPENBSD_6_1, OPENBSD_6_0_BASE, OPENBSD_6_0, OPENBSD_5_9_BASE, OPENBSD_5_9
Changes since 1.40: +3 -3 lines
Diff to previous 1.40 (colored)

add some sizes to free. looked over by deraadt

Revision 1.40 / (download) - annotate - [select for diffs], Sun Jun 7 19:13:27 2015 UTC (9 years ago) by krw
Branch: MAIN
CVS Tags: OPENBSD_5_8_BASE, OPENBSD_5_8
Changes since 1.39: +2 -2 lines
Diff to previous 1.39 (colored)

More damned eye searing whitespace.

Revision 1.39 / (download) - annotate - [select for diffs], Sat Mar 14 03:38:52 2015 UTC (9 years, 3 months ago) by jsg
Branch: MAIN
Changes since 1.38: +1 -2 lines
Diff to previous 1.38 (colored)

Remove some includes include-what-you-use claims don't
have any direct symbols used.  Tested for indirect use by compiling
amd64/i386/sparc64 kernels.

ok tedu@ deraadt@

Revision 1.38 / (download) - annotate - [select for diffs], Wed Mar 4 23:52:43 2015 UTC (9 years, 3 months ago) by dlg
Branch: MAIN
CVS Tags: OPENBSD_5_7_BASE, OPENBSD_5_7
Changes since 1.37: +4 -1 lines
Diff to previous 1.37 (colored)

prevent umass devices from being considered for paths.

ok deraadt@

Revision 1.37 / (download) - annotate - [select for diffs], Sun Sep 14 14:17:26 2014 UTC (9 years, 8 months ago) by jsg
Branch: MAIN
Changes since 1.36: +1 -2 lines
Diff to previous 1.36 (colored)

remove uneeded proc.h includes
ok mpi@ kspillner@

Revision 1.36 / (download) - annotate - [select for diffs], Sat Jul 12 18:50:25 2014 UTC (9 years, 11 months ago) by tedu
Branch: MAIN
CVS Tags: OPENBSD_5_6_BASE, OPENBSD_5_6
Changes since 1.35: +3 -3 lines
Diff to previous 1.35 (colored)

add a size argument to free. will be used soon, but for now default to 0.
after discussions with beck deraadt kettenis.

Revision 1.35 / (download) - annotate - [select for diffs], Thu May 1 10:25:44 2014 UTC (10 years, 1 month ago) by jsg
Branch: MAIN
Changes since 1.34: +3 -2 lines
Diff to previous 1.34 (colored)

move pointer use to after a NULL pointer check
ok dlg@

Revision 1.34 / (download) - annotate - [select for diffs], Sun Sep 8 09:47:36 2013 UTC (10 years, 9 months ago) by dlg
Branch: MAIN
CVS Tags: OPENBSD_5_5_BASE, OPENBSD_5_5
Changes since 1.33: +6 -5 lines
Diff to previous 1.33 (colored)

fix next path selection so if the current path is NULL (which can occur if
paths are lost and groups become empty) we dont try and do stuff with it
that causes null derefs and awesome panics.

Revision 1.33 / (download) - annotate - [select for diffs], Thu Aug 29 02:54:36 2013 UTC (10 years, 9 months ago) by dlg
Branch: MAIN
Changes since 1.32: +3 -3 lines
Diff to previous 1.32 (colored)

rename scsi_sem_{enter,leave} to scsi_pending_{start,finish}. these are
the wrappers around handling of pending work, theyre not semaphores.

names from tedu@
ok krw@ guenther@

Revision 1.32 / (download) - annotate - [select for diffs], Tue Aug 27 00:53:09 2013 UTC (10 years, 9 months ago) by dlg
Branch: MAIN
Changes since 1.31: +13 -15 lines
Diff to previous 1.31 (colored)

get rid of the different path scheduler types, which simplifies the
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.

Revision 1.31 / (download) - annotate - [select for diffs], Mon Aug 26 12:20:12 2013 UTC (10 years, 9 months ago) by dlg
Branch: MAIN
Changes since 1.30: +112 -28 lines
Diff to previous 1.30 (colored)

implement handling of group failover.

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.

Revision 1.30 / (download) - annotate - [select for diffs], Mon Aug 26 10:13:17 2013 UTC (10 years, 9 months ago) by dlg
Branch: MAIN
Changes since 1.29: +7 -1 lines
Diff to previous 1.29 (colored)

when i first imagined how paths on mpath worked, i thought the
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.

Revision 1.29 / (download) - annotate - [select for diffs], Mon Aug 26 07:32:24 2013 UTC (10 years, 9 months ago) by dlg
Branch: MAIN
Changes since 1.28: +4 -2 lines
Diff to previous 1.28 (colored)

free the dev slot on group allocation failure if we're building a new dev.

Revision 1.28 / (download) - annotate - [select for diffs], Mon Aug 26 07:29:45 2013 UTC (10 years, 9 months ago) by dlg
Branch: MAIN
Changes since 1.27: +75 -23 lines
Diff to previous 1.27 (colored)

introduce the idea of groups of paths. mpath had stuff to managed
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.

Revision 1.27 / (download) - annotate - [select for diffs], Mon Aug 26 06:54:32 2013 UTC (10 years, 9 months ago) by dlg
Branch: MAIN
Changes since 1.26: +19 -25 lines
Diff to previous 1.26 (colored)

now that mpath is attached before any hardware, we can simplify the code.

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.

Revision 1.26 / (download) - annotate - [select for diffs], Mon Jun 10 04:12:57 2013 UTC (11 years ago) by dlg
Branch: MAIN
CVS Tags: OPENBSD_5_4_BASE, OPENBSD_5_4
Changes since 1.25: +12 -54 lines
Diff to previous 1.25 (colored)

we dont need mpath ccbs if all theyre used for is storing xfers on a list.
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.

Revision 1.25 / (download) - annotate - [select for diffs], Sun Jul 17 22:46:48 2011 UTC (12 years, 10 months ago) by matthew
Branch: MAIN
CVS Tags: OPENBSD_5_3_BASE, OPENBSD_5_3, OPENBSD_5_2_BASE, OPENBSD_5_2, OPENBSD_5_1_BASE, OPENBSD_5_1, OPENBSD_5_0_BASE, OPENBSD_5_0
Changes since 1.24: +3 -3 lines
Diff to previous 1.24 (colored)

Backout a bunch of my SCSI commits from c2k11.  At least one of these
is causing problems when trying to boot sparc64 from an isp(4).

Verified to fix the sparc64/isp(4) regression by krw@; ok deraadt@

Revision 1.24 / (download) - annotate - [select for diffs], Mon Jul 11 01:02:48 2011 UTC (12 years, 11 months ago) by dlg
Branch: MAIN
Changes since 1.23: +16 -10 lines
Diff to previous 1.23 (colored)

support "failover" style access to volumes, ie, only use one active
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.

Revision 1.23 / (download) - annotate - [select for diffs], Fri Jul 8 22:09:27 2011 UTC (12 years, 11 months ago) by matthew
Branch: MAIN
Changes since 1.22: +3 -3 lines
Diff to previous 1.22 (colored)

First batch of converting SCSI HBAs from setting saa_targets and
saa_luns instead of adapter_buswidth and luns in the prototype link.

ok dlg@, miod@

Revision 1.22 / (download) - annotate - [select for diffs], Fri Jun 17 07:06:47 2011 UTC (12 years, 11 months ago) by mk
Branch: MAIN
Changes since 1.21: +3 -2 lines
Diff to previous 1.21 (colored)

M_WAITOK cleanup of two cases:

1) Allocating with M_WAITOK, checking for NULL, and calling panic() is
pointless (malloc() will panic if it can't allocate) so remove the check
and the call.

2) Allocating with M_WAITOK, checking for NULL, and then gracefully
handling failure to allocate is pointless.  Instead also pass M_CANFAIL
so malloc() doesn't panic so we can actually handle it gracefully.

1) was done using Coccinelle.

Input from oga.

ok miod.

Revision 1.21 / (download) - annotate - [select for diffs], Wed Apr 27 05:22:24 2011 UTC (13 years, 1 month ago) by dlg
Branch: MAIN
Changes since 1.20: +2 -2 lines
Diff to previous 1.20 (colored)

if a path returns XS_SELTIMEOUT, retry the io down another path like we
do for XS_RESET. adapters return SELTIMEOUT when the device is gone.

Revision 1.20 / (download) - annotate - [select for diffs], Sun Apr 17 23:18:01 2011 UTC (13 years, 1 month ago) by dlg
Branch: MAIN
Changes since 1.19: +16 -1 lines
Diff to previous 1.19 (colored)

if mpath is disabled in config or ukc, then prevent path drivers from
attaching since theyre useless without mpath.

the path drivers ask mpath if its ok to use the device before doing their
own matches (this is so mpath can prevent paths attaching to itself), so
im just adding this check there.

this uses code from miod to walk cfdata for the mpath entry and then checks
its state. this is ok because mpath is only attached in one place, so there
arent multiple cfdata entries for it.

ok krw@ deraadt@ miod@ matthew@

Revision 1.19 / (download) - annotate - [select for diffs], Tue Apr 5 14:25:42 2011 UTC (13 years, 2 months ago) by dlg
Branch: MAIN
Changes since 1.18: +267 -83 lines
Diff to previous 1.18 (colored)

move forward with scsi multipathing.

the big change is how paths between mpath capable devices and the
kernel are managed.

originally the midlayer would steal the links to the devices and
hide them behind mpath. all the changes an adapter made to a link
(eg activate or detach), the midlayer had to test if it was an mpath
link and then call special mpath code to handle it.

the original code also assumed that all paths behaved the same, but
the reality is that different devices have different command sets
and behaviours. figuring out which behaviour to pick and prioritising
them is basically the same job autoconf does with match and attach.

rather than special casing mpath in the midlayer and reimplimenting
autoconf, this turns paths into actual device drivers with match
and attach routines. after they figure out if the path is active,
they then give it to mpath(4) to use as a backend.

i have written drivers for symmetric access devices (sym(4)) where
all paths to the same logical unit are as good as each other,
lsi/engenio arrays (rdac(4), and emc arrays (emc(4)).

the rdac and emc drivers only detect active paths at attach time,
the do not cope if the controller changes state unless you unplug
the path and plug it in again to retest the active state. they also
do not have support for directing array failover.

operating and hoplugging has been tested with mpii(4), fc and sas
mpi(4), and iscsi via vscsi (claudio did this too).

ok krw@ deraadt@

Revision 1.18 / (download) - annotate - [select for diffs], Wed Jul 21 21:34:12 2010 UTC (13 years, 10 months ago) by todd
Branch: MAIN
CVS Tags: OPENBSD_4_9_BASE, OPENBSD_4_9, OPENBSD_4_8_BASE, OPENBSD_4_8
Changes since 1.17: +1 -2 lines
Diff to previous 1.17 (colored)

let mpath build again even though it is disabled
ok dlg@

Revision 1.17 / (download) - annotate - [select for diffs], Thu Jul 1 03:01:37 2010 UTC (13 years, 11 months ago) by matthew
Branch: MAIN
Changes since 1.16: +2 -1 lines
Diff to previous 1.16 (colored)

Restore setting xs->bp; fixes ncr(4) on VAX.

ok miod@, krw@

Revision 1.16 / (download) - annotate - [select for diffs], Mon Jun 28 18:31:02 2010 UTC (13 years, 11 months ago) by krw
Branch: MAIN
Changes since 1.15: +1 -6 lines
Diff to previous 1.15 (colored)

Remove all adapter-specific 'struct scsi_device's. They are never used. First
step in elminating 'struct scsi_device' entirely.

Spotted and initial diff from matthew@.

ok matthew@ dlg@ deraadt@ marco@ miod@

Revision 1.15 / (download) - annotate - [select for diffs], Sun Jun 27 03:34:29 2010 UTC (13 years, 11 months ago) by matthew
Branch: MAIN
Changes since 1.14: +1 -2 lines
Diff to previous 1.14 (colored)

"Believe it or not," nothing uses scsi_xfer's req_sense_length field
in any meaningful way, so just get rid of it.

ok krw@, dlg@

Revision 1.14 / (download) - annotate - [select for diffs], Thu May 20 00:55:18 2010 UTC (14 years ago) by krw
Branch: MAIN
Changes since 1.13: +1 -7 lines
Diff to previous 1.13 (colored)

New scsi code seems to be stable. Pluck previously identified
low-hanging splbio/splx pairs that are no longer needed and see if
this reveals any hidden scsi flaws.

ok dlg@

Revision 1.13 / (download) - annotate - [select for diffs], Tue Mar 23 01:57:20 2010 UTC (14 years, 2 months ago) by krw
Branch: MAIN
Changes since 1.12: +5 -7 lines
Diff to previous 1.12 (colored)

Change the scsi_cmd function member of scsi_adapter from int to
void. Use XS_NO_CCB error in the scsi command (xs) to report the
NO_CCB condition. Eliminates all SUCCESSFULLY_QUEUED and COMPLETE
confusion and untangles the midlayer from the adapter a bit more.

Eyes and some fixes by miod@

There may be some compile issues on little used (i.e. I don't have
any) drivers but the change is mechanical and thus easy to remedy.

ok dlg@

Revision 1.12 / (download) - annotate - [select for diffs], Sun Jan 3 01:36:40 2010 UTC (14 years, 5 months ago) by dlg
Branch: MAIN
CVS Tags: OPENBSD_4_7_BASE, OPENBSD_4_7
Changes since 1.11: +1 -2 lines
Diff to previous 1.11 (colored)

scsi_done sets ITSDONE, we dont have to do it.

Revision 1.11 / (download) - annotate - [select for diffs], Tue Dec 1 01:40:02 2009 UTC (14 years, 6 months ago) by dlg
Branch: MAIN
Changes since 1.10: +69 -28 lines
Diff to previous 1.10 (colored)

put the midlayer changes back in.

the two issues affecting it last time are gone. the first, mishandling of
TRY_AGAIN_LATER is not relevant now that krw got rid of TRY_AGAIN_LATER.
the second, the misbehaving IBM disk was found to be a problem with siop
using ordered tags on most ops combined with the speed of the new code.

putting this in so we can move forward.

ok krw@ "commit please" marco@

Revision 1.10 / (download) - annotate - [select for diffs], Thu Nov 12 06:20:27 2009 UTC (14 years, 7 months ago) by dlg
Branch: MAIN
Changes since 1.9: +28 -69 lines
Diff to previous 1.9 (colored)

revert midlayer back to it was before i put my big rewrite in. this is
causing a weird problems on an alpha and also appears responsible for
isp(4) weirdness i havent had a chance to examine yet.

sigh, this makes me sad.

Revision 1.9 / (download) - annotate - [select for diffs], Tue Nov 10 10:13:08 2009 UTC (14 years, 7 months ago) by dlg
Branch: MAIN
Changes since 1.8: +69 -28 lines
Diff to previous 1.8 (colored)

backout the backout marco did of my code because of the NO_CCB breakage.
the fix for the NO_CCB breakage will follow shortly.

tested by krw@ marco@ johan@
ok krw@ marco@

Revision 1.8 / (download) - annotate - [select for diffs], Thu Nov 5 03:33:52 2009 UTC (14 years, 7 months ago) by marco
Branch: MAIN
Changes since 1.7: +28 -69 lines
Diff to previous 1.7 (colored)

The big diff dlg committed to the midlayer breaks NO_CCB and
TRY_AGAIN_LATER.  NO_CCB is a timer based mechanism that can trivially
be made to fail by running IO to two or more disks simultaneously.  The
TRY_AGAIN_LATER thing is more subtle because it now is a permanent
failure instead of transient however this is much harder to hit because
something must have gone wrong before it hits.

ok deraadt krw miod

Revision 1.7 / (download) - annotate - [select for diffs], Fri Oct 23 01:02:29 2009 UTC (14 years, 7 months ago) by dlg
Branch: MAIN
Changes since 1.6: +5 -5 lines
Diff to previous 1.6 (colored)

if you're attempting to detach multiple devices (eg, many targets,
many luns, or the entire bus), dont report ENXIO as an error to the
caller. this broke autoconf when it tried to forcefully remove a
bus such as umass and it thought there was a failure.

this introduces a way for scsi hbas to call activate/deactivate on
a device based on its target/lun address via a call to scsi_activate().
they can then schedule the actual detach/attach in a thread later via
scsi_req_probe/detach.

the mpi changes tweak the sas event handling code to use these apis
to properly handle attaches and detaches of disks. event handling
is still disabled till i can make it less chatty.

umass breakage reported by form@

Revision 1.6 / (download) - annotate - [select for diffs], Thu Oct 22 11:56:32 2009 UTC (14 years, 7 months ago) by dlg
Branch: MAIN
Changes since 1.5: +14 -1 lines
Diff to previous 1.5 (colored)

devices below the scsibus should all be detached via scsi_detach_lun.
scsibusdetach wasnt doign it properly, so we would be leaking on detach in
some cases.

now, with the introduction of mpath, the scsi_link structures can
represent a path to a mpath node as well as normal devices. this
intercepts the device activate entrypoints and sends them to mpath
if it it in use rather than assuming a device is always there. the
scsibusdetach change ensures that detach always ends up handling
the mpath node case too.

hotplug bus functionality (eg, usb) tested by form@

Revision 1.5 / (download) - annotate - [select for diffs], Wed Oct 14 01:33:22 2009 UTC (14 years, 8 months ago) by dlg
Branch: MAIN
Changes since 1.4: +18 -9 lines
Diff to previous 1.4 (colored)

rework how devids are handled in the midlayer and mpath.

previously a devid was a structure containing its type, length, and
a pointer to the actual devid value. this has been changed so a
devid is a header followed immediately by the memory making up the
id value. this allows the header and its value to be allocated
together.

devids are now reference counted, so multiple things (eg, the mpath
node handlers and the various scsi_link structures) can share the
same allocation safely. this also frees devids when scsi_links go
away, which was previously not done.

if mpath is enabled, then print the devids out as part of the devices
attach line.

Revision 1.4 / (download) - annotate - [select for diffs], Mon Sep 14 00:03:28 2009 UTC (14 years, 9 months ago) by dlg
Branch: MAIN
Changes since 1.3: +38 -19 lines
Diff to previous 1.3 (colored)

rework the scsi midlayer to start addressing some problems i have
with it which became extremely annoying with what mpath wants to
do.

the major change is a new interface for submitting scsi commands.
previously the only way for drivers like sd, cd, st, etc to push
commands onto the hardware was via scsi_scsi_cmd(). the problem
with scsi_scsi_cmd is that it doesnt tell the caller if the command
failed, was queued, or completed unless you shoved a buf down with
it. this is important for mpath which wants to know what the physical
path to the device did so it can report it back to the midlayer
which called it.

this provides a new api which lets drivers like cd/sd/st/mpath etc
allocate an xs, fill it in, and provide a completion routine which
the midlayer will call with the state of the command when it is
finished with it. the caller is then responsible for freeing the
xs.

from the hba side of thing, the return code from the scsi_cmd
entrypoint is largely ignored now, and it is now always the
responsibility of the hba driver to call scsi_done when it has
completed the io, rather than returning COMPLETE and expecting the
midlayer to do it for you.

i have emulated scsi_scsi_cmd on top of this new api so existing
users of it will continue to work. sd(4) has been reworked to use
the new api directly to both demonstrate its use and test that the
new api actually does work.

this diff was mostly written in a day at f2k9. thanks to miod for poking
through hba drivers to help mitigate against fallout from the change to
the COMPLETE semantic. this has been reviewed by krw who didnt spot
anything wrong.

thanks to dave del debbio for testing.

ok deraadt@

Revision 1.3 / (download) - annotate - [select for diffs], Sun Aug 9 16:55:02 2009 UTC (14 years, 10 months ago) by dlg
Branch: MAIN
Changes since 1.2: +15 -1 lines
Diff to previous 1.2 (colored)

shove a minphys request against mpath down all to the minphys on each path
so we can guarantee that any of the paths we push the io down later will
work.

with help from a discussion from beck and krw

Revision 1.2 / (download) - annotate - [select for diffs], Sun Aug 9 16:20:19 2009 UTC (14 years, 10 months ago) by dlg
Branch: MAIN
Changes since 1.1: +29 -2 lines
Diff to previous 1.1 (colored)

if a physical path to a device behind mpath goes away, remove the path. it
is worth noting that the device on mpath will persist even if all the paths
behind it have gone away. returning the paths will allow operations to work
against the device again.

Revision 1.1 / (download) - annotate - [select for diffs], Sun Aug 9 12:47:23 2009 UTC (14 years, 10 months ago) by dlg
Branch: MAIN

add mpath(4), a driver that steals paths to scsi devices if it
thinks they could be available via multiple paths. those stolen
devices are then made available via mpath(4).

this is the minimum amount of code to implement the stealing. it
is generally broken and very brittle, so it is currently disabled.

it is going in so i can work on it in the tree.

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.