diff mbox

[PATCH-v2,07/15] target: Add internal READ_INSERT support

Message ID 1427686104-14231-8-git-send-email-nab@daterainc.com (mailing list archive)
State New, archived
Headers show

Commit Message

Nicholas A. Bellinger March 30, 2015, 3:28 a.m. UTC
From: Nicholas Bellinger <nab@linux-iscsi.org>

This patch adds READ_INSERT support in target_check_read_prot() that
invokes sbc_dif_generate() when LIO is responsible for generating the
outgoing T10-PI.

Required for supporting fabrics that exchange protection information,
and would like to function with un-protected devices.

Cc: Martin Petersen <martin.petersen@oracle.com>
Cc: Sagi Grimberg <sagig@mellanox.com>
Cc: Christoph Hellwig <hch@lst.de>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
---
 drivers/target/target_core_transport.c | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

Martin K. Petersen April 7, 2015, 11:34 p.m. UTC | #1
>>>>> "nab" == Nicholas A Bellinger <nab@daterainc.com> writes:

nab> This patch adds READ_INSERT support in target_check_read_prot()
nab> that invokes sbc_dif_generate() when LIO is responsible for
nab> generating the outgoing T10-PI.

nab> Required for supporting fabrics that exchange protection
nab> information, and would like to function with un-protected devices.

Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
diff mbox

Patch

diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c
index e603e34..12b13da 100644
--- a/drivers/target/target_core_transport.c
+++ b/drivers/target/target_core_transport.c
@@ -1994,6 +1994,12 @@  static bool target_check_read_prot(struct se_cmd *cmd)
 			}
 		}
 		break;
+	case TARGET_PROT_DIN_INSERT:
+		if (cmd->se_sess->sup_prot_ops & TARGET_PROT_DIN_INSERT)
+			break;
+
+		sbc_dif_generate(cmd);
+		break;
 	default:
 		break;
 	}