diff options
author | Stefan Richter <stefanr@s5r6.in-berlin.de> | 2007-02-04 07:04:32 -0500 |
---|---|---|
committer | Stefan Richter <stefanr@s5r6.in-berlin.de> | 2007-04-29 18:00:27 -0400 |
commit | f412bf440be2dfc0f0ded917410c599c002549e0 (patch) | |
tree | 40201a090195310661dd1b5630c96cd3da2a6713 /drivers/ieee1394/sbp2.h | |
parent | b9099ff63c75216d6ca10bce5a1abcd9293c27e6 (diff) |
ieee1394: sbp2: remove unnecessary alignments of struct members
The members "dma_addr_t command_orb_dma" and "dma_addr_t sge_dma" of
sbp2.h::sbp2_command_info do not have to be aligned themselves --- only
the memory which they point to has to be.
The member "struct sbp2_command_orb command_orb" has to be aligned on
4 bytes boundary which is guaranteed because it contains u32 members.
The member "struct sbp2_unrestricted_page_table scatter_gather_element",
i.e. the SBP-2 s/g table, has to be aligned on 8 bytes boundary
according to the SBP-2 spec. This is not a requirement for FireWire
controllers but could be expected by SBP-2 targets.
I see no need to align the members command_orb and
scatter_gather_element on CPU cacheline boundaries. It could have
performance benefits, but on the other hand sbp2 has a somewhat wasteful
allocation scheme which should be optimized first before further tweaks
like cacheline alignments. (E.g. don't always allocate SG_ALL s/g table
elements.)
Note, before as well as after the patch, the code relies on the
assumption that memory alignment in the virtual address space is
preserved in the physical address space after DMA mapping.
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Diffstat (limited to 'drivers/ieee1394/sbp2.h')
-rw-r--r-- | drivers/ieee1394/sbp2.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/ieee1394/sbp2.h b/drivers/ieee1394/sbp2.h index 9ae842329bf3..44402b9d82a8 100644 --- a/drivers/ieee1394/sbp2.h +++ b/drivers/ieee1394/sbp2.h | |||
@@ -250,15 +250,15 @@ enum sbp2_dma_types { | |||
250 | /* Per SCSI command */ | 250 | /* Per SCSI command */ |
251 | struct sbp2_command_info { | 251 | struct sbp2_command_info { |
252 | struct list_head list; | 252 | struct list_head list; |
253 | struct sbp2_command_orb command_orb ____cacheline_aligned; | 253 | struct sbp2_command_orb command_orb; |
254 | dma_addr_t command_orb_dma ____cacheline_aligned; | 254 | dma_addr_t command_orb_dma; |
255 | struct scsi_cmnd *Current_SCpnt; | 255 | struct scsi_cmnd *Current_SCpnt; |
256 | void (*Current_done)(struct scsi_cmnd *); | 256 | void (*Current_done)(struct scsi_cmnd *); |
257 | 257 | ||
258 | /* Also need s/g structure for each sbp2 command */ | 258 | /* Also need s/g structure for each sbp2 command */ |
259 | struct sbp2_unrestricted_page_table | 259 | struct sbp2_unrestricted_page_table |
260 | scatter_gather_element[SG_ALL] ____cacheline_aligned; | 260 | scatter_gather_element[SG_ALL] __attribute__((aligned(8))); |
261 | dma_addr_t sge_dma ____cacheline_aligned; | 261 | dma_addr_t sge_dma; |
262 | void *sge_buffer; | 262 | void *sge_buffer; |
263 | dma_addr_t cmd_dma; | 263 | dma_addr_t cmd_dma; |
264 | enum sbp2_dma_types dma_type; | 264 | enum sbp2_dma_types dma_type; |