[SCSI] libfc, tcm_fc: add ddp_targ() to libfc function template to supprot FCoE DDP...
authorYi Zou <yi.zou@intel.com>
Mon, 20 Jun 2011 23:59:05 +0000 (16:59 -0700)
committerJames Bottomley <JBottomley@Parallels.com>
Wed, 29 Jun 2011 21:28:39 +0000 (16:28 -0500)
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>
drivers/target/tcm_fc/tfc_cmd.c
include/scsi/libfc.h

index b2a106729d4914eca2c275adb956a944939d9b99..b9cea59d43b45033a035283a22af7a659a3d19a7 100644 (file)
@@ -266,8 +266,9 @@ int ft_write_pending(struct se_cmd *se_cmd)
                                cmd->sg_cnt =
                                        T_TASK(se_cmd)->t_tasks_sg_chained_no;
                        }
-                       if (cmd->sg && lport->tt.ddp_setup(lport, ep->xid,
-                                                   cmd->sg, cmd->sg_cnt))
+                       if (cmd->sg && lport->tt.ddp_target(lport, ep->xid,
+                                                           cmd->sg,
+                                                           cmd->sg_cnt))
                                cmd->was_ddp_setup = 1;
                }
        }
index a3cbda4ddb5cb03078bdd965718537cce440e321..7d96829b0c003bc623c969f5e15f210e81f76d7d 100644 (file)
@@ -510,6 +510,14 @@ struct libfc_function_template {
         * STATUS: OPTIONAL
         */
        int (*ddp_done)(struct fc_lport *, u16);
+       /*
+        * Sets up the DDP context for a given exchange id on the given
+        * scatterlist if LLD supports DDP for FCoE target.
+        *
+        * STATUS: OPTIONAL
+        */
+       int (*ddp_target)(struct fc_lport *, u16, struct scatterlist *,
+                         unsigned int);
        /*
         * Allow LLD to fill its own Link Error Status Block
         *