RTPG support
Implementing support of the Report Target Port Groups command. Tested on Ubuntu against Pure Storage Flash Array using designated unit tests and new iscsi-rtpg utility ./iscsi-rtpg -i iqn.2005-03.org.open-iscsi:6feb2db21ea iscsi://192.168.1.12/iqn.2010-06.com.purestorage:flasharray.4e8d52d82e4b2c0f/1 RTPG retrieved 2 groups Group 0x0000: preferred 0, format 0x00, ALUA state ACTIVE-OPTIMIZED,flags 0x8f, status code 0x02, port count 65 Ports: [ 0x1 0x2 0x3 0x4 0x5 0x6 0x7 0x8 0x9 0xa 0xb 0xc 0xd 0xe 0xf 0x10 0x41 0x42 0x43 0x44 0x45 0x46 0x47 0x48 0x49 0x4a 0x4b 0x4c 0x4d 0x4e 0x4f 0x50 0x51 0x52 0x53 0x54 0x55 0x56 0x57 0x58 0x59 0x5a 0x5b 0x5c 0x5d 0x5e 0x5f 0x60 0x61 0x62 0x63 0x64 0x65 0x66 0x67 0x68 0x69 0x6a 0x6b 0x6c 0x6d 0x6e 0x6f 0x70 0x71] Group 0x0001: preferred 0, format 0x00, ALUA state ACTIVE-OPTIMIZED,flags 0x8f, status code 0x02, port count 65 Ports: [ 0x11 0x12 0x13 0x14 0x15 0x16 0x17 0x18 0x19 0x1a 0x1b 0x1c 0x1d 0x1e 0x1f 0x20 0x72 0x73 0x74 0x75 0x76 0x77 0x78 0x79 0x7a 0x7b 0x7c 0x7d 0x7e 0x7f 0x80 0x81 0x82 0x83 0x84 0x85 0x86 0x87 0x88 0x89 0x8a 0x8b 0x8c 0x8d 0x8e 0x8f 0x90 0x91 0x92 0x93 0x94 0x95 0x96 0x97 0x98 0x99 0x9a 0x9b 0x9c 0x9d 0x9e 0x9f 0xa0 0xa1 0xa2]
This commit is contained in:
@@ -130,9 +130,22 @@ struct scsi_persistent_reserve_out_basic {
|
||||
};
|
||||
|
||||
enum scsi_maintenance_in {
|
||||
SCSI_REPORT_TARGET_PORT_GROUPS = 0x0a,
|
||||
SCSI_REPORT_SUPPORTED_OP_CODES = 0x0c
|
||||
};
|
||||
|
||||
enum scsi_alue_state {
|
||||
SCSI_ALUA_ACTIVE_OPTIMIZED = 0x0,
|
||||
SCSI_ALUA_ACTIVE_NONOPTIMIZED = 0x1,
|
||||
SCSI_ALUA_STANDBY = 0x2,
|
||||
SCSI_ALUA_UNAVAILABLE = 0x3,
|
||||
SCSI_ALUA_LOGICAL_BLOCK_DEPENDENT = 0x4,
|
||||
SCSI_ALUA_OFFLINE = 0xe,
|
||||
SCSI_ALUA_TRANSITIONING = 0xf
|
||||
};
|
||||
|
||||
const char *scsi_alua_state_to_str(uint8_t state);
|
||||
|
||||
enum scsi_op_code_reporting_options {
|
||||
SCSI_REPORT_SUPPORTING_OPS_ALL = 0x00,
|
||||
SCSI_REPORT_SUPPORTING_OPCODE = 0x01,
|
||||
@@ -969,6 +982,32 @@ struct scsi_report_supported_op_codes_one_command {
|
||||
struct scsi_op_timeout_descriptor to;
|
||||
};
|
||||
|
||||
struct scsi_target_port_group {
|
||||
union {
|
||||
struct {
|
||||
uint8_t pref:1;
|
||||
uint8_t rtpg_fmt:3;
|
||||
uint8_t alua_state:4;
|
||||
};
|
||||
uint8_t byte0;
|
||||
};
|
||||
uint8_t flags;
|
||||
uint16_t port_group;
|
||||
uint8_t status_code;
|
||||
uint8_t vendor_specific;
|
||||
uint8_t port_count;
|
||||
/* retrieved_port_count may be less than port_count when RTPG output
|
||||
* was trimmed due to the buffer size */
|
||||
uint8_t retrieved_port_count;
|
||||
/* points to 'retrieved_port_count' relative port ids */
|
||||
uint16_t *ports;
|
||||
};
|
||||
|
||||
struct scsi_report_target_port_groups {
|
||||
int num_groups;
|
||||
struct scsi_target_port_group groups[0];
|
||||
};
|
||||
|
||||
struct scsi_persistent_reserve_in_read_keys {
|
||||
uint32_t prgeneration;
|
||||
uint32_t additional_length;
|
||||
@@ -1162,6 +1201,7 @@ EXTERN struct scsi_task *scsi_cdb_read16(uint64_t lba, uint32_t xferlen, int blo
|
||||
EXTERN struct scsi_task *scsi_cdb_readcapacity16(void);
|
||||
EXTERN struct scsi_task *scsi_cdb_readdefectdata10(int req_plist, int req_glist, int defect_list_format, uint16_t alloc_len);
|
||||
EXTERN struct scsi_task *scsi_cdb_readdefectdata12(int req_plist, int req_glist, int defect_list_format, uint32_t address_descriptor_index, uint32_t alloc_len);
|
||||
EXTERN struct scsi_task *scsi_cdb_report_target_port_groups(uint32_t alloc_len);
|
||||
EXTERN struct scsi_task *scsi_cdb_report_supported_opcodes(int rctd, int options, enum scsi_opcode opcode, int sa, uint32_t alloc_len);
|
||||
EXTERN struct scsi_task *scsi_cdb_serviceactionin16(enum scsi_service_action_in sa, uint32_t xferlen);
|
||||
EXTERN struct scsi_task *scsi_cdb_startstopunit(int immed, int pcm, int pc, int no_flush, int loej, int start);
|
||||
|
||||
Reference in New Issue
Block a user