diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-04-12 19:51:08 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-04-12 19:51:08 -0400 |
commit | 141eaccd018ef0476e94b180026d973db35460fd (patch) | |
tree | a1c8f5215bd4e5545dee6c56e8bb9b454c818b33 /include | |
parent | 93094449060ae00213ba30ad9eaa485b448fe94b (diff) | |
parent | b076808051f2c80d38e03fb2f1294f525c7a446d (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 target pending updates for v3.15-rc1. Apologies in
advance for waiting until the second to last day of the merge window
to send these out.
The highlights this round include:
- iser-target support for T10 PI (DIF) offloads (Sagi + Or)
- Fix Task Aborted Status (TAS) handling in target-core (Alex Leung)
- Pass in transport supported PI at session initialization (Sagi + MKP + nab)
- Add WRITE_INSERT + READ_STRIP T10 PI support in target-core (nab + Sagi)
- Fix iscsi-target ERL=2 ASYNC_EVENT connection pointer bug (nab)
- Fix tcm_fc use-after-free of ft_tpg (Andy Grover)
- Use correct ib_sg_dma primitives in ib_isert (Mike Marciniszyn)
Also, note the virtio-scsi + vhost-scsi changes to expose T10 PI
metadata into KVM guest have been left-out for now, as there where a
few comments from MST + Paolo that where not able to be addressed in
time for v3.15. Please expect this feature for v3.16-rc1"
* 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending: (43 commits)
ib_srpt: Use correct ib_sg_dma primitives
target/tcm_fc: Rename ft_tport_create to ft_tport_get
target/tcm_fc: Rename ft_{add,del}_lport to {add,del}_wwn
target/tcm_fc: Rename structs and list members for clarity
target/tcm_fc: Limit to 1 TPG per wwn
target/tcm_fc: Don't export ft_lport_list
target/tcm_fc: Fix use-after-free of ft_tpg
target: Add check to prevent Abort Task from aborting itself
target: Enable READ_STRIP emulation in target_complete_ok_work
target/sbc: Add sbc_dif_read_strip software emulation
target: Enable WRITE_INSERT emulation in target_execute_cmd
target/sbc: Add sbc_dif_generate software emulation
target/sbc: Only expose PI read_cap16 bits when supported by fabric
target/spc: Only expose PI mode page bits when supported by fabric
target/spc: Only expose PI inquiry bits when supported by fabric
target: Pass in transport supported PI at session initialization
target/iblock: Fix double bioset_integrity_free bug
Target/sbc: Initialize COMPARE_AND_WRITE write_sg scatterlist
target/rd: T10-Dif: RAM disk is allocating more space than required.
iscsi-target: Fix ERL=2 ASYNC_EVENT connection pointer bug
...
Diffstat (limited to 'include')
-rw-r--r-- | include/target/iscsi/iscsi_transport.h | 2 | ||||
-rw-r--r-- | include/target/target_core_backend.h | 2 | ||||
-rw-r--r-- | include/target/target_core_base.h | 33 | ||||
-rw-r--r-- | include/target/target_core_fabric.h | 6 |
4 files changed, 28 insertions, 15 deletions
diff --git a/include/target/iscsi/iscsi_transport.h b/include/target/iscsi/iscsi_transport.h index 4483fadfa68d..33b487b5da92 100644 --- a/include/target/iscsi/iscsi_transport.h +++ b/include/target/iscsi/iscsi_transport.h | |||
@@ -21,6 +21,8 @@ struct iscsit_transport { | |||
21 | int (*iscsit_get_dataout)(struct iscsi_conn *, struct iscsi_cmd *, bool); | 21 | int (*iscsit_get_dataout)(struct iscsi_conn *, struct iscsi_cmd *, bool); |
22 | int (*iscsit_queue_data_in)(struct iscsi_conn *, struct iscsi_cmd *); | 22 | int (*iscsit_queue_data_in)(struct iscsi_conn *, struct iscsi_cmd *); |
23 | int (*iscsit_queue_status)(struct iscsi_conn *, struct iscsi_cmd *); | 23 | int (*iscsit_queue_status)(struct iscsi_conn *, struct iscsi_cmd *); |
24 | void (*iscsit_aborted_task)(struct iscsi_conn *, struct iscsi_cmd *); | ||
25 | enum target_prot_op (*iscsit_get_sup_prot_ops)(struct iscsi_conn *); | ||
24 | }; | 26 | }; |
25 | 27 | ||
26 | static inline void *iscsit_priv_cmd(struct iscsi_cmd *cmd) | 28 | static inline void *iscsit_priv_cmd(struct iscsi_cmd *cmd) |
diff --git a/include/target/target_core_backend.h b/include/target/target_core_backend.h index 7020e33e742e..3a1c1eea1fff 100644 --- a/include/target/target_core_backend.h +++ b/include/target/target_core_backend.h | |||
@@ -73,10 +73,12 @@ sense_reason_t sbc_execute_unmap(struct se_cmd *cmd, | |||
73 | sense_reason_t (*do_unmap_fn)(struct se_cmd *cmd, void *priv, | 73 | sense_reason_t (*do_unmap_fn)(struct se_cmd *cmd, void *priv, |
74 | sector_t lba, sector_t nolb), | 74 | sector_t lba, sector_t nolb), |
75 | void *priv); | 75 | void *priv); |
76 | void sbc_dif_generate(struct se_cmd *); | ||
76 | sense_reason_t sbc_dif_verify_write(struct se_cmd *, sector_t, unsigned int, | 77 | sense_reason_t sbc_dif_verify_write(struct se_cmd *, sector_t, unsigned int, |
77 | unsigned int, struct scatterlist *, int); | 78 | unsigned int, struct scatterlist *, int); |
78 | sense_reason_t sbc_dif_verify_read(struct se_cmd *, sector_t, unsigned int, | 79 | sense_reason_t sbc_dif_verify_read(struct se_cmd *, sector_t, unsigned int, |
79 | unsigned int, struct scatterlist *, int); | 80 | unsigned int, struct scatterlist *, int); |
81 | sense_reason_t sbc_dif_read_strip(struct se_cmd *); | ||
80 | 82 | ||
81 | void transport_set_vpd_proto_id(struct t10_vpd *, unsigned char *); | 83 | void transport_set_vpd_proto_id(struct t10_vpd *, unsigned char *); |
82 | int transport_set_vpd_assoc(struct t10_vpd *, unsigned char *); | 84 | int transport_set_vpd_assoc(struct t10_vpd *, unsigned char *); |
diff --git a/include/target/target_core_base.h b/include/target/target_core_base.h index 1772fadcff62..9ec9864ecf38 100644 --- a/include/target/target_core_base.h +++ b/include/target/target_core_base.h | |||
@@ -162,7 +162,7 @@ enum se_cmd_flags_table { | |||
162 | SCF_SENT_CHECK_CONDITION = 0x00000800, | 162 | SCF_SENT_CHECK_CONDITION = 0x00000800, |
163 | SCF_OVERFLOW_BIT = 0x00001000, | 163 | SCF_OVERFLOW_BIT = 0x00001000, |
164 | SCF_UNDERFLOW_BIT = 0x00002000, | 164 | SCF_UNDERFLOW_BIT = 0x00002000, |
165 | SCF_SENT_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, | 168 | SCF_ACK_KREF = 0x00040000, |
@@ -442,19 +442,18 @@ struct se_tmr_req { | |||
442 | }; | 442 | }; |
443 | 443 | ||
444 | enum target_prot_op { | 444 | enum target_prot_op { |
445 | TARGET_PROT_NORMAL = 0, | 445 | TARGET_PROT_NORMAL = 0, |
446 | TARGET_PROT_DIN_INSERT, | 446 | TARGET_PROT_DIN_INSERT = (1 << 0), |
447 | TARGET_PROT_DOUT_INSERT, | 447 | TARGET_PROT_DOUT_INSERT = (1 << 1), |
448 | TARGET_PROT_DIN_STRIP, | 448 | TARGET_PROT_DIN_STRIP = (1 << 2), |
449 | TARGET_PROT_DOUT_STRIP, | 449 | TARGET_PROT_DOUT_STRIP = (1 << 3), |
450 | TARGET_PROT_DIN_PASS, | 450 | TARGET_PROT_DIN_PASS = (1 << 4), |
451 | TARGET_PROT_DOUT_PASS, | 451 | TARGET_PROT_DOUT_PASS = (1 << 5), |
452 | }; | 452 | }; |
453 | 453 | ||
454 | enum target_prot_ho { | 454 | #define TARGET_PROT_ALL TARGET_PROT_DIN_INSERT | TARGET_PROT_DOUT_INSERT | \ |
455 | PROT_SEPERATED, | 455 | TARGET_PROT_DIN_STRIP | TARGET_PROT_DOUT_STRIP | \ |
456 | PROT_INTERLEAVED, | 456 | TARGET_PROT_DIN_PASS | TARGET_PROT_DOUT_PASS |
457 | }; | ||
458 | 457 | ||
459 | enum target_prot_type { | 458 | enum target_prot_type { |
460 | TARGET_DIF_TYPE0_PROT, | 459 | TARGET_DIF_TYPE0_PROT, |
@@ -463,6 +462,12 @@ enum target_prot_type { | |||
463 | TARGET_DIF_TYPE3_PROT, | 462 | TARGET_DIF_TYPE3_PROT, |
464 | }; | 463 | }; |
465 | 464 | ||
465 | enum target_core_dif_check { | ||
466 | TARGET_DIF_CHECK_GUARD = 0x1 << 0, | ||
467 | TARGET_DIF_CHECK_APPTAG = 0x1 << 1, | ||
468 | TARGET_DIF_CHECK_REFTAG = 0x1 << 2, | ||
469 | }; | ||
470 | |||
466 | struct se_dif_v1_tuple { | 471 | struct se_dif_v1_tuple { |
467 | __be16 guard_tag; | 472 | __be16 guard_tag; |
468 | __be16 app_tag; | 473 | __be16 app_tag; |
@@ -556,13 +561,14 @@ struct se_cmd { | |||
556 | /* DIF related members */ | 561 | /* DIF related members */ |
557 | enum target_prot_op prot_op; | 562 | enum target_prot_op prot_op; |
558 | enum target_prot_type prot_type; | 563 | enum target_prot_type prot_type; |
564 | u8 prot_checks; | ||
559 | u32 prot_length; | 565 | u32 prot_length; |
560 | u32 reftag_seed; | 566 | u32 reftag_seed; |
561 | struct scatterlist *t_prot_sg; | 567 | struct scatterlist *t_prot_sg; |
562 | unsigned int t_prot_nents; | 568 | unsigned int t_prot_nents; |
563 | enum target_prot_ho prot_handover; | ||
564 | sense_reason_t pi_err; | 569 | sense_reason_t pi_err; |
565 | sector_t bad_sector; | 570 | sector_t bad_sector; |
571 | bool prot_pto; | ||
566 | }; | 572 | }; |
567 | 573 | ||
568 | struct se_ua { | 574 | struct se_ua { |
@@ -603,6 +609,7 @@ struct se_node_acl { | |||
603 | struct se_session { | 609 | struct se_session { |
604 | unsigned sess_tearing_down:1; | 610 | unsigned sess_tearing_down:1; |
605 | u64 sess_bin_isid; | 611 | u64 sess_bin_isid; |
612 | enum target_prot_op sup_prot_ops; | ||
606 | struct se_node_acl *se_node_acl; | 613 | struct se_node_acl *se_node_acl; |
607 | struct se_portal_group *se_tpg; | 614 | struct se_portal_group *se_tpg; |
608 | void *fabric_sess_ptr; | 615 | void *fabric_sess_ptr; |
diff --git a/include/target/target_core_fabric.h b/include/target/target_core_fabric.h index 0218d689b3d7..22a4e98eec80 100644 --- a/include/target/target_core_fabric.h +++ b/include/target/target_core_fabric.h | |||
@@ -62,6 +62,7 @@ struct target_core_fabric_ops { | |||
62 | int (*queue_data_in)(struct se_cmd *); | 62 | int (*queue_data_in)(struct se_cmd *); |
63 | int (*queue_status)(struct se_cmd *); | 63 | int (*queue_status)(struct se_cmd *); |
64 | void (*queue_tm_rsp)(struct se_cmd *); | 64 | void (*queue_tm_rsp)(struct se_cmd *); |
65 | void (*aborted_task)(struct se_cmd *); | ||
65 | /* | 66 | /* |
66 | * fabric module calls for target_core_fabric_configfs.c | 67 | * fabric module calls for target_core_fabric_configfs.c |
67 | */ | 68 | */ |
@@ -83,10 +84,11 @@ struct target_core_fabric_ops { | |||
83 | void (*fabric_drop_nodeacl)(struct se_node_acl *); | 84 | void (*fabric_drop_nodeacl)(struct se_node_acl *); |
84 | }; | 85 | }; |
85 | 86 | ||
86 | struct se_session *transport_init_session(void); | 87 | struct se_session *transport_init_session(enum target_prot_op); |
87 | int transport_alloc_session_tags(struct se_session *, unsigned int, | 88 | int transport_alloc_session_tags(struct se_session *, unsigned int, |
88 | unsigned int); | 89 | unsigned int); |
89 | struct se_session *transport_init_session_tags(unsigned int, unsigned int); | 90 | struct se_session *transport_init_session_tags(unsigned int, unsigned int, |
91 | enum target_prot_op); | ||
90 | void __transport_register_session(struct se_portal_group *, | 92 | void __transport_register_session(struct se_portal_group *, |
91 | struct se_node_acl *, struct se_session *, void *); | 93 | struct se_node_acl *, struct se_session *, void *); |
92 | void transport_register_session(struct se_portal_group *, | 94 | void transport_register_session(struct se_portal_group *, |