tcpdump mailing list archives

Re: pcap DLT request for virtio-scsi SCSI transport


From: Guy Harris <guy () alum mit edu>
Date: Thu, 26 Apr 2012 12:13:18 -0700


On Mar 26, 2012, at 2:17 AM, Cong Meng wrote:

I drafted some description. Should I make an HTML version?

Yes, matching the style of the other ones, once the issues that are raised are resolved.

(Of course, for the diagrams, we just cheat and use <pre>.)

LINKTYPE_VIRTIO_SCSI

Packet structure

+---------------+
|  Pack Type    |
|  (4 Octets)   |
+---------------+
|  Tag          |
|  (4 Octets)   |
+---------------+
|  Initiator    |
|  (4 Octets)   |
+---------------+
|  Target       |
|  (4 Octets)   |
+---------------+
|  Lun          |
|  (4 Octets)   |
+---------------+
|  CDB Size     |
|  (4 Octets)   |
+---------------+
|  Sense Size   |
|  (4 Octets)   |
+---------------+
|  Header Size  |
|  (4 Octets)   |
+---------------+
|  Data Size    |
|  (4 Octets)   |
+---------------+
|               |
|  Header       |
|               |
+---------------+
|               |
|  Data         |
|               |
+---------------+


Description

Pack Type:
 REQ_CMD     0x000 
 REQ_TMF     0x010 
 REQ_ANQ     0x011 
 REQ_ANS     0x012 

 RESP_CMD    0x100 
 RESP_TMF    0x110 
 RESP_ANQ    0x111 
 RESP_ANS    0x112

So what do the packet types mean?  Are they:

        REQ_CMD         SCSI command
        RESP_CMD        SCSI command response

        REQ_TMF         task management function
        RESP_TMF        task management function response

        REQ_ANQ         asynchronous notification query
        RESP_ANQ        asynchronous notification query response

        REQ_ANS         asynchronous notification subscription
        RESP_ANS        asynchronous notification subscription response?

And do they all have the same contents, with the same fields filled in, or are some fields not used for some packet 
types?

Tag:
 The tag to match a response to corresponding request.

I.e., both requests and responses have tag values, and the tag values for a given request and its response are the same?

CDB Size:
 The maximal size of CDB. 

Sense Size:
 The maximal size of Sense data.

So is that the maximum size or the actual size?  The description of a SCSI command request is

        struct virtio_scsi_req_cmd {
                // Read−only
                u8 lun[8];
                u64 id;
                u8      task_attr ;
                u8 prio;
                u8 crn;
                char    cdb [ cdb_size ] ;
                char    dataout [ ] ;
                // Write−only part
                u32     sense_len ;
                u32     residual ;
                u16     status_qualifier ;
                u8      status ;
                u8      response ;
                u8      sense [ sense_size ];
                char    datain [ ] ;
        };

so would "CDB Size" be the same as cdb_size and "Sense Size" be the same as sense_size?

Header Size:
 The size of the header of a request/response.

Data Size:
 The size of Data-Out or Data-In.

Header:
 The request or response header. 
 This header is described in Appendix H of the virtio specification:
 http://ozlabs.org/~rusty/virtio-spec/virtio-0.9.4.pdf

Are the headers:

        REQ_CMD, RESP_CMD               struct virtio_scsi_req_cmd
        REQ_TMF, RESP_TMF               struct virtio_scsi_ctrl containing struct virtio_scsi_ctrl_tmf
        REQ_ANQ, RESP_ANQ               struct virtio_scsi_ctrl containing struct virtio_scsi_ctrl_an
        REQ_ANS, RESP_ANS               struct virtio_scsi_ctrl containing struct virtio_scsi_ctrl_an

Or is the header for a REQ_xxx the "Read-only part" and for a RESP_XXX the "Write-only part"?

And do the headers include the LUN, given that the packet structure also includes a LUN - although the packet 
structure's LUN is 4 bytes rather than 8 bytes?

Do they include the type field in struct virtio_scsi_ctrl, given that the type field seems to be VIRTIO_SCSI_T_TMF for 
REQ_TMF/RESP_TMF, VIRTIO_SCSI_T_AN_QUERY for REQ_ANQ/RESP_ANQ, and VIRTIO_SCSI_T_AN_SUBSCRIBE for REQ_ANS/RESP_ANS, so 
it's redundant?

Data:
 Data-Out or Data-In block.

The request description above includes "dataout" and "datain" fields; are those absent from the Header field and, 
instead, contained in the Data field?
-
This is the tcpdump-workers list.
Visit https://cod.sandelman.ca/ to unsubscribe.


Current thread: