SCSI

  1. Small computer systems interface (SCSI)
    1. SCSI commands
    2. SCSI LUN discovery
    3. SCSI read
    4. SCSI write
    5. Mode pages
      1. Disconnect-reconnect
      2. FC logical unit control
      3. FC port control
  2. SCSI accessed fault-tolerant enclosure (SAF-TE)
  3. SCSI enclosure services (SES)

Small computer systems interface (SCSI)

  • bus: half-duplex
    • defines protocol, physical interfaces, electrical interfaces
    • master/slave
    • strict priority
    • usually 1 initiator per bus; can be several for clusterization
  • for spinning disks
  • logical unit number (LUN): logical ID ≡ virtial controller
    • host has exclusive control over LUN, otherwise – race condition (on mount – signature is written at the start of partition)
    • does not care about file system ⇒ LUN can be extended, cannot be shrunk
  • OS addressing: controller ID, SCSI ID, LUN
    • SCSI ID: 0-7, 7 = highest
    • new SCSI ID: 8-15 added; priority (decreasing) ≡ 7-0, 15-8
  • 1 queue ≡ one magnet head
  • command queue: 64
  • modes
    • async
      • requires each command to be acknowledged before sending next command
      • lower BW, than in sync
    • sync
      • several commands can be not acknowledged before sending next command ≈ TCP window
      • initiator and target negotiate the permitted number of transient commands
      • implemented on electrical interface level, not in software

SCSI commands

  • 0x00: TEST UNIT READY
  • 0x03: REQUEST SENSE
    • previous command error code
  • 0x04: FORMAT
    • low-level format (disks)
  • 0x12: INQUIRY
    • device type: direct access, sequential
    • medium type: removable, not-removable
    • version
    • supported address space
    • options
  • 0x15: MODE SELECT (6)
    • inform target which parameters to use
  • 0x1a: MODE SENSE (6)
    • discover LUNS and parameters within target
  • 0x1b: START STOP UNIT
    • eject/insert CD
    • spin disk up/down
  • 0x25: READ CAPACITY
  • 0x55: MODE SELECT (10)
    • inform target which parameters to use
  • 0x5a MODE SENSE (10)
    • discover LUNS and parameters within target
  • 0xa0: REPORT LUNS

SCSI LUN discovery

  1. initiator sequentially sends TEST UNIT READY to every address on the bus
    • few addresses ⇒ poll is quick and simple
  2. initiator sends INQUIRY to every address, that responded
  3. initiator sends REPORT LUNS to discover LUNs

SCSI read

  • process
    1. initiator → read cmd (starting block address, number of blocks)
    2. target → data
    3. target → SCSI status
  • fragmented data requires several calls, because read is only sequential
  • no need for flow control: initiator does not request more than it can accept

SCSI write

  • process
    1. initiator → write cmd (starting block address, number of blocks)
    2. target → ready to receive
    3. initiator → data
    4. target → SCSI status
  • flow control required:
    • initiator does not know, how much data can target accept
    • performed by SCSI transport protocol

Mode pages

Disconnect-reconnect

   0     1     2     3     4     5     6     7
+-----+-----+-----+-----+-----+-----+-----+-----+
| PS  | SPF |             Page code             |
+-----+-----+-----+-----+-----+-----+-----+-----+
|                  Page length                  |
+-----+-----+-----+-----+-----+-----+-----+-----+
|               Buffer full ratio               |
+-----+-----+-----+-----+-----+-----+-----+-----+
|              Buffer empty ratio               |
+-----+-----+-----+-----+-----+-----+-----+-----+
|_            Bus inactivity limit             _|
|                                               |
+-----+-----+-----+-----+-----+-----+-----+-----+
|_            Disconnect time limit            _|
|                                               |
+-----+-----+-----+-----+-----+-----+-----+-----+
|_              Connect time limit             _|
|                                               |
+-----+-----+-----+-----+-----+-----+-----+-----+
|_              Maximum burst size             _|
|                                               |
+-----+-----+-----+-----+-----+-----+-----+-----+
|EMDP |        FA       |DIMM |      DTDC       |
+-----+-----+-----+-----+-----+-----+-----+-----+
|                   Reserved                    |
+-----+-----+-----+-----+-----+-----+-----+-----+
|_              First burst size               _|
|                                               |
+-----+-----+-----+-----+-----+-----+-----+-----+

PS: parameters savable, = 0
SPF: subpage format, = 0
Page code: 0x02
Page length: bytes without 1st byte, = 15
EMDP: enable modify data pointers, 1 ≡ data overlay support (overrides PRLI)
FA: fair arbitration
DIMM: disconnect immediate
Maximum burst size: 512-byte words, how much can be sent in 1 FCP_DATA
First burst size: 512-byte words, size of unsolicited FCP_DATA
DTDC: data transfer disconnect control

  • 000: not used
  • 001: data within a single interconnect tenancy for cmd
  • 011: data & response for cmd within a single interconnect tenancy for cmd

FC logical unit control

   0     1     2     3     4     5     6     7
+-----+-----+-----+-----+-----+-----+-----+-----+
| PS  | SPF |             Page code             |
+-----+-----+-----+-----+-----+-----+-----+-----+
|                  Page length                  |
+-----+-----+-----+-----+-----+-----+-----+-----+
|        Reserved       |      Protocol ID      |
+-----+-----+-----+-----+-----+-----+-----+-----+
|                Reserved                 |EPDC |
+-----+-----+-----+-----+-----+-----+-----+-----+
|_                                             _|
|_                   Reserved                  _|
|_                                             _|
|                                               |
+-----+-----+-----+-----+-----+-----+-----+-----+

PS: parameters savable, = 0
SPF: subpage format, = 0
Page code: 0x18
Page length: bytes without 1st byte, = 6
EPDC: enable precise delivery checking, 1 ≡ enable in-order command delivery
Protocol ID:

  • 0 ≡ FC protocol

FC port control

   0     1     2     3     4     5     6     7
+-----+-----+-----+-----+-----+-----+-----+-----+
| PS  | SPF |             Page code             |
+-----+-----+-----+-----+-----+-----+-----+-----+
|                  Page length                  |
+-----+-----+-----+-----+-----+-----+-----+-----+
|        Reserved       |      Protocol ID      |
+-----+-----+-----+-----+-----+-----+-----+-----+
|                Reserved                 |EPDC |
+-----+-----+-----+-----+-----+-----+-----+-----+
|DTFD |PLPB |DDIS | DLM | RHA |ALWI |DTIPE|DTOLI|
+-----+-----+-----+-----+-----+-----+-----+-----+
|_                  Reserved                   _|
|                                               |
+_                            +-----+-----+-----+
|                             |  RR_TOV units   |
+-----+-----+-----+-----+-----+-----+-----+-----+
|                 RR_TOV value                  |
+-----+-----+-----+-----+-----+-----+-----+-----+

PS: parameters savable, = 0
SPF: subpage format, = 0
Page code: 0x19
Page length: bytes without 1st byte, = 6
EPDC: enable precise delivery checking, 1 ≡ enable in-order command delivery
Protocol ID:

  • 0 ≡ FC protocol

DTFD: disable target fabric discovery, discover FC_AL
PLPB: prevent loop port bypass, FC_AL LPB and PBE
DDIS: disable discovery, FC_AL, 1 ≡ does not require ADISC/PDISC after loop init
DLM: disable loop master, 1 ≡ cannot become AL master
RHA: require hard address, FC_AL, 1 ≡ if requested address is not allocated – fail
ALWI: allow login without loop initialization, FC_AL
DTIPE: disable target initiated port enable, FC_AL, 1 ≡ wait for LPE before init
DTOLI: disable target originated loop init, FC_AL
RR_TOV units:

  • 011: 0.1s

SCSI accessed fault-tolerant enclosure (SAF-TE)

  • part of IPMI
  • enclosure monitoring: SCI controller ≡ initiator → SCSI enclosure ≡ target
    • temperature
    • voltage
  • SCSI commands
    • INQUIRY
    • READ BUFFER
    • REQUEST SENSE
    • SEND DIAGNOSTIC
    • TEST UNIT READY
    • WRITE BUFFER

SCSI enclosure services (SES)

  • ANSI T10
  • enclosure monitoring: SES ≡ SCSI target
  • SCSI commands
    • SEND DIAGNOSTIC
    • RECEIVE DIAGNOSTIC RESULTS