aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/firewire/fw-transaction.h
diff options
context:
space:
mode:
authorStefan Richter <stefanr@s5r6.in-berlin.de>2008-11-29 13:00:56 -0500
committerStefan Richter <stefanr@s5r6.in-berlin.de>2009-01-04 17:50:38 -0500
commitc8a12d45d543905a2718fccafd612edbd73a1341 (patch)
treeb14e18eb68be2da1e9971ce5094ccc54b9030ef8 /drivers/firewire/fw-transaction.h
parentd6f95a3d14dc403881b23ad268ec1e3600c4e6b4 (diff)
firewire: reorder struct fw_card for better cache efficiency
topology_map is by far the largest member in struct fw_card. Move it to the very end of the struct so that card pointer dereferences have better chances to hit the CPU cache. This requires to increase the topology_map backing store to the size specified in IEEE 1394, i.e. 256 rather than 255 quadlets. Otherwise the topology_map response handler may access invalid memory. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Diffstat (limited to 'drivers/firewire/fw-transaction.h')
-rw-r--r--drivers/firewire/fw-transaction.h10
1 files changed, 3 insertions, 7 deletions
diff --git a/drivers/firewire/fw-transaction.h b/drivers/firewire/fw-transaction.h
index 5a57bb897e23..c9ab12a15f6e 100644
--- a/drivers/firewire/fw-transaction.h
+++ b/drivers/firewire/fw-transaction.h
@@ -237,13 +237,6 @@ struct fw_card {
237 int link_speed; 237 int link_speed;
238 int config_rom_generation; 238 int config_rom_generation;
239 239
240 /*
241 * We need to store up to 4 self ID for a maximum of 63
242 * devices plus 3 words for the topology map header.
243 */
244 u32 topology_map[252 + 3];
245 u32 broadcast_channel;
246
247 spinlock_t lock; /* Take this lock when handling the lists in 240 spinlock_t lock; /* Take this lock when handling the lists in
248 * this struct. */ 241 * this struct. */
249 struct fw_node *local_node; 242 struct fw_node *local_node;
@@ -261,6 +254,9 @@ struct fw_card {
261 struct delayed_work work; 254 struct delayed_work work;
262 int bm_retries; 255 int bm_retries;
263 int bm_generation; 256 int bm_generation;
257
258 u32 broadcast_channel;
259 u32 topology_map[(CSR_TOPOLOGY_MAP_END - CSR_TOPOLOGY_MAP) / 4];
264}; 260};
265 261
266static inline struct fw_card *fw_card_get(struct fw_card *card) 262static inline struct fw_card *fw_card_get(struct fw_card *card)