aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2015-04-24 13:22:09 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2015-04-24 13:22:09 -0400
commitc6668726d2c2c581e6c417448c472c994d026f5f (patch)
treeccbc5a73b9dfe09a065cb5d8627aa2297e730ec0 /include
parent06b45f2aa703837163496f5db6a53575665cc6b4 (diff)
parent68d4cef3bab3fb9bb0dbac690ba35a96cb5a16d9 (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: "Lots of activity in target land the last months. The highlights include: - Convert fabric drivers tree-wide to target_register_template() (hch + bart) - iser-target hardening fixes + v1.0 improvements (sagi) - Convert iscsi_thread_set usage to kthread.h + kill iscsi_target_tq.c (sagi + nab) - Add support for T10-PI WRITE_STRIP + READ_INSERT operation (mkp + sagi + nab) - DIF fixes for CONFIG_DEBUG_SG=y + UNMAP file emulation (akinobu + sagi + mkp) - Extended TCMU ABI v2 for future BIDI + DIF support (andy + ilias) - Fix COMPARE_AND_WRITE handling for NO_ALLLOC drivers (hch + nab) Thanks to everyone who contributed this round with new features, bug-reports, fixes, cleanups and improvements. Looking forward, it's currently shaping up to be a busy v4.2 as well" * 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending: (69 commits) target: Put TCMU under a new config option target: Version 2 of TCMU ABI target: fix tcm_mod_builder.py target/file: Fix UNMAP with DIF protection support target/file: Fix SG table for prot_buf initialization target/file: Fix BUG() when CONFIG_DEBUG_SG=y and DIF protection enabled target: Make core_tmr_abort_task() skip TMFs target/sbc: Update sbc_dif_generate pr_debug output target/sbc: Make internal DIF emulation honor ->prot_checks target/sbc: Return INVALID_CDB_FIELD if DIF + sess_prot_type disabled target: Ensure sess_prot_type is saved across session restart target/rd: Don't pass incomplete scatterlist entries to sbc_dif_verify_* target: Remove the unused flag SCF_ACK_KREF target: Fix two sparse warnings target: Fix COMPARE_AND_WRITE with SG_TO_MEM_NOALLOC handling target: simplify the target template registration API target: simplify target_xcopy_init_pt_lun target: remove the unused SCF_CMD_XCOPY_PASSTHROUGH flag target/rd: reduce code duplication in rd_execute_rw() tcm_loop: fixup tpgt string to integer conversion ...
Diffstat (limited to 'include')
-rw-r--r--include/target/iscsi/iscsi_target_core.h15
-rw-r--r--include/target/target_core_base.h10
-rw-r--r--include/target/target_core_configfs.h6
-rw-r--r--include/target/target_core_fabric.h33
-rw-r--r--include/target/target_core_fabric_configfs.h5
-rw-r--r--include/uapi/linux/target_core_user.h44
6 files changed, 78 insertions, 35 deletions
diff --git a/include/target/iscsi/iscsi_target_core.h b/include/target/iscsi/iscsi_target_core.h
index d3583d3ee193..54e7af301888 100644
--- a/include/target/iscsi/iscsi_target_core.h
+++ b/include/target/iscsi/iscsi_target_core.h
@@ -20,6 +20,8 @@
20#define ISCSIT_MIN_TAGS 16 20#define ISCSIT_MIN_TAGS 16
21#define ISCSIT_EXTRA_TAGS 8 21#define ISCSIT_EXTRA_TAGS 8
22#define ISCSIT_TCP_BACKLOG 256 22#define ISCSIT_TCP_BACKLOG 256
23#define ISCSI_RX_THREAD_NAME "iscsi_trx"
24#define ISCSI_TX_THREAD_NAME "iscsi_ttx"
23 25
24/* struct iscsi_node_attrib sanity values */ 26/* struct iscsi_node_attrib sanity values */
25#define NA_DATAOUT_TIMEOUT 3 27#define NA_DATAOUT_TIMEOUT 3
@@ -60,6 +62,7 @@
60#define TA_CACHE_CORE_NPS 0 62#define TA_CACHE_CORE_NPS 0
61/* T10 protection information disabled by default */ 63/* T10 protection information disabled by default */
62#define TA_DEFAULT_T10_PI 0 64#define TA_DEFAULT_T10_PI 0
65#define TA_DEFAULT_FABRIC_PROT_TYPE 0
63 66
64#define ISCSI_IOV_DATA_BUFFER 5 67#define ISCSI_IOV_DATA_BUFFER 5
65 68
@@ -600,8 +603,11 @@ struct iscsi_conn {
600 struct iscsi_tpg_np *tpg_np; 603 struct iscsi_tpg_np *tpg_np;
601 /* Pointer to parent session */ 604 /* Pointer to parent session */
602 struct iscsi_session *sess; 605 struct iscsi_session *sess;
603 /* Pointer to thread_set in use for this conn's threads */ 606 int bitmap_id;
604 struct iscsi_thread_set *thread_set; 607 int rx_thread_active;
608 struct task_struct *rx_thread;
609 int tx_thread_active;
610 struct task_struct *tx_thread;
605 /* list_head for session connection list */ 611 /* list_head for session connection list */
606 struct list_head conn_list; 612 struct list_head conn_list;
607} ____cacheline_aligned; 613} ____cacheline_aligned;
@@ -767,6 +773,7 @@ struct iscsi_tpg_attrib {
767 u32 demo_mode_discovery; 773 u32 demo_mode_discovery;
768 u32 default_erl; 774 u32 default_erl;
769 u8 t10_pi; 775 u8 t10_pi;
776 u32 fabric_prot_type;
770 struct iscsi_portal_group *tpg; 777 struct iscsi_portal_group *tpg;
771}; 778};
772 779
@@ -871,10 +878,10 @@ struct iscsit_global {
871 /* Unique identifier used for the authentication daemon */ 878 /* Unique identifier used for the authentication daemon */
872 u32 auth_id; 879 u32 auth_id;
873 u32 inactive_ts; 880 u32 inactive_ts;
874 /* Thread Set bitmap count */ 881#define ISCSIT_BITMAP_BITS 262144
875 int ts_bitmap_count;
876 /* Thread Set bitmap pointer */ 882 /* Thread Set bitmap pointer */
877 unsigned long *ts_bitmap; 883 unsigned long *ts_bitmap;
884 spinlock_t ts_bitmap_lock;
878 /* Used for iSCSI discovery session authentication */ 885 /* Used for iSCSI discovery session authentication */
879 struct iscsi_node_acl discovery_acl; 886 struct iscsi_node_acl discovery_acl;
880 struct iscsi_portal_group *discovery_tpg; 887 struct iscsi_portal_group *discovery_tpg;
diff --git a/include/target/target_core_base.h b/include/target/target_core_base.h
index 672150b6aaf5..480e9f82dfea 100644
--- a/include/target/target_core_base.h
+++ b/include/target/target_core_base.h
@@ -165,10 +165,8 @@ enum se_cmd_flags_table {
165 SCF_SEND_DELAYED_TAS = 0x00004000, 165 SCF_SEND_DELAYED_TAS = 0x00004000,
166 SCF_ALUA_NON_OPTIMIZED = 0x00008000, 166 SCF_ALUA_NON_OPTIMIZED = 0x00008000,
167 SCF_PASSTHROUGH_SG_TO_MEM_NOALLOC = 0x00020000, 167 SCF_PASSTHROUGH_SG_TO_MEM_NOALLOC = 0x00020000,
168 SCF_ACK_KREF = 0x00040000,
169 SCF_COMPARE_AND_WRITE = 0x00080000, 168 SCF_COMPARE_AND_WRITE = 0x00080000,
170 SCF_COMPARE_AND_WRITE_POST = 0x00100000, 169 SCF_COMPARE_AND_WRITE_POST = 0x00100000,
171 SCF_CMD_XCOPY_PASSTHROUGH = 0x00200000,
172}; 170};
173 171
174/* struct se_dev_entry->lun_flags and struct se_lun->lun_access */ 172/* struct se_dev_entry->lun_flags and struct se_lun->lun_access */
@@ -520,11 +518,11 @@ struct se_cmd {
520 struct list_head se_cmd_list; 518 struct list_head se_cmd_list;
521 struct completion cmd_wait_comp; 519 struct completion cmd_wait_comp;
522 struct kref cmd_kref; 520 struct kref cmd_kref;
523 struct target_core_fabric_ops *se_tfo; 521 const struct target_core_fabric_ops *se_tfo;
524 sense_reason_t (*execute_cmd)(struct se_cmd *); 522 sense_reason_t (*execute_cmd)(struct se_cmd *);
525 sense_reason_t (*execute_rw)(struct se_cmd *, struct scatterlist *, 523 sense_reason_t (*execute_rw)(struct se_cmd *, struct scatterlist *,
526 u32, enum dma_data_direction); 524 u32, enum dma_data_direction);
527 sense_reason_t (*transport_complete_callback)(struct se_cmd *); 525 sense_reason_t (*transport_complete_callback)(struct se_cmd *, bool);
528 526
529 unsigned char *t_task_cdb; 527 unsigned char *t_task_cdb;
530 unsigned char __t_task_cdb[TCM_MAX_COMMAND_SIZE]; 528 unsigned char __t_task_cdb[TCM_MAX_COMMAND_SIZE];
@@ -591,6 +589,7 @@ struct se_node_acl {
591 bool acl_stop:1; 589 bool acl_stop:1;
592 u32 queue_depth; 590 u32 queue_depth;
593 u32 acl_index; 591 u32 acl_index;
592 enum target_prot_type saved_prot_type;
594#define MAX_ACL_TAG_SIZE 64 593#define MAX_ACL_TAG_SIZE 64
595 char acl_tag[MAX_ACL_TAG_SIZE]; 594 char acl_tag[MAX_ACL_TAG_SIZE];
596 /* Used for PR SPEC_I_PT=1 and REGISTER_AND_MOVE */ 595 /* Used for PR SPEC_I_PT=1 and REGISTER_AND_MOVE */
@@ -616,6 +615,7 @@ struct se_session {
616 unsigned sess_tearing_down:1; 615 unsigned sess_tearing_down:1;
617 u64 sess_bin_isid; 616 u64 sess_bin_isid;
618 enum target_prot_op sup_prot_ops; 617 enum target_prot_op sup_prot_ops;
618 enum target_prot_type sess_prot_type;
619 struct se_node_acl *se_node_acl; 619 struct se_node_acl *se_node_acl;
620 struct se_portal_group *se_tpg; 620 struct se_portal_group *se_tpg;
621 void *fabric_sess_ptr; 621 void *fabric_sess_ptr;
@@ -890,7 +890,7 @@ struct se_portal_group {
890 /* List of TCM sessions associated wth this TPG */ 890 /* List of TCM sessions associated wth this TPG */
891 struct list_head tpg_sess_list; 891 struct list_head tpg_sess_list;
892 /* Pointer to $FABRIC_MOD dependent code */ 892 /* Pointer to $FABRIC_MOD dependent code */
893 struct target_core_fabric_ops *se_tpg_tfo; 893 const struct target_core_fabric_ops *se_tpg_tfo;
894 struct se_wwn *se_tpg_wwn; 894 struct se_wwn *se_tpg_wwn;
895 struct config_group tpg_group; 895 struct config_group tpg_group;
896 struct config_group *tpg_default_groups[7]; 896 struct config_group *tpg_default_groups[7];
diff --git a/include/target/target_core_configfs.h b/include/target/target_core_configfs.h
index e0801386e4dc..25bb04c4209e 100644
--- a/include/target/target_core_configfs.h
+++ b/include/target/target_core_configfs.h
@@ -5,12 +5,6 @@
5#define TARGET_CORE_NAME_MAX_LEN 64 5#define TARGET_CORE_NAME_MAX_LEN 64
6#define TARGET_FABRIC_NAME_SIZE 32 6#define TARGET_FABRIC_NAME_SIZE 32
7 7
8extern struct target_fabric_configfs *target_fabric_configfs_init(
9 struct module *, const char *);
10extern void target_fabric_configfs_free(struct target_fabric_configfs *);
11extern int target_fabric_configfs_register(struct target_fabric_configfs *);
12extern void target_fabric_configfs_deregister(struct target_fabric_configfs *);
13
14struct target_fabric_configfs_template { 8struct target_fabric_configfs_template {
15 struct config_item_type tfc_discovery_cit; 9 struct config_item_type tfc_discovery_cit;
16 struct config_item_type tfc_wwn_cit; 10 struct config_item_type tfc_wwn_cit;
diff --git a/include/target/target_core_fabric.h b/include/target/target_core_fabric.h
index 22a4e98eec80..17c7f5ac7ea0 100644
--- a/include/target/target_core_fabric.h
+++ b/include/target/target_core_fabric.h
@@ -2,6 +2,8 @@
2#define TARGET_CORE_FABRIC_H 2#define TARGET_CORE_FABRIC_H
3 3
4struct target_core_fabric_ops { 4struct target_core_fabric_ops {
5 struct module *module;
6 const char *name;
5 struct configfs_subsystem *tf_subsys; 7 struct configfs_subsystem *tf_subsys;
6 char *(*get_fabric_name)(void);