The standard OpenVMS SCSI port driver provides
mechanisms by which the generic SCSI class driver can control the
nature of data transfers and command transmission across the SCSI
bus. An application uses the $QIO interface to tailor these mechanisms
to the specific device it supports. Among the features under application
program control are the following:
Disconnection and reselection
The following sections discuss these features.
8.5.1 Setting the Data Transfer Mode |
|
The SCSI
bus defines two data transfer modes, asynchronous and synchronous.
In asynchronous mode, for each REQ from a target there is an ACK from
the host prior to the next REQ from the target. Synchronous mode allows
higher data transfer rates by allowing a pipelined data transfer mechanism
where, for short bursts (defined by the REQ-ACK offset), the target
can pipeline data to an initiator without waiting for the initiator
to respond.
Whether or not a port or a target device allows synchronous
data transfers, it is harmless for the program to set up the connection
to use such transfers. If synchronous mode is not supported, the port
driver automatically uses asynchronous mode.
For example, to use synchronous mode in a transfer,
a programmer using the generic SCSI class driver must ensure that
both the SCSI port and the SCSI device involved in the transfer support
synchronous mode. The SCSI port of the VAXstation 3520/3540 system
allows both synchronous and asynchronous transfers, whereas that of
OpenVMS 3100 systems supports only asynchronous transfers.
To set up a connection to use synchronous data
transfer mode, a program using the generic SCSI class driver sets
the syn bit in the flags field of the generic SCSI descriptor, the address
of which is passed to the driver in the p1 argument to the $QIO request.
8.5.2 Enabling Disconnection and Reselection |
|
The ANSI SCSI specification defines a disconnection facility that
allows a target device to yield ownership of the SCSI bus while seeking
or performing other time-consuming operations. When a target disconnects
from the SCSI bus, it sends a sequence of messages to the initiator
that cause it to save the state of the I/O transfer in progress. Once
this is done, the target releases the SCSI bus. When the target is
ready to complete the operation, it reselects the initiator and sends
to it another sequence of messages. This sequence uniquely identifies
the target and allows the initiator to restore the context of the
suspended I/O operation.
Whether disconnection should be enabled or disabled
on a given connection depends on the nature and capabilities of the
device involved in the transfer, as well as on the configuration of
the system. In configurations where there is a slow device present
on the SCSI bus, enabling disconnection on connections that transfer
data to the device can increase bus throughput. By contrast, systems
where most of the I/O activity is directed towards a single device
for long intervals can benefit from disabling disconnection. By disabling
disconnection when there is no contention on the SCSI bus, port drivers
can increase throughput and decrease the processor overhead for each
I/O request.
By default, the OpenVMS class/port interface disables
the disconnect facility on a connection. To enable disconnection,
an application program using the generic SCSI class driver sets the dis bit of the flags field of the generic SCSI descriptor, the address of which is passed
to the driver in the p1 argument
to the $QIO call.
8.5.3 Disabling Command Retry |
|
The SCSI port driver implements a command retry mechanism, which
is enabled on a given connection by default.
When the command retry mechanism is enabled, the
port driver retries up to three times any I/O operation that fails
during the COMMAND, Message, Data, or STATUS phases. For instance,
if the port driver detects a parity error during the Data phase, it
aborts the I/O operation, logs an error, and retries the I/O operation.
It repeats this sequence twice more, if necessary. If the I/O operation
completes successfully during a retry attempt, the port driver returns
success status to the class driver. However, if all retry attempts
fail, the port driver returns failure status to the class driver.
An application may need to disable the command
retry mechanism under certain circumstances. For example, repeated
execution of a command on a sequential device may produce different
results than are intended by a single command request. A tape drive
could perform a partial write and then repeat the write without resetting
the tape position.
An application program using the generic SCSI
class driver can disable the command retry mechanism by setting the dpr bit of the flags field of the generic SCSI descriptor, the address of which is passed
to the driver in the p1 argument
to the $QIO request.
8.5.4 Setting Command Timeouts |
|
The SCSI port driver implements several timeout mechanisms, some
governed by the ANSI SCSI specification and others required by OpenVMS.
The time-outs required by OpenVMS include the following:
Timeout | Description |
---|
Phase
change timeout | Maximum
number of seconds for a target to change the SCSI bus phase or complete
a data transfer. (This value is also known as the DMA timeout.) Upon sending the last command
byte, the port driver waits this many seconds for the target to change
the bus phase lines and assert REQ (indicating a new phase). Or, if
the target enters the DATA IN or DATA OUT phase, the transfer must
be completed within this interval. |
Disconnect timeout | Maximum number of seconds, from
the time the initiator receives the DISCONNECT message, for a target
to reselect the initiator so that it can proceed with the disconnected
I/O transfer |
An application program using the generic SCSI
class driver is responsible for maintaining both of these timeout
values. It has the following options:
Accepting a connection's
default value. The default value for both timeouts is 20 seconds.
Altering the connection's
default value. To modify the default values, the class driver specifies
nonzero values for the phase change timeout and disconnect timeout fields of
the generic SCSI descriptor, the address of which is passed to the
driver in the p1 argument to the
$QIO system service call.