mirror of
https://github.com/torvalds/linux.git
synced 2024-11-01 01:31:44 +00:00
d381a8010a
This patch adds support for login negotiation multi-plexing in iscsi-target code. This involves handling the first login request PDU + payload and login response PDU + payload within __iscsi_target_login_thread() process context, and then changing struct sock->sk_data_ready() so that all subsequent exchanges are handled by workqueue process context, to allow other incoming login requests to be received in parallel by __iscsi_target_login_thread(). Upon login negotiation completion (or failure), ->sk_data_ready() is replaced with the original kernel sockets handler saved in iscsi_conn->orig_data_ready. v3 changes: - Convert iscsi_target_sk_data_ready() lock access to write[lock,unlock]_bh() - Only clear LOGIN_FLAGS_READ_ACTIVE when iscsi_target_do_login() returns zero - Add LOGIN_FLAGS_READY + LOGIN_FLAGS_CLOSED bit checks to iscsi_target_sk_data_ready() - Make INIT_DELAYED_WORK() + iscsi_target_set_sock_callbacks() setup happen earlier by moving from iscsi_target_start_negotiation() into iscsi_target_locate_portal() - Set LOGIN_FLAGS_READY bit in iscsi_target_start_negotiation() after iscsi_target_do_login() returns zero. v2 changes: - Add login_timer in iscsi_target_do_login_rx() to avoid possible endless sleep with MSG_WAITALL for traditional iscsi-target in certain network configurations. - Convert lprintk() -> pr_debug() - Remove forward declarations of iscsi_target_set_sock_callbacks(), iscsi_target_restore_sock_callbacks() and iscsi_target_sk_data_ready() - Make iscsi_target_set_sock_callbacks + iscsi_target_restore_sock_callbacks() static (Fengguang) - Make iscsi_target_do_login_rx() safe for iser-target w/o conn->sock Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
42 lines
2.4 KiB
C
42 lines
2.4 KiB
C
#ifndef ISCSI_TARGET_TPG_H
|
|
#define ISCSI_TARGET_TPG_H
|
|
|
|
extern struct iscsi_portal_group *iscsit_alloc_portal_group(struct iscsi_tiqn *, u16);
|
|
extern int iscsit_load_discovery_tpg(void);
|
|
extern void iscsit_release_discovery_tpg(void);
|
|
extern struct iscsi_portal_group *iscsit_get_tpg_from_np(struct iscsi_tiqn *,
|
|
struct iscsi_np *, struct iscsi_tpg_np **);
|
|
extern int iscsit_get_tpg(struct iscsi_portal_group *);
|
|
extern void iscsit_put_tpg(struct iscsi_portal_group *);
|
|
extern void iscsit_clear_tpg_np_login_threads(struct iscsi_portal_group *, bool);
|
|
extern void iscsit_tpg_dump_params(struct iscsi_portal_group *);
|
|
extern int iscsit_tpg_add_portal_group(struct iscsi_tiqn *, struct iscsi_portal_group *);
|
|
extern int iscsit_tpg_del_portal_group(struct iscsi_tiqn *, struct iscsi_portal_group *,
|
|
int);
|
|
extern int iscsit_tpg_enable_portal_group(struct iscsi_portal_group *);
|
|
extern int iscsit_tpg_disable_portal_group(struct iscsi_portal_group *, int);
|
|
extern struct iscsi_node_acl *iscsit_tpg_add_initiator_node_acl(
|
|
struct iscsi_portal_group *, const char *, u32);
|
|
extern void iscsit_tpg_del_initiator_node_acl(struct iscsi_portal_group *,
|
|
struct se_node_acl *);
|
|
extern struct iscsi_node_attrib *iscsit_tpg_get_node_attrib(struct iscsi_session *);
|
|
extern void iscsit_tpg_del_external_nps(struct iscsi_tpg_np *);
|
|
extern struct iscsi_tpg_np *iscsit_tpg_locate_child_np(struct iscsi_tpg_np *, int);
|
|
extern struct iscsi_tpg_np *iscsit_tpg_add_network_portal(struct iscsi_portal_group *,
|
|
struct __kernel_sockaddr_storage *, char *, struct iscsi_tpg_np *,
|
|
int);
|
|
extern int iscsit_tpg_del_network_portal(struct iscsi_portal_group *,
|
|
struct iscsi_tpg_np *);
|
|
extern int iscsit_tpg_set_initiator_node_queue_depth(struct iscsi_portal_group *,
|
|
unsigned char *, u32, int);
|
|
extern int iscsit_ta_authentication(struct iscsi_portal_group *, u32);
|
|
extern int iscsit_ta_login_timeout(struct iscsi_portal_group *, u32);
|
|
extern int iscsit_ta_netif_timeout(struct iscsi_portal_group *, u32);
|
|
extern int iscsit_ta_generate_node_acls(struct iscsi_portal_group *, u32);
|
|
extern int iscsit_ta_default_cmdsn_depth(struct iscsi_portal_group *, u32);
|
|
extern int iscsit_ta_cache_dynamic_acls(struct iscsi_portal_group *, u32);
|
|
extern int iscsit_ta_demo_mode_write_protect(struct iscsi_portal_group *, u32);
|
|
extern int iscsit_ta_prod_mode_write_protect(struct iscsi_portal_group *, u32);
|
|
|
|
#endif /* ISCSI_TARGET_TPG_H */
|