diff options
author | Yi Zou <yi.zou@intel.com> | 2009-02-27 17:07:21 -0500 |
---|---|---|
committer | James Bottomley <James.Bottomley@HansenPartnership.com> | 2009-03-13 16:15:15 -0400 |
commit | b277d2aa9a4d969002c4157bf77b76b9ad9ca04a (patch) | |
tree | 1054ff4ab2d03eaaa527919380ed6334233f632b /include/scsi/fc_frame.h | |
parent | 39ca9a065a5a0a6f2f0cd648090a979ba3f4f018 (diff) |
[SCSI] libfc: add support of large receive offload by ddp in fc_fcp
When LLD supports direct data placement (ddp) for large receive of an scsi
i/o coming into fc_fcp, we call into libfc_function_template's ddp_setup()
to prepare for a ddp of large receive for this read I/O. When I/O is complete,
we call the corresponding ddp_done() to get the length of data ddped as well
as to let LLD do clean up.
fc_fcp_ddp_setup()/fc_fcp_ddp_done() are added to setup and complete a ddped
read I/O described by the given fc_fcp_pkt. They would call into corresponding
ddp_setup/ddp_done implemented by the fcoe layer. Eventually, fcoe layer calls
into LLD's ddp_setup/ddp_done provided through net_device
Signed-off-by: Yi Zou <yi.zou@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'include/scsi/fc_frame.h')
-rw-r--r-- | include/scsi/fc_frame.h | 19 |
1 files changed, 2 insertions, 17 deletions
diff --git a/include/scsi/fc_frame.h b/include/scsi/fc_frame.h index 04d34a71355f..59511057cee0 100644 --- a/include/scsi/fc_frame.h +++ b/include/scsi/fc_frame.h | |||
@@ -54,8 +54,7 @@ | |||
54 | #define fr_eof(fp) (fr_cb(fp)->fr_eof) | 54 | #define fr_eof(fp) (fr_cb(fp)->fr_eof) |
55 | #define fr_flags(fp) (fr_cb(fp)->fr_flags) | 55 | #define fr_flags(fp) (fr_cb(fp)->fr_flags) |
56 | #define fr_max_payload(fp) (fr_cb(fp)->fr_max_payload) | 56 | #define fr_max_payload(fp) (fr_cb(fp)->fr_max_payload) |
57 | #define fr_cmd(fp) (fr_cb(fp)->fr_cmd) | 57 | #define fr_fsp(fp) (fr_cb(fp)->fr_fsp) |
58 | #define fr_dir(fp) (fr_cmd(fp)->sc_data_direction) | ||
59 | #define fr_crc(fp) (fr_cb(fp)->fr_crc) | 58 | #define fr_crc(fp) (fr_cb(fp)->fr_crc) |
60 | 59 | ||
61 | struct fc_frame { | 60 | struct fc_frame { |
@@ -66,7 +65,7 @@ struct fcoe_rcv_info { | |||
66 | struct packet_type *ptype; | 65 | struct packet_type *ptype; |
67 | struct fc_lport *fr_dev; /* transport layer private pointer */ | 66 | struct fc_lport *fr_dev; /* transport layer private pointer */ |
68 | struct fc_seq *fr_seq; /* for use with exchange manager */ | 67 | struct fc_seq *fr_seq; /* for use with exchange manager */ |
69 | struct scsi_cmnd *fr_cmd; /* for use of scsi command */ | 68 | struct fc_fcp_pkt *fr_fsp; /* for the corresponding fcp I/O */ |
70 | u32 fr_crc; | 69 | u32 fr_crc; |
71 | u16 fr_max_payload; /* max FC payload */ | 70 | u16 fr_max_payload; /* max FC payload */ |
72 | enum fc_sof fr_sof; /* start of frame delimiter */ | 71 | enum fc_sof fr_sof; /* start of frame delimiter */ |
@@ -218,20 +217,6 @@ static inline bool fc_frame_is_cmd(const struct fc_frame *fp) | |||
218 | return fc_frame_rctl(fp) == FC_RCTL_DD_UNSOL_CMD; | 217 | return fc_frame_rctl(fp) == FC_RCTL_DD_UNSOL_CMD; |
219 | } | 218 | } |
220 | 219 | ||
221 | static inline bool fc_frame_is_read(const struct fc_frame *fp) | ||
222 | { | ||
223 | if (fc_frame_is_cmd(fp) && fr_cmd(fp)) | ||
224 | return fr_dir(fp) == DMA_FROM_DEVICE; | ||
225 | return false; | ||
226 | } | ||
227 | |||
228 | static inline bool fc_frame_is_write(const struct fc_frame *fp) | ||
229 | { | ||
230 | if (fc_frame_is_cmd(fp) && fr_cmd(fp)) | ||
231 | return fr_dir(fp) == DMA_TO_DEVICE; | ||
232 | return false; | ||
233 | } | ||
234 | |||
235 | /* | 220 | /* |
236 | * Check for leaks. | 221 | * Check for leaks. |
237 | * Print the frame header of any currently allocated frame, assuming there | 222 | * Print the frame header of any currently allocated frame, assuming there |