aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorJohn W. Linville <linville@tuxdriver.com>2011-06-06 14:35:27 -0400
committerJohn W. Linville <linville@tuxdriver.com>2011-06-06 15:23:53 -0400
commitab6a44ce1da48d35fe7ec95fa068aa617bd7e8dd (patch)
treefa8cc877e369e5da15a6daead490d3a87f15909f /net
parentd2ac49fe3c7c4730323c1042fb53a2e008643b6a (diff)
Revert "mac80211: Skip tailroom reservation for full HW-crypto devices"
This reverts commit aac6af5534fade2b18682a0b9efad1a6c04c34c6. Conflicts: net/mac80211/key.c That commit has a race that causes a warning, as documented in the thread here: http://marc.info/?l=linux-wireless&m=130717684914101&w=2 Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net')
-rw-r--r--net/mac80211/ieee80211_i.h3
-rw-r--r--net/mac80211/key.c21
-rw-r--r--net/mac80211/tx.c7
3 files changed, 8 insertions, 23 deletions
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index 2025af52b195..090b0ec1e056 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -775,9 +775,6 @@ struct ieee80211_local {
775 775
776 int tx_headroom; /* required headroom for hardware/radiotap */ 776 int tx_headroom; /* required headroom for hardware/radiotap */
777 777
778 /* count for keys needing tailroom space allocation */
779 int crypto_tx_tailroom_needed_cnt;
780
781 /* Tasklet and skb queue to process calls from IRQ mode. All frames 778 /* Tasklet and skb queue to process calls from IRQ mode. All frames
782 * added to skb_queue will be processed, but frames in 779 * added to skb_queue will be processed, but frames in
783 * skb_queue_unreliable may be dropped if the total length of these 780 * skb_queue_unreliable may be dropped if the total length of these
diff --git a/net/mac80211/key.c b/net/mac80211/key.c
index 31afd712930d..f825e2f0a57e 100644
--- a/net/mac80211/key.c
+++ b/net/mac80211/key.c
@@ -101,11 +101,6 @@ static int ieee80211_key_enable_hw_accel(struct ieee80211_key *key)
101 101
102 if (!ret) { 102 if (!ret) {
103 key->flags |= KEY_FLAG_UPLOADED_TO_HARDWARE; 103 key->flags |= KEY_FLAG_UPLOADED_TO_HARDWARE;
104
105 if (!((key->conf.flags & IEEE80211_KEY_FLAG_GENERATE_MMIC) ||
106 (key->conf.flags & IEEE80211_KEY_FLAG_GENERATE_IV)))
107 key->local->crypto_tx_tailroom_needed_cnt--;
108
109 return 0; 104 return 0;
110 } 105 }
111 106
@@ -161,10 +156,6 @@ static void ieee80211_key_disable_hw_accel(struct ieee80211_key *key)
161 key->conf.keyidx, sta ? sta->addr : bcast_addr, ret); 156 key->conf.keyidx, sta ? sta->addr : bcast_addr, ret);
162 157
163 key->flags &= ~KEY_FLAG_UPLOADED_TO_HARDWARE; 158 key->flags &= ~KEY_FLAG_UPLOADED_TO_HARDWARE;
164
165 if (!((key->conf.flags & IEEE80211_KEY_FLAG_GENERATE_MMIC) ||
166 (key->conf.flags & IEEE80211_KEY_FLAG_GENERATE_IV)))
167 key->local->crypto_tx_tailroom_needed_cnt++;
168} 159}
169 160
170void ieee80211_key_removed(struct ieee80211_key_conf *key_conf) 161void ieee80211_key_removed(struct ieee80211_key_conf *key_conf)
@@ -403,10 +394,8 @@ static void __ieee80211_key_destroy(struct ieee80211_key *key)
403 ieee80211_aes_key_free(key->u.ccmp.tfm); 394 ieee80211_aes_key_free(key->u.ccmp.tfm);
404 if (key->conf.cipher == WLAN_CIPHER_SUITE_AES_CMAC) 395 if (key->conf.cipher == WLAN_CIPHER_SUITE_AES_CMAC)
405 ieee80211_aes_cmac_key_free(key->u.aes_cmac.tfm); 396 ieee80211_aes_cmac_key_free(key->u.aes_cmac.tfm);
406 if (key->local) { 397 if (key->local)
407 ieee80211_debugfs_key_remove(key); 398 ieee80211_debugfs_key_remove(key);
408 key->local->crypto_tx_tailroom_needed_cnt--;
409 }
410 399
411 kfree(key); 400 kfree(key);
412} 401}
@@ -468,8 +457,6 @@ int ieee80211_key_link(struct ieee80211_key *key,
468 457
469 ieee80211_debugfs_key_add(key); 458 ieee80211_debugfs_key_add(key);
470 459
471 key->local->crypto_tx_tailroom_needed_cnt++;
472
473 ret = ieee80211_key_enable_hw_accel(key); 460 ret = ieee80211_key_enable_hw_accel(key);
474 461
475 mutex_unlock(&sdata->local->key_mtx); 462 mutex_unlock(&sdata->local->key_mtx);
@@ -511,12 +498,8 @@ void ieee80211_enable_keys(struct ieee80211_sub_if_data *sdata)
511 498
512 mutex_lock(&sdata->local->key_mtx); 499 mutex_lock(&sdata->local->key_mtx);
513 500
514 sdata->local->crypto_tx_tailroom_needed_cnt = 0; 501 list_for_each_entry(key, &sdata->key_list, list)
515
516 list_for_each_entry(key, &sdata->key_list, list) {
517 sdata->local->crypto_tx_tailroom_needed_cnt++;
518 ieee80211_key_enable_hw_accel(key); 502 ieee80211_key_enable_hw_accel(key);
519 }
520 503
521 mutex_unlock(&sdata->local->key_mtx); 504 mutex_unlock(&sdata->local->key_mtx);
522} 505}
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index 64e0f7587e6d..3104c844b544 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -1480,7 +1480,12 @@ static int ieee80211_skb_resize(struct ieee80211_local *local,
1480{ 1480{
1481 int tail_need = 0; 1481 int tail_need = 0;
1482 1482
1483 if (may_encrypt && local->crypto_tx_tailroom_needed_cnt) { 1483 /*
1484 * This could be optimised, devices that do full hardware
1485 * crypto (including TKIP MMIC) need no tailroom... But we
1486 * have no drivers for such devices currently.
1487 */
1488 if (may_encrypt) {
1484 tail_need = IEEE80211_ENCRYPT_TAILROOM; 1489 tail_need = IEEE80211_ENCRYPT_TAILROOM;
1485 tail_need -= skb_tailroom(skb); 1490 tail_need -= skb_tailroom(skb);
1486 tail_need = max_t(int, tail_need, 0); 1491 tail_need = max_t(int, tail_need, 0);