Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 11 Oct 2012 12:13:27 +0530
From:      Jack <jacks.1785@gmail.com>
To:        freebsd-scsi@freebsd.org
Subject:   passstart() and immediate CCBs
Message-ID:  <CACmXQA141ZTRDd7DxfM41hd4idDg_uQ7%2BsWc4cZ8E%2B3aLoDJRg@mail.gmail.com>

next in thread | raw e-mail | index | archive | help
Hello all,

I was going through cam subsystem source(FreeBSD RELEASE 9 ),
and tried understanding how it works.
One thing I got stuck is, when exactly is passtart() invoked in case of
immediate CCBs. For non-immediate CCBs, it is quite clear to me.

In case of scsi pass driver(scsi_pass.c),  xpt_schedule() is invoked by
cam_periph_getccb(), and cam_periph_ioctl().
But not in case of immediate CCBs. In case  of immediate CCBs,
xpt_alloc_ccb_nowait() is invoked and then  xpt_setup_ccb().

Is it that in case of immediate CCBs, passstart() is never invoked?

If it is true then, how does the thread awakens(which is slept by calling
cam_periph_ccbwait() inside cam_periph_runccb() ) when HBA driver
serves interrupt, and passdone() is invoked.


There seems no code inside passdone(), to wakeup the thread, the
only code being inside PASS_CCB_WAITING case is not valid
for immediate CCBs, as passstart() is never invoked so it didn't
set ccb type to PASS_CCB_WAITING.

Do immediate and immediate CCBs have any implications on
cam priority assignment specified in CCB header?

It seems that concept of which queues are in existence in cam subsystem
is not clear to me.
ie beginning from cam_periph_runccb(), how passdone() is invoked,
how passstart() is invoked if it is, and which queues are involved,
especially in case of immediate CCBs.


As far as I can get, there are at least 2 queues:
 one is maintained by SCSI HBA driver for I/O requests, the other is queue
of CCBs maintained per cam peripheral( ie struct cam_peripheral) ?? or
 cam device (ie struct cam_ed) ?? at transport layer.


I've been looking around, but haven't found anything yet.
I'll continue digging though :-)

Regards
-- 
Jack



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CACmXQA141ZTRDd7DxfM41hd4idDg_uQ7%2BsWc4cZ8E%2B3aLoDJRg>