linux/drivers/target/iscsi/iscsi_target_seq_pdu_list.h

87 lines
2.1 KiB
C
Raw Normal View History

iscsi-target: Add iSCSI fabric support for target v4.1 The Linux-iSCSI.org target module is a full featured in-kernel software implementation of iSCSI target mode (RFC-3720) for the current WIP mainline target v4.1 infrastructure code for the v3.1 kernel. More information can be found here: http://linux-iscsi.org/wiki/ISCSI This includes support for: * RFC-3720 defined request / response state machines and support for all defined iSCSI operation codes from Section 10.2.1.2 using libiscsi include/scsi/iscsi_proto.h PDU definitions * Target v4.1 compatible control plane using the generic layout in target_core_fabric_configfs.c and fabric dependent attributes within /sys/kernel/config/target/iscsi/ subdirectories. * Target v4.1 compatible iSCSI statistics based on RFC-4544 (iSCSI MIBS) * Support for IPv6 and IPv4 network portals in M:N mapping to TPGs * iSCSI Error Recovery Hierarchy support * Per iSCSI connection RX/TX thread pair scheduling affinity * crc32c + crc32c_intel SSEv4 instruction offload support using libcrypto * CHAP Authentication support using libcrypto * Conversion to use internal SGl allocation with iscsit_alloc_buffs() -> transport_generic_map_mem_to_cmd() (nab: Fix iscsi_proto.h struct scsi_lun usage from linux-next in commit: iscsi: Use struct scsi_lun in iscsi structs instead of u8[8]) (nab: Fix 32-bit compile warnings) Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Andy Grover <agrover@redhat.com> Acked-by: Roland Dreier <roland@kernel.org> Signed-off-by: Nicholas A. Bellinger <nab@linux-iscsi.org>
2011-07-23 06:43:04 +00:00
#ifndef ISCSI_SEQ_AND_PDU_LIST_H
#define ISCSI_SEQ_AND_PDU_LIST_H
/* struct iscsi_pdu->status */
#define DATAOUT_PDU_SENT 1
/* struct iscsi_seq->type */
#define SEQTYPE_IMMEDIATE 1
#define SEQTYPE_UNSOLICITED 2
#define SEQTYPE_NORMAL 3
/* struct iscsi_seq->status */
#define DATAOUT_SEQUENCE_GOT_R2T 1
#define DATAOUT_SEQUENCE_WITHIN_COMMAND_RECOVERY 2
#define DATAOUT_SEQUENCE_COMPLETE 3
/* iscsi_determine_counts_for_list() type */
#define PDULIST_NORMAL 1
#define PDULIST_IMMEDIATE 2
#define PDULIST_UNSOLICITED 3
#define PDULIST_IMMEDIATE_AND_UNSOLICITED 4
/* struct iscsi_pdu->type */
#define PDUTYPE_IMMEDIATE 1
#define PDUTYPE_UNSOLICITED 2
#define PDUTYPE_NORMAL 3
/* struct iscsi_pdu->status */
#define ISCSI_PDU_NOT_RECEIVED 0
#define ISCSI_PDU_RECEIVED_OK 1
#define ISCSI_PDU_CRC_FAILED 2
#define ISCSI_PDU_TIMED_OUT 3
/* struct iscsi_build_list->randomize */
#define RANDOM_DATAIN_PDU_OFFSETS 0x01
#define RANDOM_DATAIN_SEQ_OFFSETS 0x02
#define RANDOM_DATAOUT_PDU_OFFSETS 0x04
#define RANDOM_R2T_OFFSETS 0x08
/* struct iscsi_build_list->data_direction */
#define ISCSI_PDU_READ 0x01
#define ISCSI_PDU_WRITE 0x02
struct iscsi_build_list {
int data_direction;
int randomize;
int type;
int immediate_data_length;
};
struct iscsi_pdu {
int status;
int type;
u8 flags;
u32 data_sn;
u32 length;
u32 offset;
u32 pdu_send_order;
u32 seq_no;
} ____cacheline_aligned;
struct iscsi_seq {
int sent;
int status;
int type;
u32 data_sn;
u32 first_datasn;
u32 last_datasn;
u32 next_burst_len;
u32 pdu_start;
u32 pdu_count;
u32 offset;
u32 orig_offset;
u32 pdu_send_order;
u32 r2t_sn;
u32 seq_send_order;
u32 seq_no;
u32 xfer_len;
} ____cacheline_aligned;
extern int iscsit_build_pdu_and_seq_lists(struct iscsi_cmd *, u32);
iscsi-target: Add iSCSI fabric support for target v4.1 The Linux-iSCSI.org target module is a full featured in-kernel software implementation of iSCSI target mode (RFC-3720) for the current WIP mainline target v4.1 infrastructure code for the v3.1 kernel. More information can be found here: http://linux-iscsi.org/wiki/ISCSI This includes support for: * RFC-3720 defined request / response state machines and support for all defined iSCSI operation codes from Section 10.2.1.2 using libiscsi include/scsi/iscsi_proto.h PDU definitions * Target v4.1 compatible control plane using the generic layout in target_core_fabric_configfs.c and fabric dependent attributes within /sys/kernel/config/target/iscsi/ subdirectories. * Target v4.1 compatible iSCSI statistics based on RFC-4544 (iSCSI MIBS) * Support for IPv6 and IPv4 network portals in M:N mapping to TPGs * iSCSI Error Recovery Hierarchy support * Per iSCSI connection RX/TX thread pair scheduling affinity * crc32c + crc32c_intel SSEv4 instruction offload support using libcrypto * CHAP Authentication support using libcrypto * Conversion to use internal SGl allocation with iscsit_alloc_buffs() -> transport_generic_map_mem_to_cmd() (nab: Fix iscsi_proto.h struct scsi_lun usage from linux-next in commit: iscsi: Use struct scsi_lun in iscsi structs instead of u8[8]) (nab: Fix 32-bit compile warnings) Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Andy Grover <agrover@redhat.com> Acked-by: Roland Dreier <roland@kernel.org> Signed-off-by: Nicholas A. Bellinger <nab@linux-iscsi.org>
2011-07-23 06:43:04 +00:00
extern struct iscsi_pdu *iscsit_get_pdu_holder(struct iscsi_cmd *, u32, u32);
extern struct iscsi_pdu *iscsit_get_pdu_holder_for_seq(struct iscsi_cmd *, struct iscsi_seq *);
extern struct iscsi_seq *iscsit_get_seq_holder(struct iscsi_cmd *, u32, u32);
#endif /* ISCSI_SEQ_AND_PDU_LIST_H */