aboutsummaryrefslogtreecommitdiffstats
path: root/include/scsi
diff options
context:
space:
mode:
authorVasu Dev <vasu.dev@intel.com>2011-09-28 00:37:57 -0400
committerJames Bottomley <JBottomley@Parallels.com>2011-10-02 13:55:07 -0400
commited26cfece6177310ad8f5896651a3187ce02711c (patch)
tree2997e4c698ce773d1fb6867a6daea0cfdd264737 /include/scsi
parent5c609ff937a91cf09b1f8d7612cd00bc046c27f7 (diff)
[SCSI] libfc: cache align struct fc_fcp_pkt fields
Re-arrange its fields to avoid padding and have better cacheline alignments. Removed not used start_time, end_time and last_pkt_time fields. This all reduced this struct size to 448 from 480 and that also reduced one cacheline on x86_64 beside eliminating 8 pads. However kept logical fields together. Signed-off-by: Vasu Dev <vasu.dev@intel.com> Tested-by: Ross Brattain <ross.b.brattain@intel.com> Signed-off-by: Yi Zou <yi.zou@intel.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'include/scsi')
-rw-r--r--include/scsi/libfc.h49
1 files changed, 21 insertions, 28 deletions
diff --git a/include/scsi/libfc.h b/include/scsi/libfc.h
index 7d96829b0c00..05e2583d8fa6 100644
--- a/include/scsi/libfc.h
+++ b/include/scsi/libfc.h
@@ -281,9 +281,6 @@ struct fc_seq_els_data {
281 * @timer: The command timer 281 * @timer: The command timer
282 * @tm_done: Completion indicator 282 * @tm_done: Completion indicator
283 * @wait_for_comp: Indicator to wait for completion of the I/O (in jiffies) 283 * @wait_for_comp: Indicator to wait for completion of the I/O (in jiffies)
284 * @start_time: Timestamp indicating the start of the I/O (in jiffies)
285 * @end_time: Timestamp indicating the end of the I/O (in jiffies)
286 * @last_pkt_time: Timestamp of the last frame received (in jiffies)
287 * @data_len: The length of the data 284 * @data_len: The length of the data
288 * @cdb_cmd: The CDB command 285 * @cdb_cmd: The CDB command
289 * @xfer_len: The transfer length 286 * @xfer_len: The transfer length
@@ -304,50 +301,46 @@ struct fc_seq_els_data {
304 * @recov_seq: The sequence for REC or SRR 301 * @recov_seq: The sequence for REC or SRR
305 */ 302 */
306struct fc_fcp_pkt { 303struct fc_fcp_pkt {
307 /* Housekeeping information */
308 struct fc_lport *lp;
309 u16 state;
310 atomic_t ref_cnt;
311 spinlock_t scsi_pkt_lock; 304 spinlock_t scsi_pkt_lock;
305 atomic_t ref_cnt;
306
307 /* SCSI command and data transfer information */
308 u32 data_len;
312 309
313 /* SCSI I/O related information */ 310 /* SCSI I/O related information */
314 struct scsi_cmnd *cmd; 311 struct scsi_cmnd *cmd;
315 struct list_head list; 312 struct list_head list;
316 313
317 /* Timeout related information */ 314 /* Housekeeping information */
318 struct timer_list timer; 315 struct fc_lport *lp;
319 struct completion tm_done; 316 u8 state;
320 int wait_for_comp;
321 unsigned long start_time;
322 unsigned long end_time;
323 unsigned long last_pkt_time;
324
325 /* SCSI command and data transfer information */
326 u32 data_len;
327
328 /* Transport related veriables */
329 struct fcp_cmnd cdb_cmd;
330 size_t xfer_len;
331 u16 xfer_ddp;
332 u32 xfer_contig_end;
333 u16 max_payload;
334 317
335 /* SCSI/FCP return status */ 318 /* SCSI/FCP return status */
336 u32 io_status;
337 u8 cdb_status; 319 u8 cdb_status;
338 u8 status_code; 320 u8 status_code;
339 u8 scsi_comp_flags; 321 u8 scsi_comp_flags;
322 u32 io_status;
340 u32 req_flags; 323 u32 req_flags;
341 u32 scsi_resid; 324 u32 scsi_resid;
342 325
326 /* Transport related veriables */
327 size_t xfer_len;
328 struct fcp_cmnd cdb_cmd;
329 u32 xfer_contig_end;
330 u16 max_payload;
331 u16 xfer_ddp;
332
343 /* Associated structures */ 333 /* Associated structures */
344 struct fc_rport *rport; 334 struct fc_rport *rport;
345 struct fc_seq *seq_ptr; 335 struct fc_seq *seq_ptr;
346 336
347 /* Error Processing information */ 337 /* Timeout/error related information */
348 u8 recov_retry; 338 struct timer_list timer;
339 int wait_for_comp;
340 u32 recov_retry;
349 struct fc_seq *recov_seq; 341 struct fc_seq *recov_seq;
350}; 342 struct completion tm_done;
343} ____cacheline_aligned_in_smp;
351 344
352/* 345/*
353 * Structure and function definitions for managing Fibre Channel Exchanges 346 * Structure and function definitions for managing Fibre Channel Exchanges