Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions | Variables
iscsi_iser.h File Reference
#include <linux/types.h>
#include <linux/net.h>
#include <scsi/libiscsi.h>
#include <scsi/scsi_transport_iscsi.h>
#include <linux/interrupt.h>
#include <linux/wait.h>
#include <linux/sched.h>
#include <linux/list.h>
#include <linux/slab.h>
#include <linux/dma-mapping.h>
#include <linux/mutex.h>
#include <linux/mempool.h>
#include <linux/uio.h>
#include <linux/socket.h>
#include <linux/in.h>
#include <linux/in6.h>
#include <rdma/ib_verbs.h>
#include <rdma/ib_fmr_pool.h>
#include <rdma/rdma_cm.h>

Go to the source code of this file.

Data Structures

struct  iser_hdr
 
struct  iser_data_buf
 
struct  iser_mem_reg
 
struct  iser_regd_buf
 
struct  iser_tx_desc
 
struct  iser_rx_desc
 
struct  iser_device
 
struct  iser_conn
 
struct  iscsi_iser_conn
 
struct  iscsi_iser_task
 
struct  iser_page_vec
 
struct  iser_cq_desc
 
struct  iser_global
 

Macros

#define DRV_NAME   "iser"
 
#define PFX   DRV_NAME ": "
 
#define DRV_VER   "0.1"
 
#define DRV_DATE   "May 7th, 2006"
 
#define iser_dbg(fmt, arg...)
 
#define iser_warn(fmt, arg...)
 
#define iser_err(fmt, arg...)
 
#define SHIFT_4K   12
 
#define SIZE_4K   (1ULL << SHIFT_4K)
 
#define MASK_4K   (~(SIZE_4K-1))
 
#define ISCSI_ISER_SG_TABLESIZE   (0x80000 >> SHIFT_4K)
 
#define ISER_DEF_CMD_PER_LUN   128
 
#define ISER_MAX_RX_MISC_PDUS   4 /* NOOP_IN(2) , ASYNC_EVENT(2) */
 
#define ISER_MAX_TX_MISC_PDUS
 
#define ISER_QP_MAX_RECV_DTOS   (ISCSI_DEF_XMIT_CMDS_MAX)
 
#define ISER_MIN_POSTED_RX   (ISCSI_DEF_XMIT_CMDS_MAX >> 2)
 
#define ISER_INFLIGHT_DATAOUTS   8
 
#define ISER_QP_MAX_REQ_DTOS
 
#define ISER_VER   0x10
 
#define ISER_WSV   0x08
 
#define ISER_RSV   0x04
 
#define ISER_HEADERS_LEN   (sizeof(struct iser_hdr) + sizeof(struct iscsi_hdr))
 
#define ISER_RECV_DATA_SEG_LEN   128
 
#define ISER_RX_PAYLOAD_SIZE   (ISER_HEADERS_LEN + ISER_RECV_DATA_SEG_LEN)
 
#define ISER_RX_LOGIN_SIZE   (ISER_HEADERS_LEN + ISCSI_DEF_MAX_RECV_SEG_LEN)
 
#define ISER_OBJECT_NAME_SIZE   64
 
#define ISER_RX_PAD_SIZE
 
#define ISER_MAX_CQ   4
 

Enumerations

enum  iser_ib_conn_state {
  ISER_CONN_INIT, ISER_CONN_PENDING, ISER_CONN_UP, ISER_CONN_TERMINATING,
  ISER_CONN_DOWN, ISER_CONN_STATES_NUM
}
 
enum  iser_task_status { ISER_TASK_STATUS_INIT = 0, ISER_TASK_STATUS_STARTED, ISER_TASK_STATUS_COMPLETED }
 
enum  iser_data_dir { ISER_DIR_IN = 0, ISER_DIR_OUT, ISER_DIRS_NUM }
 
enum  iser_desc_type { ISCSI_TX_CONTROL, ISCSI_TX_SCSI_COMMAND, ISCSI_TX_DATAOUT }
 

Functions

struct iser_hdr __attribute__ ((packed))
 
int iser_conn_set_full_featured_mode (struct iscsi_conn *conn)
 
int iser_send_control (struct iscsi_conn *conn, struct iscsi_task *task)
 
int iser_send_command (struct iscsi_conn *conn, struct iscsi_task *task)
 
int iser_send_data_out (struct iscsi_conn *conn, struct iscsi_task *task, struct iscsi_data *hdr)
 
void iscsi_iser_recv (struct iscsi_conn *conn, struct iscsi_hdr *hdr, char *rx_data, int rx_data_len)
 
void iser_conn_init (struct iser_conn *ib_conn)
 
void iser_conn_get (struct iser_conn *ib_conn)
 
int iser_conn_put (struct iser_conn *ib_conn, int destroy_cma_id_allowed)
 
void iser_conn_terminate (struct iser_conn *ib_conn)
 
void iser_rcv_completion (struct iser_rx_desc *desc, unsigned long dto_xfer_len, struct iser_conn *ib_conn)
 
void iser_snd_completion (struct iser_tx_desc *desc, struct iser_conn *ib_conn)
 
void iser_task_rdma_init (struct iscsi_iser_task *task)
 
void iser_task_rdma_finalize (struct iscsi_iser_task *task)
 
void iser_free_rx_descriptors (struct iser_conn *ib_conn)
 
void iser_finalize_rdma_unaligned_sg (struct iscsi_iser_task *task, enum iser_data_dir cmd_dir)
 
int iser_reg_rdma_mem (struct iscsi_iser_task *task, enum iser_data_dir cmd_dir)
 
int iser_connect (struct iser_conn *ib_conn, struct sockaddr_in *src_addr, struct sockaddr_in *dst_addr, int non_blocking)
 
int iser_reg_page_vec (struct iser_conn *ib_conn, struct iser_page_vec *page_vec, struct iser_mem_reg *mem_reg)
 
void iser_unreg_mem (struct iser_mem_reg *mem_reg)
 
int iser_post_recvl (struct iser_conn *ib_conn)
 
int iser_post_recvm (struct iser_conn *ib_conn, int count)
 
int iser_post_send (struct iser_conn *ib_conn, struct iser_tx_desc *tx_desc)
 
int iser_dma_map_task_data (struct iscsi_iser_task *iser_task, struct iser_data_buf *data, enum iser_data_dir iser_dir, enum dma_data_direction dma_dir)
 
void iser_dma_unmap_task_data (struct iscsi_iser_task *iser_task)
 
int iser_initialize_task_headers (struct iscsi_task *task, struct iser_tx_desc *tx_desc)
 
int iser_alloc_rx_descriptors (struct iser_conn *ib_conn)
 

Variables

u8 flags
 
u8 rsvd [3]
 
__be32 write_stag
 
__be64 write_va
 
__be32 read_stag
 
__be64 read_va
 
enum iser_ib_conn_state __attribute__
 
struct iser_hdr iser_header
 
struct iscsi_hdr iscsi_header
 
char data [ISER_RECV_DATA_SEG_LEN]
 
u64 dma_addr
 
struct ib_sge rx_sg
 
char pad [ISER_RX_PAD_SIZE]
 
struct iser_global ig
 
int iser_debug_level
 

Macro Definition Documentation

#define DRV_DATE   "May 7th, 2006"

Definition at line 69 of file iscsi_iser.h.

#define DRV_NAME   "iser"

Definition at line 66 of file iscsi_iser.h.

#define DRV_VER   "0.1"

Definition at line 68 of file iscsi_iser.h.

#define ISCSI_ISER_SG_TABLESIZE   (0x80000 >> SHIFT_4K)

Definition at line 96 of file iscsi_iser.h.

#define iser_dbg (   fmt,
  arg... 
)
Value:
do { \
if (iser_debug_level > 1) \
printk(KERN_DEBUG PFX "%s:" fmt,\
__func__ , ## arg); \
} while (0)

Definition at line 71 of file iscsi_iser.h.

#define ISER_DEF_CMD_PER_LUN   128

Definition at line 97 of file iscsi_iser.h.

#define iser_err (   fmt,
  arg... 
)
Value:
do { \
printk(KERN_ERR PFX "%s:" fmt, \
__func__ , ## arg); \
} while (0)

Definition at line 85 of file iscsi_iser.h.

#define ISER_HEADERS_LEN   (sizeof(struct iser_hdr) + sizeof(struct iscsi_hdr))

Definition at line 136 of file iscsi_iser.h.

#define ISER_INFLIGHT_DATAOUTS   8

Definition at line 115 of file iscsi_iser.h.

#define ISER_MAX_CQ   4

Definition at line 229 of file iscsi_iser.h.

#define ISER_MAX_RX_MISC_PDUS   4 /* NOOP_IN(2) , ASYNC_EVENT(2) */

Definition at line 101 of file iscsi_iser.h.

#define ISER_MAX_TX_MISC_PDUS
Value:
6 /* NOOP_OUT(2), TEXT(1), *
* SCSI_TMFUNC(2), LOGOUT(1) */

Definition at line 103 of file iscsi_iser.h.

#define ISER_MIN_POSTED_RX   (ISCSI_DEF_XMIT_CMDS_MAX >> 2)

Definition at line 107 of file iscsi_iser.h.

#define ISER_OBJECT_NAME_SIZE   64

Definition at line 143 of file iscsi_iser.h.

#define ISER_QP_MAX_RECV_DTOS   (ISCSI_DEF_XMIT_CMDS_MAX)

Definition at line 105 of file iscsi_iser.h.

#define ISER_QP_MAX_REQ_DTOS
#define ISER_RECV_DATA_SEG_LEN   128

Definition at line 138 of file iscsi_iser.h.

#define ISER_RSV   0x04

Definition at line 124 of file iscsi_iser.h.

#define ISER_RX_LOGIN_SIZE   (ISER_HEADERS_LEN + ISCSI_DEF_MAX_RECV_SEG_LEN)

Definition at line 140 of file iscsi_iser.h.

#define ISER_RX_PAD_SIZE
Value:
sizeof(u64) + sizeof(struct ib_sge)))

Definition at line 218 of file iscsi_iser.h.

#define ISER_RX_PAYLOAD_SIZE   (ISER_HEADERS_LEN + ISER_RECV_DATA_SEG_LEN)

Definition at line 139 of file iscsi_iser.h.

#define ISER_VER   0x10

Definition at line 122 of file iscsi_iser.h.

#define iser_warn (   fmt,
  arg... 
)
Value:
do { \
if (iser_debug_level > 0) \
printk(KERN_DEBUG PFX "%s:" fmt,\
__func__ , ## arg); \
} while (0)

Definition at line 78 of file iscsi_iser.h.

#define ISER_WSV   0x08

Definition at line 123 of file iscsi_iser.h.

#define MASK_4K   (~(SIZE_4K-1))

Definition at line 93 of file iscsi_iser.h.

#define PFX   DRV_NAME ": "

Definition at line 67 of file iscsi_iser.h.

#define SHIFT_4K   12

Definition at line 91 of file iscsi_iser.h.

#define SIZE_4K   (1ULL << SHIFT_4K)

Definition at line 92 of file iscsi_iser.h.

Enumeration Type Documentation

Enumerator:
ISER_DIR_IN 
ISER_DIR_OUT 
ISER_DIRS_NUM 

Definition at line 160 of file iscsi_iser.h.

Enumerator:
ISCSI_TX_CONTROL 
ISCSI_TX_SCSI_COMMAND 
ISCSI_TX_DATAOUT 

Definition at line 201 of file iscsi_iser.h.

Enumerator:
ISER_CONN_INIT 
ISER_CONN_PENDING 
ISER_CONN_UP 
ISER_CONN_TERMINATING 
ISER_CONN_DOWN 
ISER_CONN_STATES_NUM 

Definition at line 145 of file iscsi_iser.h.

Enumerator:
ISER_TASK_STATUS_INIT 
ISER_TASK_STATUS_STARTED 
ISER_TASK_STATUS_COMPLETED 

Definition at line 154 of file iscsi_iser.h.

Function Documentation

struct iser_hdr __attribute__ ( (packed)  )
read

Definition at line 171 of file esd_usb2.c.

void iscsi_iser_recv ( struct iscsi_conn conn,
struct iscsi_hdr hdr,
char rx_data,
int  rx_data_len 
)

Definition at line 96 of file iscsi_iser.c.

int iser_alloc_rx_descriptors ( struct iser_conn ib_conn)

Definition at line 173 of file iser_initiator.c.

void iser_conn_get ( struct iser_conn ib_conn)

Definition at line 421 of file iser_verbs.c.

void iser_conn_init ( struct iser_conn ib_conn)

Definition at line 589 of file iser_verbs.c.

int iser_conn_put ( struct iser_conn ib_conn,
int  destroy_cma_id_allowed 
)

Definition at line 426 of file iser_verbs.c.

int iser_conn_set_full_featured_mode ( struct iscsi_conn conn)
void iser_conn_terminate ( struct iser_conn ib_conn)

triggers start of the disconnect procedures and wait for them to be done

Definition at line 438 of file iser_verbs.c.

int iser_connect ( struct iser_conn ib_conn,
struct sockaddr_in src_addr,
struct sockaddr_in dst_addr,
int  non_blocking 
)

starts the process of connecting to the target sleeps until the connection is established or rejected

Definition at line 604 of file iser_verbs.c.

int iser_dma_map_task_data ( struct iscsi_iser_task iser_task,
struct iser_data_buf data,
enum iser_data_dir  iser_dir,
enum dma_data_direction  dma_dir 
)

Definition at line 313 of file iser_memory.c.

void iser_dma_unmap_task_data ( struct iscsi_iser_task iser_task)

Definition at line 331 of file iser_memory.c.

void iser_finalize_rdma_unaligned_sg ( struct iscsi_iser_task iser_task,
enum iser_data_dir  cmd_dir 
)

iser_finalize_rdma_unaligned_sg

Definition at line 107 of file iser_memory.c.

void iser_free_rx_descriptors ( struct iser_conn ib_conn)

Definition at line 217 of file iser_initiator.c.

int iser_initialize_task_headers ( struct iscsi_task task,
struct iser_tx_desc tx_desc 
)

Definition at line 137 of file iscsi_iser.c.

int iser_post_recvl ( struct iser_conn ib_conn)

Definition at line 731 of file iser_verbs.c.

int iser_post_recvm ( struct iser_conn ib_conn,
int  count 
)

Definition at line 755 of file iser_verbs.c.

int iser_post_send ( struct iser_conn ib_conn,
struct iser_tx_desc tx_desc 
)

iser_start_send - Initiate a Send DTO operation

returns 0 on success, -1 on failure

Definition at line 790 of file iser_verbs.c.

void iser_rcv_completion ( struct iser_rx_desc rx_desc,
unsigned long  rx_xfer_len,
struct iser_conn ib_conn 
)

iser_rcv_dto_completion - recv DTO completion

Definition at line 447 of file iser_initiator.c.

int iser_reg_page_vec ( struct iser_conn ib_conn,
struct iser_page_vec page_vec,
struct iser_mem_reg mem_reg 
)

iser_reg_page_vec - Register physical memory

returns: 0 on success, errno code on failure

Definition at line 671 of file iser_verbs.c.

int iser_reg_rdma_mem ( struct iscsi_iser_task iser_task,
enum iser_data_dir  cmd_dir 
)

iser_reg_rdma_mem - Registers memory intended for RDMA, obtaining rkey and va

returns 0 on success, errno code on failure

Definition at line 355 of file iser_memory.c.

int iser_send_command ( struct iscsi_conn conn,
struct iscsi_task task 
)

iser_send_command - send command PDU

Definition at line 261 of file iser_initiator.c.

int iser_send_control ( struct iscsi_conn conn,
struct iscsi_task task 
)

Definition at line 383 of file iser_initiator.c.

int iser_send_data_out ( struct iscsi_conn conn,
struct iscsi_task task,
struct iscsi_data hdr 
)

iser_send_data_out - send data out PDU

Definition at line 320 of file iser_initiator.c.

void iser_snd_completion ( struct iser_tx_desc desc,
struct iser_conn ib_conn 
)

Definition at line 498 of file iser_initiator.c.

void iser_task_rdma_finalize ( struct iscsi_iser_task task)

Definition at line 538 of file iser_initiator.c.

void iser_task_rdma_init ( struct iscsi_iser_task task)

Definition at line 521 of file iser_initiator.c.

void iser_unreg_mem ( struct iser_mem_reg reg)

Unregister (previosuly registered) memory.

Definition at line 718 of file iser_verbs.c.

Variable Documentation

Definition at line 230 of file iscsi_iser.h.

u64 dma_addr

Definition at line 231 of file iscsi_iser.h.

u8 flags

Definition at line 134 of file iscsi_iser.h.

Definition at line 93 of file iscsi_iser.c.

struct iscsi_hdr iscsi_header

Definition at line 229 of file iscsi_iser.h.

int iser_debug_level

Definition at line 83 of file iscsi_iser.c.

struct iser_hdr iser_header

Definition at line 228 of file iscsi_iser.h.

Definition at line 233 of file iscsi_iser.h.

__be32 read_stag

Definition at line 138 of file iscsi_iser.h.

__be64 read_va

Definition at line 139 of file iscsi_iser.h.

u8 rsvd[3]

Definition at line 135 of file iscsi_iser.h.

struct ib_sge rx_sg

Definition at line 232 of file iscsi_iser.h.

__be32 write_stag

Definition at line 136 of file iscsi_iser.h.

__be64 write_va

Definition at line 137 of file iscsi_iser.h.