aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-trans-pcie-int.h
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2012-03-19 12:12:06 -0400
committerWey-Yi Guy <wey-yi.w.guy@intel.com>2012-04-18 10:32:28 -0400
commitbf8440e6a6f5fabf7843dbfecb1745e49182fa1c (patch)
tree7c7e8168f65d4af3bf89617d7727264e81d4fc83 /drivers/net/wireless/iwlwifi/iwl-trans-pcie-int.h
parent682e5f64de0ab5be3fb2de9f66a1da87de48ec09 (diff)
iwlwifi: improve TX cache footprint
Having cmd[], meta[] and skbs[] as separate arrays in the TX queue structure is cache inefficient as we need the data for a given entry together. To improve this, create an array with these three members (allocate meta as part of that struct) so we have the data we need together located together improving cache footprint. The downside is that we need to allocate a lot of memory in one chunk, about 10KiB (on 64-bit) which isn't very efficient. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-trans-pcie-int.h')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-trans-pcie-int.h29
1 files changed, 16 insertions, 13 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-trans-pcie-int.h b/drivers/net/wireless/iwlwifi/iwl-trans-pcie-int.h
index 7caa875cfa3..c7f8f407bc9 100644
--- a/drivers/net/wireless/iwlwifi/iwl-trans-pcie-int.h
+++ b/drivers/net/wireless/iwlwifi/iwl-trans-pcie-int.h
@@ -179,30 +179,33 @@ struct iwl_queue {
179 * space less than this */ 179 * space less than this */
180}; 180};
181 181
182#define TFD_TX_CMD_SLOTS 256
183#define TFD_CMD_SLOTS 32
184
185struct iwl_pcie_tx_queue_entry {
186 struct iwl_device_cmd *cmd;
187 struct sk_buff *skb;
188 struct iwl_cmd_meta meta;
189};
190
182/** 191/**
183 * struct iwl_tx_queue - Tx Queue for DMA 192 * struct iwl_tx_queue - Tx Queue for DMA
184 * @q: generic Rx/Tx queue descriptor 193 * @q: generic Rx/Tx queue descriptor
185 * @bd: base of circular buffer of TFDs 194 * @tfds: transmit frame descriptors (DMA memory)
186 * @cmd: array of command/TX buffer pointers 195 * @entries: transmit entries (driver state)
187 * @meta: array of meta data for each command/tx buffer 196 * @lock: queue lock
188 * @dma_addr_cmd: physical address of cmd/tx buffer array 197 * @stuck_timer: timer that fires if queue gets stuck
189 * @txb: array of per-TFD driver data 198 * @trans_pcie: pointer back to transport (for timer)
190 * lock: queue lock
191 * @time_stamp: time (in jiffies) of last read_ptr change
192 * @need_update: indicates need to update read/write index 199 * @need_update: indicates need to update read/write index
200 * @active: stores if queue is active
193 * 201 *
194 * A Tx queue consists of circular buffer of BDs (a.k.a. TFDs, transmit frame 202 * A Tx queue consists of circular buffer of BDs (a.k.a. TFDs, transmit frame
195 * descriptors) and required locking structures. 203 * descriptors) and required locking structures.
196 */ 204 */
197#define TFD_TX_CMD_SLOTS 256
198#define TFD_CMD_SLOTS 32
199
200struct iwl_tx_queue { 205struct iwl_tx_queue {
201 struct iwl_queue q; 206 struct iwl_queue q;
202 struct iwl_tfd *tfds; 207 struct iwl_tfd *tfds;
203 struct iwl_device_cmd **cmd; 208 struct iwl_pcie_tx_queue_entry *entries;
204 struct iwl_cmd_meta *meta;
205 struct sk_buff **skbs;
206 spinlock_t lock; 209 spinlock_t lock;
207 struct timer_list stuck_timer; 210 struct timer_list stuck_timer;
208 struct iwl_trans_pcie *trans_pcie; 211 struct iwl_trans_pcie *trans_pcie;