Skip to content

Commit

Permalink
target: Enable WRITE_INSERT emulation in target_execute_cmd
Browse files Browse the repository at this point in the history
This patch enables WRITE_INSERT emulation in target_execute_cmd()
in order to locally generate DIF PI before submitting the WRITE
to the underlying backend device.

This is required for fabric drivers that currently don't support
DIF over-the-wire, in order to inact with backend devices that
have hardware (IBLOCK) or software (FILEIO + RAMDISK) support
for handling T10 PI.

v2 changes:
   - Convert to sbc_dif_generate() usage (Sagi)

Reviewed-by: Sagi Grimberg <[email protected]>
Cc: Martin K. Petersen <[email protected]>
Cc: Or Gerlitz <[email protected]>
Cc: Quinn Tran <[email protected]>
Cc: Giridhar Malavali <[email protected]>
Signed-off-by: Nicholas Bellinger <[email protected]>
  • Loading branch information
nablio3000 committed Apr 7, 2014
1 parent 66a3d5b commit a84bf9e
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions drivers/target/target_core_transport.c
Original file line number Diff line number Diff line change
Expand Up @@ -1767,6 +1767,15 @@ void target_execute_cmd(struct se_cmd *cmd)
cmd->t_state = TRANSPORT_PROCESSING;
cmd->transport_state |= CMD_T_ACTIVE|CMD_T_BUSY|CMD_T_SENT;
spin_unlock_irq(&cmd->t_state_lock);
/*
* Perform WRITE_INSERT of PI using software emulation when backend
* device has PI enabled, if the transport has not already generated
* PI using hardware WRITE_INSERT offload.
*/
if (cmd->prot_op == TARGET_PROT_DOUT_INSERT) {
if (!(cmd->se_sess->sup_prot_ops & TARGET_PROT_DOUT_INSERT))
sbc_dif_generate(cmd);
}

if (target_handle_task_attr(cmd)) {
spin_lock_irq(&cmd->t_state_lock);
Expand Down

0 comments on commit a84bf9e

Please sign in to comment.