Linux Kernel
3.7.1
|
#include <linux/types.h>
#include <linux/kfifo.h>
#include <linux/delay.h>
#include <linux/log2.h>
#include <linux/slab.h>
#include <linux/module.h>
#include <asm/unaligned.h>
#include <net/tcp.h>
#include <scsi/scsi_cmnd.h>
#include <scsi/scsi_device.h>
#include <scsi/scsi_eh.h>
#include <scsi/scsi_tcq.h>
#include <scsi/scsi_host.h>
#include <scsi/scsi.h>
#include <scsi/iscsi_proto.h>
#include <scsi/scsi_transport.h>
#include <scsi/scsi_transport_iscsi.h>
#include <scsi/libiscsi.h>
Go to the source code of this file.
Macros | |
#define | ISCSI_DBG_CONN(_conn, dbg_fmt, arg...) |
#define | ISCSI_DBG_SESSION(_session, dbg_fmt, arg...) |
#define | ISCSI_DBG_EH(_session, dbg_fmt, arg...) |
#define ISCSI_DBG_CONN | ( | _conn, | |
dbg_fmt, | |||
arg... | |||
) |
Definition at line 64 of file libiscsi.c.
#define ISCSI_DBG_EH | ( | _session, | |
dbg_fmt, | |||
arg... | |||
) |
Definition at line 80 of file libiscsi.c.
#define ISCSI_DBG_SESSION | ( | _session, | |
dbg_fmt, | |||
arg... | |||
) |
Definition at line 72 of file libiscsi.c.
anonymous enum |
Definition at line 1575 of file libiscsi.c.
int __iscsi_complete_pdu | ( | struct iscsi_conn * | conn, |
struct iscsi_hdr * | hdr, | ||
char * | data, | ||
int | datalen | ||
) |
__iscsi_complete_pdu - complete pdu : iscsi conn : iscsi header : data buffer : len of data buffer
Completes pdu processing by freeing any resources allocated at queuecommand or send generic. session lock must be held and verify itt must have been called.
Definition at line 1110 of file libiscsi.c.
void __iscsi_get_task | ( | struct iscsi_task * | task | ) |
Definition at line 522 of file libiscsi.c.
void __iscsi_put_task | ( | struct iscsi_task * | task | ) |
Definition at line 528 of file libiscsi.c.
EXPORT_SYMBOL_GPL | ( | iscsi_conn_queue_work | ) |
EXPORT_SYMBOL_GPL | ( | iscsi_update_cmdsn | ) |
EXPORT_SYMBOL_GPL | ( | iscsi_prep_data_out_pdu | ) |
EXPORT_SYMBOL_GPL | ( | __iscsi_get_task | ) |
EXPORT_SYMBOL_GPL | ( | __iscsi_put_task | ) |
EXPORT_SYMBOL_GPL | ( | iscsi_put_task | ) |
EXPORT_SYMBOL_GPL | ( | iscsi_complete_scsi_task | ) |
EXPORT_SYMBOL_GPL | ( | iscsi_conn_send_pdu | ) |
EXPORT_SYMBOL_GPL | ( | iscsi_itt_to_task | ) |
EXPORT_SYMBOL_GPL | ( | __iscsi_complete_pdu | ) |
EXPORT_SYMBOL_GPL | ( | iscsi_complete_pdu | ) |
EXPORT_SYMBOL_GPL | ( | iscsi_verify_itt | ) |
EXPORT_SYMBOL_GPL | ( | iscsi_itt_to_ctask | ) |
EXPORT_SYMBOL_GPL | ( | iscsi_session_failure | ) |
EXPORT_SYMBOL_GPL | ( | iscsi_conn_failure | ) |
EXPORT_SYMBOL_GPL | ( | iscsi_requeue_task | ) |
EXPORT_SYMBOL_GPL | ( | iscsi_queuecommand | ) |
EXPORT_SYMBOL_GPL | ( | iscsi_change_queue_depth | ) |
EXPORT_SYMBOL_GPL | ( | iscsi_target_alloc | ) |
EXPORT_SYMBOL_GPL | ( | iscsi_suspend_queue | ) |
EXPORT_SYMBOL_GPL | ( | iscsi_suspend_tx | ) |
EXPORT_SYMBOL_GPL | ( | iscsi_eh_abort | ) |
EXPORT_SYMBOL_GPL | ( | iscsi_eh_device_reset | ) |
EXPORT_SYMBOL_GPL | ( | iscsi_session_recovery_timedout | ) |
EXPORT_SYMBOL_GPL | ( | iscsi_eh_session_reset | ) |
EXPORT_SYMBOL_GPL | ( | iscsi_eh_target_reset | ) |
EXPORT_SYMBOL_GPL | ( | iscsi_eh_recover_target | ) |
EXPORT_SYMBOL_GPL | ( | iscsi_pool_init | ) |
EXPORT_SYMBOL_GPL | ( | iscsi_pool_free | ) |
EXPORT_SYMBOL_GPL | ( | iscsi_host_add | ) |
EXPORT_SYMBOL_GPL | ( | iscsi_host_alloc | ) |
EXPORT_SYMBOL_GPL | ( | iscsi_host_remove | ) |
EXPORT_SYMBOL_GPL | ( | iscsi_host_free | ) |
EXPORT_SYMBOL_GPL | ( | iscsi_session_setup | ) |
EXPORT_SYMBOL_GPL | ( | iscsi_session_teardown | ) |
EXPORT_SYMBOL_GPL | ( | iscsi_conn_setup | ) |
EXPORT_SYMBOL_GPL | ( | iscsi_conn_teardown | ) |
EXPORT_SYMBOL_GPL | ( | iscsi_conn_start | ) |
EXPORT_SYMBOL_GPL | ( | iscsi_conn_stop | ) |
EXPORT_SYMBOL_GPL | ( | iscsi_conn_bind | ) |
EXPORT_SYMBOL_GPL | ( | iscsi_set_param | ) |
EXPORT_SYMBOL_GPL | ( | iscsi_session_get_param | ) |
EXPORT_SYMBOL_GPL | ( | iscsi_conn_get_addr_param | ) |
EXPORT_SYMBOL_GPL | ( | iscsi_conn_get_param | ) |
EXPORT_SYMBOL_GPL | ( | iscsi_host_get_param | ) |
EXPORT_SYMBOL_GPL | ( | iscsi_host_set_param | ) |
int iscsi_change_queue_depth | ( | struct scsi_device * | sdev, |
int | depth, | ||
int | reason | ||
) |
Definition at line 1718 of file libiscsi.c.
int iscsi_complete_pdu | ( | struct iscsi_conn * | conn, |
struct iscsi_hdr * | hdr, | ||
char * | data, | ||
int | datalen | ||
) |
Definition at line 1246 of file libiscsi.c.
void iscsi_complete_scsi_task | ( | struct iscsi_task * | task, |
uint32_t | exp_cmdsn, | ||
uint32_t | max_cmdsn | ||
) |
iscsi_complete_scsi_task - finish scsi task normally : iscsi task for scsi cmd : expected cmd sn in cpu format : max cmd sn in cpu format
This is used when drivers do not need or cannot perform lower level pdu processing.
Called with session lock
Definition at line 591 of file libiscsi.c.
int iscsi_conn_bind | ( | struct iscsi_cls_session * | cls_session, |
struct iscsi_cls_conn * | cls_conn, | ||
int | is_leading | ||
) |
Definition at line 3125 of file libiscsi.c.
void iscsi_conn_failure | ( | struct iscsi_conn * | conn, |
enum iscsi_err | err | ||
) |
Definition at line 1351 of file libiscsi.c.
int iscsi_conn_get_addr_param | ( | struct sockaddr_storage * | addr, |
enum iscsi_param | param, | ||
char * | buf | ||
) |
Definition at line 3337 of file libiscsi.c.
int iscsi_conn_get_param | ( | struct iscsi_cls_conn * | cls_conn, |
enum iscsi_param | param, | ||
char * | buf | ||
) |
Definition at line 3378 of file libiscsi.c.
|
inline |
Definition at line 88 of file libiscsi.c.
int iscsi_conn_send_pdu | ( | struct iscsi_cls_conn * | cls_conn, |
struct iscsi_hdr * | hdr, | ||
char * | data, | ||
uint32_t | data_size | ||
) |
Definition at line 788 of file libiscsi.c.
|
read |
iscsi_conn_setup - create iscsi_cls_conn and iscsi_conn : iscsi_cls_session : private driver data size : cid
Definition at line 2827 of file libiscsi.c.
int iscsi_conn_start | ( | struct iscsi_cls_conn * | cls_conn | ) |
Definition at line 2954 of file libiscsi.c.
void iscsi_conn_stop | ( | struct iscsi_cls_conn * | cls_conn, |
int | flag | ||
) |
Definition at line 3108 of file libiscsi.c.
void iscsi_conn_teardown | ( | struct iscsi_cls_conn * | cls_conn | ) |
iscsi_conn_teardown - teardown iscsi connection cls_conn: iscsi class connection
TODO: we may need to make this into a two step process like scsi-mls remove + put host
Definition at line 2896 of file libiscsi.c.
Definition at line 2085 of file libiscsi.c.
Definition at line 2225 of file libiscsi.c.
iscsi_eh_recover_target - reset target and possibly the session : scsi command
This will attempt to send a warm target reset. If that fails, we will escalate to ERL0 session recovery.
Definition at line 2468 of file libiscsi.c.
iscsi_eh_session_reset - drop session and attempt relogin : scsi command
This function will wait for a relogin, session termination from userspace, or a recovery/replacement timeout.
Definition at line 2319 of file libiscsi.c.
iscsi_eh_target_reset - reset target : scsi command
This will attempt to send a warm target reset.
Definition at line 2387 of file libiscsi.c.
iscsi_host_add - add host to system : scsi host : parent device
This should be called by partial offload and software iscsi drivers to add a host to the system.
Definition at line 2544 of file libiscsi.c.
|
read |
iscsi_host_alloc - allocate a host and driver data : scsi host template : driver host data size : bool indicating if LLD will queue IO from a work queue
This should be called by partial offload and software iscsi drivers. To access the driver specific memory use the iscsi_host_priv() macro.
Definition at line 2567 of file libiscsi.c.
Definition at line 2631 of file libiscsi.c.
int iscsi_host_get_param | ( | struct Scsi_Host * | shost, |
enum iscsi_host_param | param, | ||
char * | buf | ||
) |
Definition at line 3426 of file libiscsi.c.
iscsi_host_remove - remove host and sessions : scsi host
If there are any sessions left, this will initiate the removal and wait for the completion.
Definition at line 2610 of file libiscsi.c.
int iscsi_host_set_param | ( | struct Scsi_Host * | shost, |
enum iscsi_host_param | param, | ||
char * | buf, | ||
int | buflen | ||
) |
Definition at line 3450 of file libiscsi.c.
|
read |
iscsi_itt_to_ctask - look up ctask by itt : iscsi connection : itt
This should be used for cmd tasks.
The session lock must be held.
Definition at line 1299 of file libiscsi.c.
|
read |
iscsi_itt_to_task - look up task by itt : iscsi connection : itt
This should be used for mgmt tasks like login and nops, or if the LDD's itt space does not include the session age.
The session lock must be held.
Definition at line 1080 of file libiscsi.c.
void iscsi_pool_free | ( | struct iscsi_pool * | q | ) |
Definition at line 2526 of file libiscsi.c.
Definition at line 2486 of file libiscsi.c.
void iscsi_prep_data_out_pdu | ( | struct iscsi_task * | task, |
struct iscsi_r2t_info * | r2t, | ||
struct iscsi_data * | hdr | ||
) |
iscsi_prep_data_out_pdu - initialize Data-Out : scsi command task : R2T info : iscsi data in pdu
Notes: Initialize Data-Out within this R2T sequence and finds proper data_offset within this SCSI command.
This function is called with connection lock taken.
Definition at line 144 of file libiscsi.c.
void iscsi_put_task | ( | struct iscsi_task * | task | ) |
Definition at line 535 of file libiscsi.c.
Definition at line 1588 of file libiscsi.c.
void iscsi_requeue_task | ( | struct iscsi_task * | task | ) |
iscsi_requeue_task - requeue task to run from session workqueue : task to requeue
LLDs that need to run a task from the session workqueue should call this. The session lock must be held. This should only be called by software drivers.
Definition at line 1417 of file libiscsi.c.
void iscsi_session_failure | ( | struct iscsi_session * | session, |
enum iscsi_err | err | ||
) |
Definition at line 1321 of file libiscsi.c.
int iscsi_session_get_param | ( | struct iscsi_cls_session * | cls_session, |
enum iscsi_param | param, | ||
char * | buf | ||
) |
Definition at line 3259 of file libiscsi.c.
void iscsi_session_recovery_timedout | ( | struct iscsi_cls_session * | cls_session | ) |
Definition at line 2298 of file libiscsi.c.
|
read |
iscsi_session_setup - create iscsi cls session and host and session : iscsi transport template : scsi host : session can queue : LLD task private data size : initial CmdSN
This can be used by software iscsi_transports that allocate a session per scsi host.
Callers should set cmds_max to the largest total numer (mgmt + scsi) of tasks they support. The iscsi layer reserves ISCSI_MGMT_CMDS_MAX tasks for nop handling and login/logout requests.
Definition at line 2679 of file libiscsi.c.
void iscsi_session_teardown | ( | struct iscsi_cls_session * | cls_session | ) |
iscsi_session_teardown - destroy session, host, and cls_session : iscsi session
The driver must have called iscsi_remove_session before calling this.
Definition at line 2797 of file libiscsi.c.
int iscsi_set_param | ( | struct iscsi_cls_conn * | cls_conn, |
enum iscsi_param | param, | ||
char * | buf, | ||
int | buflen | ||
) |
Definition at line 3163 of file libiscsi.c.
void iscsi_suspend_queue | ( | struct iscsi_conn * | conn | ) |
iscsi_suspend_queue - suspend iscsi_queuecommand : iscsi conn to stop queueing IO on
This grabs the session lock to make sure no one is in xmit_task/queuecommand, and then sets suspend to prevent new commands from being queued. This only needs to be called by offload drivers that need to sync a path like ep disconnect with the iscsi_queuecommand/xmit_task. To start IO again libiscsi will call iscsi_start_tx and iscsi_unblock_session when in FFP.
Definition at line 1848 of file libiscsi.c.
void iscsi_suspend_tx | ( | struct iscsi_conn * | conn | ) |
iscsi_suspend_tx - suspend iscsi_data_xmit : iscsi conn tp stop processing IO on.
This function sets the suspend bit to prevent iscsi_data_xmit from sending new IO, and if work is queued on the xmit thread it will wait for it to be completed.
Definition at line 1864 of file libiscsi.c.
int iscsi_target_alloc | ( | struct scsi_target * | starget | ) |
Definition at line 1737 of file libiscsi.c.
void iscsi_update_cmdsn | ( | struct iscsi_session * | session, |
struct iscsi_nopin * | hdr | ||
) |
Definition at line 125 of file libiscsi.c.
int iscsi_verify_itt | ( | struct iscsi_conn * | conn, |
itt_t | itt | ||
) |
Definition at line 1258 of file libiscsi.c.
MODULE_AUTHOR | ( | "Mike Christie" | ) |
MODULE_DESCRIPTION | ( | "iSCSI library functions" | ) |
MODULE_LICENSE | ( | "GPL" | ) |
MODULE_PARM_DESC | ( | debug_libiscsi_conn | , |
"Turn on debugging for connections in libiscsi module. ""Set to 1 to turn | on, | ||
and zero to turn off.Default is off." | |||
) |
MODULE_PARM_DESC | ( | debug_libiscsi_session | , |
"Turn on debugging for sessions in libiscsi module. ""Set to 1 to turn | on, | ||
and zero to turn off.Default is off." | |||
) |