diff options
author | Larry Finger <Larry.Finger@lwfinger.net> | 2011-05-19 12:48:45 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-05-26 15:43:30 -0400 |
commit | 0019a2c9277bf6d083032a5a9857249e75407a8c (patch) | |
tree | 6388a7f514503194871f18319ed24e795e845126 /drivers/net | |
parent | a9e12869758430424804dd4332e0d2afdfdf00b0 (diff) |
rtlwifi: Use order 2 RX buffer allocation only if necessary
Although a previous fix handles the kernel panics that result from
failure to allocate a new RX buffer, memory fragmentation can be
reduced if the amsdu_8k capability is disabled as new buffers need only
be of O(0), not O(2).
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/wireless/rtlwifi/pci.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/net/wireless/rtlwifi/pci.c b/drivers/net/wireless/rtlwifi/pci.c index c2b83a57c581..89100e7c553b 100644 --- a/drivers/net/wireless/rtlwifi/pci.c +++ b/drivers/net/wireless/rtlwifi/pci.c | |||
@@ -1115,6 +1115,13 @@ static int _rtl_pci_init_rx_ring(struct ieee80211_hw *hw) | |||
1115 | 1115 | ||
1116 | rtlpci->rx_ring[rx_queue_idx].idx = 0; | 1116 | rtlpci->rx_ring[rx_queue_idx].idx = 0; |
1117 | 1117 | ||
1118 | /* If amsdu_8k is disabled, set buffersize to 4096. This | ||
1119 | * change will reduce memory fragmentation. | ||
1120 | */ | ||
1121 | if (rtlpci->rxbuffersize > 4096 && | ||
1122 | rtlpriv->rtlhal.disable_amsdu_8k) | ||
1123 | rtlpci->rxbuffersize = 4096; | ||
1124 | |||
1118 | for (i = 0; i < rtlpci->rxringcount; i++) { | 1125 | for (i = 0; i < rtlpci->rxringcount; i++) { |
1119 | struct sk_buff *skb = | 1126 | struct sk_buff *skb = |
1120 | dev_alloc_skb(rtlpci->rxbuffersize); | 1127 | dev_alloc_skb(rtlpci->rxbuffersize); |