aboutsummaryrefslogtreecommitdiffstats
path: root/include/target
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2016-05-28 15:04:17 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2016-05-28 15:04:17 -0400
commit9ba55cf7cfbfd12a7e914d0d55b7581e896b3f0d (patch)
treef53dba839ff2faa2fff1878b091bbe5017951f4a /include/target
parent1cbe06c3cf542d48eb22180163e00f91760ef8cd (diff)
parent8f0dfb3d8b1120c61f6e2cc3729290db10772b2d (diff)
Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending
Pull SCSI target updates from Nicholas Bellinger: "Here are the outstanding target pending updates for v4.7-rc1. The highlights this round include: - Allow external PR/ALUA metadata path be defined at runtime via top level configfs attribute (Lee) - Fix target session shutdown bug for ib_srpt multi-channel (hch) - Make TFO close_session() and shutdown_session() optional (hch) - Drop se_sess->sess_kref + convert tcm_qla2xxx to internal kref (hch) - Add tcm_qla2xxx endpoint attribute for basic FC jammer (Laurence) - Refactor iscsi-target RX/TX PDU encode/decode into common code (Varun) - Extend iscsit_transport with xmit_pdu, release_cmd, get_rx_pdu, validate_parameters, and get_r2t_ttt for generic ISO offload (Varun) - Initial merge of cxgb iscsi-segment offload target driver (Varun) The bulk of the changes are Chelsio's new driver, along with a number of iscsi-target common code improvements made by Varun + Co along the way" * 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending: (29 commits) iscsi-target: Fix early sk_data_ready LOGIN_FLAGS_READY race cxgbit: Use type ISCSI_CXGBIT + cxgbit tpg_np attribute iscsi-target: Convert transport drivers to signal rdma_shutdown iscsi-target: Make iscsi_tpg_np driver show/store use generic code tcm_qla2xxx Add SCSI command jammer/discard capability iscsi-target: graceful disconnect on invalid mapping to iovec target: need_to_release is always false, remove redundant check and kfree target: remove sess_kref and ->shutdown_session iscsi-target: remove usage of ->shutdown_session tcm_qla2xxx: introduce a private sess_kref target: make close_session optional target: make ->shutdown_session optional target: remove acl_stop target: consolidate and fix session shutdown cxgbit: add files for cxgbit.ko iscsi-target: export symbols iscsi-target: call complete on conn_logout_comp iscsi-target: clear tx_thread_active iscsi-target: add new offload transport type iscsi-target: use conn_transport->transport_type in text rsp ...
Diffstat (limited to 'include/target')
-rw-r--r--include/target/iscsi/iscsi_target_core.h27
-rw-r--r--include/target/iscsi/iscsi_transport.h41
-rw-r--r--include/target/target_core_base.h2
-rw-r--r--include/target/target_core_fabric.h6
4 files changed, 68 insertions, 8 deletions
diff --git a/include/target/iscsi/iscsi_target_core.h b/include/target/iscsi/iscsi_target_core.h
index c3371fa548cb..4ac24f5a3308 100644
--- a/include/target/iscsi/iscsi_target_core.h
+++ b/include/target/iscsi/iscsi_target_core.h
@@ -74,6 +74,7 @@ enum iscsit_transport_type {
74 ISCSI_IWARP_TCP = 3, 74 ISCSI_IWARP_TCP = 3,
75 ISCSI_IWARP_SCTP = 4, 75 ISCSI_IWARP_SCTP = 4,
76 ISCSI_INFINIBAND = 5, 76 ISCSI_INFINIBAND = 5,
77 ISCSI_CXGBIT = 6,
77}; 78};
78 79
79/* RFC-3720 7.1.4 Standard Connection State Diagram for a Target */ 80/* RFC-3720 7.1.4 Standard Connection State Diagram for a Target */
@@ -890,4 +891,30 @@ static inline u32 session_get_next_ttt(struct iscsi_session *session)
890} 891}
891 892
892extern struct iscsi_cmd *iscsit_find_cmd_from_itt(struct iscsi_conn *, itt_t); 893extern struct iscsi_cmd *iscsit_find_cmd_from_itt(struct iscsi_conn *, itt_t);
894
895static inline void iscsit_thread_check_cpumask(
896 struct iscsi_conn *conn,
897 struct task_struct *p,
898 int mode)
899{
900 /*
901 * mode == 1 signals iscsi_target_tx_thread() usage.
902 * mode == 0 signals iscsi_target_rx_thread() usage.
903 */
904 if (mode == 1) {
905 if (!conn->conn_tx_reset_cpumask)
906 return;
907 conn->conn_tx_reset_cpumask = 0;
908 } else {
909 if (!conn->conn_rx_reset_cpumask)
910 return;
911 conn->conn_rx_reset_cpumask = 0;
912 }
913 /*
914 * Update the CPU mask for this single kthread so that
915 * both TX and RX kthreads are scheduled to run on the
916 * same CPU.
917 */
918 set_cpus_allowed_ptr(p, conn->conn_cpumask);
919}
893#endif /* ISCSI_TARGET_CORE_H */ 920#endif /* ISCSI_TARGET_CORE_H */
diff --git a/include/target/iscsi/iscsi_transport.h b/include/target/iscsi/iscsi_transport.h
index 90e37faa2ede..40ac7cd80150 100644
--- a/include/target/iscsi/iscsi_transport.h
+++ b/include/target/iscsi/iscsi_transport.h
@@ -6,6 +6,7 @@ struct iscsit_transport {
6#define ISCSIT_TRANSPORT_NAME 16 6#define ISCSIT_TRANSPORT_NAME 16
7 char name[ISCSIT_TRANSPORT_NAME]; 7 char name[ISCSIT_TRANSPORT_NAME];
8 int transport_type; 8 int transport_type;
9 bool rdma_shutdown;
9 int priv_size; 10 int priv_size;
10 struct module *owner; 11 struct module *owner;
11 struct list_head t_node; 12 struct list_head t_node;
@@ -22,6 +23,13 @@ struct iscsit_transport {
22 int (*iscsit_queue_data_in)(struct iscsi_conn *, struct iscsi_cmd *); 23 int (*iscsit_queue_data_in)(struct iscsi_conn *, struct iscsi_cmd *);
23 int (*iscsit_queue_status)(struct iscsi_conn *, struct iscsi_cmd *); 24 int (*iscsit_queue_status)(struct iscsi_conn *, struct iscsi_cmd *);
24 void (*iscsit_aborted_task)(struct iscsi_conn *, struct iscsi_cmd *); 25 void (*iscsit_aborted_task)(struct iscsi_conn *, struct iscsi_cmd *);
26 int (*iscsit_xmit_pdu)(struct iscsi_conn *, struct iscsi_cmd *,
27 struct iscsi_datain_req *, const void *, u32);
28 void (*iscsit_release_cmd)(struct iscsi_conn *, struct iscsi_cmd *);
29 void (*iscsit_get_rx_pdu)(struct iscsi_conn *);
30 int (*iscsit_validate_params)(struct iscsi_conn *);
31 void (*iscsit_get_r2t_ttt)(struct iscsi_conn *, struct iscsi_cmd *,
32 struct iscsi_r2t *);
25 enum target_prot_op (*iscsit_get_sup_prot_ops)(struct iscsi_conn *); 33 enum target_prot_op (*iscsit_get_sup_prot_ops)(struct iscsi_conn *);
26}; 34};
27 35
@@ -77,6 +85,18 @@ extern void iscsit_build_reject(struct iscsi_cmd *, struct iscsi_conn *,
77extern int iscsit_build_logout_rsp(struct iscsi_cmd *, struct iscsi_conn *, 85extern int iscsit_build_logout_rsp(struct iscsi_cmd *, struct iscsi_conn *,
78 struct iscsi_logout_rsp *); 86 struct iscsi_logout_rsp *);
79extern int iscsit_logout_post_handler(struct iscsi_cmd *, struct iscsi_conn *); 87extern int iscsit_logout_post_handler(struct iscsi_cmd *, struct iscsi_conn *);
88extern int iscsit_queue_rsp(struct iscsi_conn *, struct iscsi_cmd *);
89extern void iscsit_aborted_task(struct iscsi_conn *, struct iscsi_cmd *);
90extern int iscsit_add_reject(struct iscsi_conn *, u8, unsigned char *);
91extern int iscsit_reject_cmd(struct iscsi_cmd *, u8, unsigned char *);
92extern int iscsit_handle_snack(struct iscsi_conn *, unsigned char *);
93extern void iscsit_build_datain_pdu(struct iscsi_cmd *, struct iscsi_conn *,
94 struct iscsi_datain *,
95 struct iscsi_data_rsp *, bool);
96extern int iscsit_build_r2ts_for_cmd(struct iscsi_conn *, struct iscsi_cmd *,
97 bool);
98extern int iscsit_immediate_queue(struct iscsi_conn *, struct iscsi_cmd *, int);
99extern int iscsit_response_queue(struct iscsi_conn *, struct iscsi_cmd *, int);
80/* 100/*
81 * From iscsi_target_device.c 101 * From iscsi_target_device.c
82 */ 102 */
@@ -102,3 +122,24 @@ extern struct iscsi_cmd *iscsit_allocate_cmd(struct iscsi_conn *, int);
102extern int iscsit_sequence_cmd(struct iscsi_conn *, struct iscsi_cmd *, 122extern int iscsit_sequence_cmd(struct iscsi_conn *, struct iscsi_cmd *,
103 unsigned char *, __be32); 123 unsigned char *, __be32);
104extern void iscsit_release_cmd(struct iscsi_cmd *); 124extern void iscsit_release_cmd(struct iscsi_cmd *);
125extern void iscsit_free_cmd(struct iscsi_cmd *, bool);
126extern void iscsit_add_cmd_to_immediate_queue(struct iscsi_cmd *,
127 struct iscsi_conn *, u8);
128
129/*
130 * From iscsi_target_nego.c
131 */
132extern int iscsi_target_check_login_request(struct iscsi_conn *,
133 struct iscsi_login *);
134
135/*
136 * From iscsi_target_login.c
137 */
138extern __printf(2, 3) int iscsi_change_param_sprintf(
139 struct iscsi_conn *, const char *, ...);
140
141/*
142 * From iscsi_target_parameters.c
143 */
144extern struct iscsi_param *iscsi_find_param_from_key(
145 char *, struct iscsi_param_list *);
diff --git a/include/target/target_core_base.h b/include/target/target_core_base.h
index 3e0dd86360a2..b316b44d03f3 100644
--- a/include/target/target_core_base.h
+++ b/include/target/target_core_base.h
@@ -536,7 +536,6 @@ struct se_node_acl {
536 char initiatorname[TRANSPORT_IQN_LEN]; 536 char initiatorname[TRANSPORT_IQN_LEN];
537 /* Used to signal demo mode created ACL, disabled by default */ 537 /* Used to signal demo mode created ACL, disabled by default */
538 bool dynamic_node_acl; 538 bool dynamic_node_acl;
539 bool acl_stop:1;
540 u32 queue_depth; 539 u32 queue_depth;
541 u32 acl_index; 540 u32 acl_index;
542 enum target_prot_type saved_prot_type; 541 enum target_prot_type saved_prot_type;
@@ -603,7 +602,6 @@ struct se_session {
603 struct list_head sess_cmd_list; 602 struct list_head sess_cmd_list;
604 struct list_head sess_wait_list; 603 struct list_head sess_wait_list;
605 spinlock_t sess_cmd_lock; 604 spinlock_t sess_cmd_lock;
606 struct kref sess_kref;
607 void *sess_cmd_map; 605 void *sess_cmd_map;
608 struct percpu_ida sess_tag_pool; 606 struct percpu_ida sess_tag_pool;
609}; 607};
diff --git a/include/target/target_core_fabric.h b/include/target/target_core_fabric.h
index 78d88f03b296..de44462a7680 100644
--- a/include/target/target_core_fabric.h
+++ b/include/target/target_core_fabric.h
@@ -50,10 +50,6 @@ struct target_core_fabric_ops {
50 */ 50 */
51 int (*check_stop_free)(struct se_cmd *); 51 int (*check_stop_free)(struct se_cmd *);
52 void (*release_cmd)(struct se_cmd *); 52 void (*release_cmd)(struct se_cmd *);
53 /*
54 * Called with spin_lock_bh(struct se_portal_group->session_lock held.
55 */
56 int (*shutdown_session)(struct se_session *);
57 void (*close_session)(struct se_session *); 53 void (*close_session)(struct se_session *);
58 u32 (*sess_get_index)(struct se_session *); 54 u32 (*sess_get_index)(struct se_session *);
59 /* 55 /*
@@ -123,8 +119,6 @@ void __transport_register_session(struct se_portal_group *,
123 struct se_node_acl *, struct se_session *, void *); 119 struct se_node_acl *, struct se_session *, void *);
124void transport_register_session(struct se_portal_group *, 120void transport_register_session(struct se_portal_group *,
125 struct se_node_acl *, struct se_session *, void *); 121 struct se_node_acl *, struct se_session *, void *);
126int target_get_session(struct se_session *);
127void target_put_session(struct se_session *);
128ssize_t target_show_dynamic_sessions(struct se_portal_group *, char *); 122ssize_t target_show_dynamic_sessions(struct se_portal_group *, char *);
129void transport_free_session(struct se_session *); 123void transport_free_session(struct se_session *);
130void target_put_nacl(struct se_node_acl *); 124void target_put_nacl(struct se_node_acl *);