CAM rescanner thread?

Justin T. Gibbs gibbs at scsiguy.com
Sat Jan 13 10:53:54 PST 2007


 > Actually, no. Now that I think about it and look at the code in
 > cam_xpt.c, AC_FOUND_DEVICE seems to have a different semantic. It
 > seems to be an announcement to all periph's who care *after* the
 > device has been probed and configured.

Yes.

 > If you look at xpt_async itself, it walks existing target and device
 > entries delivering the async_code. Even if the path for the async
 > event is a wildcard, it still needs a cam_ed to deliver something
 > to.

There are wildcard cam_ed's in the tree that allow callbacks to
be registered for events that happen at any level - even a fully
wildcarded path.

 > The broadcast async stuff appears like it is *thinking* about having
 > this done. In fact, code in da (daasync) seems to want to do this-
 > but it requires initial inquiry data (via a ccb_getdev argument)
 > which really makes me scratch my head a bit.

AC_FOUND_DEVICE should only be issued once the transport layer believes
that a device is configured sufficiently to be used.

 > This is a prime example of how not having a mind-meld with Ken or
 > Justin really hurts. We can ask them what they were thinking about
 > this, and it'll probably make sense, but because this isn't all
 > very highly documented the architecture is often what you *guess*
 > it is :-).

When the CAM code for FreeBSD was originally written, CAM3 was in
development but not quite out yet.  The draft documents contain
some fledgling support for dynamic configuration and binding operations
that dissassociate physical from logic addressing.  You can still get
CAM-3 here:

    http://www.t10.org/ftp/t10/drafts/cam3/cam3r03.pdf

It's discovery and bind CCB types may be a good starting point for
addressing these issues.  With the discovery process moved to a
thread and some augmentation to XPT_SCAN_*, we should be good enough
for now.

The only tricky part about using CCBs to intiate scanning is that
they potentially require the allocation of memory from interrupt context.
It would be nice to provide a service to all SIMs that can perform
dynamic discovery such that they have a high probability of attaining
their CCB in these situations.

--
Justin



More information about the freebsd-scsi mailing list