Skip to content

Commit 0019a2c

Browse files
lwfingerlinvjw
authored andcommitted
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>
1 parent a9e1286 commit 0019a2c

File tree

1 file changed

+7
-0
lines changed
  • drivers/net/wireless/rtlwifi

1 file changed

+7
-0
lines changed

drivers/net/wireless/rtlwifi/pci.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1115,6 +1115,13 @@ static int _rtl_pci_init_rx_ring(struct ieee80211_hw *hw)
11151115

11161116
rtlpci->rx_ring[rx_queue_idx].idx = 0;
11171117

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+
11181125
for (i = 0; i < rtlpci->rxringcount; i++) {
11191126
struct sk_buff *skb =
11201127
dev_alloc_skb(rtlpci->rxbuffersize);

0 commit comments

Comments
 (0)