HP OpenVMS Systems Documentation
OpenVMS I/O User's Reference Manual
7.4 Error Processing
Shadow set recovery and repair are handled by volume processing, whichreplaces mount verification for shadow sets. Membership failuredecisions are made by the VAX hosts. Device errors that result ininaccessibility of physical member units first utilize the classdriver's connection walking algorithm. If that fails, a local decisionis made on the shadow set membership. The rules are:
There are two types of volume processing: active and passive. Active volume processing handles error processing on a local node. Triggered by a failed I/O operation, active volume processing also controls mount verification functions, member removal, and failover. Passive volume processing is triggered by lock messages or by a cluster event. Passive volume processing revalidates shadow set membership, ensures that the shadow set reflects changes made outside the shadow set, and handles the following functions:
For more information, refer to the Volume Shadowing for OpenVMS manual.
Because incorrect or malicious use of the generic SCSI class driver canresult in SCSI bus hangs and lead to SCSI bus resets, DIAGNOSE andPHY_IO or LOG_IO privileges are required to access the driver. Anapplication program can be designed in such a way as to filter user I/Orequests, which allows nonprivileged users access to some devicefunctions.
Interactive commands and procedure calls can use the OpenVMS generic SCSI class driver to access devices on the SCSI bus. However, it is unlikely that a user application would access a device on the SCSI bus by directly using the $QIO interface of the generic SCSI class driver. First of all, any user process directly using the $QIO interface would require DIAGNOSE and PHY_IO or LOG_IO privileges. Under normal circumstances, it would be a system security risk to grant DIAGNOSE and PHY_IO or LOG_IO privileges to many system users. Secondly, it would be cumbersome for end users of the device to identify, format, and issue SCSI commands to the device. Rather, it would be more efficient to develop an interface that hides these details.
A utility program, installed with the DIAGNOSE and PHY_IO or LOG_IOprivileges, can provide nonprivileged users with a command-lineinterface to a SCSI device. The utility translates interactive commandsprovided by the user into the appropriate set of SCSI commands andsends them to the device using the $QIO interface provided by thegeneric SCSI class driver. The utility checks user commands to ensurethat only valid SCSI commands are sent to the device. Refer to theOpenVMS System Manager's Manual and the OpenVMS System Management Utilities Reference Manual for information about installingimages with privileges.
A privileged shareable image can provide system applications with a procedure interface to a SCSI device. The image contains a set of procedures that translate operations specified by the caller into the appropriate set of SCSI commands. The SCSI commands are sent to the device through the $QIO interface of the generic SCSI class driver. The privileged shareable image checks its caller's parameters to ensure that only valid SCSI commands are sent to the device. Refer to the OpenVMS Programming Concepts Manual for information about creating shareable images.
8.5 SCSI Port Features Under Application Control
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:
The following sections discuss these features.
8.5.1 Setting the Data Transfer Mode
The SCSI bus defines two data transfer modes, asynchronous andsynchronous. In asynchronous mode, for each REQ from a target there isan ACK from the host prior to the next REQ from the target. Synchronousmode allows higher data transfer rates by allowing a pipelined datatransfer mechanism where, for short bursts (defined by the REQ-ACKoffset), the target can pipeline data to an initiator without waitingfor the initiator to respond.
Whether or not a port or a target device allows synchronous datatransfers, it is harmless for the program to set up the connection touse such transfers. If synchronous mode is not supported, the portdriver 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 programusing the generic SCSI class driver sets the syn bitin the flags field of the generic SCSI descriptor, theaddress of which is passed to the driver in the p1argument to the $QIO request.
8.5.2 Enabling Disconnection and Reselection
The ANSI SCSI specification defines a disconnection facility thatallows a target device to yield ownership of the SCSI bus while seekingor performing other time-consuming operations. When a targetdisconnects from the SCSI bus, it sends a sequence of messages to theinitiator that cause it to save the state of the I/O transfer inprogress. Once this is done, the target releases the SCSI bus. When thetarget is ready to complete the operation, it reselects the initiatorand sends to it another sequence of messages. This sequence uniquelyidentifies the target and allows the initiator to restore the contextof the suspended I/O operation.
Whether disconnection should be enabled or disabled on a givenconnection depends on the nature and capabilities of the deviceinvolved in the transfer, as well as on the configuration of thesystem. In configurations where there is a slow device present on theSCSI bus, enabling disconnection on connections that transfer data tothe device can increase bus throughput. By contrast, systems where mostof the I/O activity is directed towards a single device for longintervals can benefit from disabling disconnection. By disablingdisconnection when there is no contention on the SCSI bus, port driverscan increase throughput and decrease the processor overhead for eachI/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
When the command retry mechanism is enabled, the port driver retries upto three times any I/O operation that fails during the COMMAND,Message, Data, or STATUS phases. For instance, if the port driverdetects a parity error during the Data phase, it aborts the I/Ooperation, logs an error, and retries the I/O operation. It repeatsthis sequence twice more, if necessary. If the I/O operation completessuccessfully during a retry attempt, the port driver returns successstatus to the class driver. However, if all retry attempts fail, theport driver returns failure status to the class driver.
An application may need to disable the command retry mechanism undercertain circumstances. For example, repeated execution of a command ona sequential device may produce different results than are intended bya single command request. A tape drive could perform a partial writeand then repeat the write without resetting the tape position.
An application program using the generic SCSI class driver can disablethe command retry mechanism by setting the dpr bit ofthe flags field of the generic SCSI descriptor, theaddress of which is passed to the driver in the p1argument to the $QIO request.
8.5.4 Setting Command Timeouts
|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 isresponsible for maintaining both of these timeout values. It has thefollowing options:
On VAX systems, the System Generation utility (SYSGEN) loads thegeneric SCSI class driver into system virtual memory, createsadditional data structures for the device unit, and calls the driver'scontroller initialization routine and unit initialization routine.SYSGEN automatically loads and autoconfigures the SCSI port driver atsystem initialization. As part of autoconfiguration, SYSGEN polls eachdevice on each SCSI bus. If the device identifies itself as adirect-access device, direct-access CD-ROM device, or flexible diskdevice, SYSGEN automatically loads the disk class driver (DKDRIVER). Ifthe device identifies itself as a sequential-access device, SYSGENautomatically loads the tape class driver (MKDRIVER). If theautoconfiguration facility does not recognize the type of the SCSIdevice, it does not load a driver.
If a third-party-supplied SCSI device requires that the generic classdriver be loaded, it must be configured by an explicit SYSGEN CONNECTcommand, as follows:
$ RUN SYS$SYSTEM:SYSGENSYSGEN> CONNECT GKpd0u /NOADAPTER
On Alpha systems, SYSMAN performs the same functions that SYSGENperforms on VAX systems. If a third-party-supplied SCSI device requiresthat the generic class driver be loaded, the device must be configuredby an explicit SYSMAN CONNECT command, as follows:
$ RUN SYS$SYSTEM:SYSMANSYSMAN> IO CONNECT GKpd0u /NOADAPTER/DRIVER=SYS$GKDRIVER
On VAX and Alpha systems, GK is the device mnemonic for the generic SCSI class driver (GKDRIVER); p represents the SCSI port ID (for instance, the controller ID A or B); d represents the SCSI device ID (a digit from 0 to 7); 0 signifies the digit zero; and u represents the SCSI logical unit number (a digit from 0 to 7).
Multiple devices residing on any SCSI bus in the system can shareGKDRIVER as a class driver, as long as a CONNECT command is issued foreach target device that requires the driver.
Because just one connection can exist through the SCSI port driver toeach target, the generic class driver cannot be used for a target if adifferent SCSI class driver is already connected to that target. Forexample, if the SCSI disk class driver has a connection to device ID 2on the SCSI bus identified by SCSI port ID B (DKB200), thegeneric class driver cannot be used to communicate with this disk. Anattempt to connect GKDRIVER for this target results in GKB200 beingplaced off line.
8.6.1 Disabling the Autoconfiguration of a SCSI Device (VAX Only)
On VAX systems, in special cases you may need to prevent theautoconfiguration facility from loading the disk or tape class driverfor a device with a specific port ID and device ID. This would be thecase if a SCSI device, supplied by a source other than Compaq, shouldidentify itself as either a random-access or sequential-access deviceand were to be controlled by the generic SCSI class driver.
To disable the loading of a disk or tape driver for any given deviceID, OpenVMS defines the special system parameterSCSI_NOAUTO.
The SCSI_NOAUTO system parameter, as shown inFigure 8-3, stores a bit mask of 32 bits in which the low-order bytecorresponds to the first SCSI bus (PKA0), the second byte correspondsto the second SCSI bus (PKB0), and so on. For each SCSI bus, settingthe low-order bit inhibits automatic configuration of the device withSCSI device ID 0; setting the second low-order bit inhibits automaticconfiguration of the device with SCSI device ID 1, and so forth. Forinstance, the value 0000200016 would prevent the device withSCSI ID 5 on the bus identified by SCSI port ID B from beingconfigured. By default, all of the bits in the mask are cleared,allowing all devices to be configured.
Figure 8-3 SCSI_NOAUTO System Parameter