Skip to content

Commit 33dc362

Browse files
yizouJames Bottomley
authored andcommitted
[SCSI] libfc, tcm_fc: add ddp_targ() to libfc function template to supprot FCoE DDP in target mode
The fcoe driver can implement ddp_targ() similarly to ddp_setup() when fcoe stack works with existing target frame, e.g., tcm, where the ddp_targ() would eventually point to the underlying hardware driver's implementation of ndo_fcoe_ddp_targ() through net_device_ops. This new API sets up DDP context for target appropriately by setting required bits for DDP context. Signed-off-by: Yi Zou <yi.zou@intel.com> Signed-off-by: Kiran Patil <kiran.patil@intel.com> Signed-off-by: Robert Love <robert.w.love@intel.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
1 parent 4805848 commit 33dc362

2 files changed

Lines changed: 11 additions & 2 deletions

File tree

‎drivers/target/tcm_fc/tfc_cmd.c‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -266,8 +266,9 @@ int ft_write_pending(struct se_cmd *se_cmd)
266266
cmd->sg_cnt =
267267
T_TASK(se_cmd)->t_tasks_sg_chained_no;
268268
}
269-
if (cmd->sg && lport->tt.ddp_setup(lport, ep->xid,
270-
cmd->sg, cmd->sg_cnt))
269+
if (cmd->sg && lport->tt.ddp_target(lport, ep->xid,
270+
cmd->sg,
271+
cmd->sg_cnt))
271272
cmd->was_ddp_setup = 1;
272273
}
273274
}

‎include/scsi/libfc.h‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -510,6 +510,14 @@ struct libfc_function_template {
510510
* STATUS: OPTIONAL
511511
*/
512512
int (*ddp_done)(struct fc_lport *, u16);
513+
/*
514+
* Sets up the DDP context for a given exchange id on the given
515+
* scatterlist if LLD supports DDP for FCoE target.
516+
*
517+
* STATUS: OPTIONAL
518+
*/
519+
int (*ddp_target)(struct fc_lport *, u16, struct scatterlist *,
520+
unsigned int);
513521
/*
514522
* Allow LLD to fill its own Link Error Status Block
515523
*

0 commit comments

Comments
 (0)