Commit 2a9e2579 authored by Johannes Berg's avatar Johannes Berg

mac80211: only remove AP VLAN frames from TXQ

When removing an AP VLAN interface, mac80211 currently purges
the entire TXQ for the AP interface. Fix this by using the FQ
API introduced in the previous patch to filter frames.
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
Acked-by: default avatarToke Høiland-Jørgensen <toke@toke.dk>
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent 8c418b5b
...@@ -2009,6 +2009,8 @@ void ieee80211_txq_init(struct ieee80211_sub_if_data *sdata, ...@@ -2009,6 +2009,8 @@ void ieee80211_txq_init(struct ieee80211_sub_if_data *sdata,
struct txq_info *txq, int tid); struct txq_info *txq, int tid);
void ieee80211_txq_purge(struct ieee80211_local *local, void ieee80211_txq_purge(struct ieee80211_local *local,
struct txq_info *txqi); struct txq_info *txqi);
void ieee80211_txq_remove_vlan(struct ieee80211_local *local,
struct ieee80211_sub_if_data *sdata);
void ieee80211_send_auth(struct ieee80211_sub_if_data *sdata, void ieee80211_send_auth(struct ieee80211_sub_if_data *sdata,
u16 transaction, u16 auth_alg, u16 status, u16 transaction, u16 auth_alg, u16 status,
const u8 *extra, size_t extra_len, const u8 *bssid, const u8 *extra, size_t extra_len, const u8 *bssid,
......
...@@ -793,9 +793,7 @@ static int ieee80211_open(struct net_device *dev) ...@@ -793,9 +793,7 @@ static int ieee80211_open(struct net_device *dev)
static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata, static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata,
bool going_down) bool going_down)
{ {
struct ieee80211_sub_if_data *txq_sdata = sdata;
struct ieee80211_local *local = sdata->local; struct ieee80211_local *local = sdata->local;
struct fq *fq = &local->fq;
unsigned long flags; unsigned long flags;
struct sk_buff *skb, *tmp; struct sk_buff *skb, *tmp;
u32 hw_reconf_flags = 0; u32 hw_reconf_flags = 0;
...@@ -939,9 +937,6 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata, ...@@ -939,9 +937,6 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata,
switch (sdata->vif.type) { switch (sdata->vif.type) {
case NL80211_IFTYPE_AP_VLAN: case NL80211_IFTYPE_AP_VLAN:
txq_sdata = container_of(sdata->bss,
struct ieee80211_sub_if_data, u.ap);
mutex_lock(&local->mtx); mutex_lock(&local->mtx);
list_del(&sdata->u.vlan.list); list_del(&sdata->u.vlan.list);
mutex_unlock(&local->mtx); mutex_unlock(&local->mtx);
...@@ -998,8 +993,6 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata, ...@@ -998,8 +993,6 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata,
skb_queue_purge(&sdata->skb_queue); skb_queue_purge(&sdata->skb_queue);
} }
sdata->bss = NULL;
spin_lock_irqsave(&local->queue_stop_reason_lock, flags); spin_lock_irqsave(&local->queue_stop_reason_lock, flags);
for (i = 0; i < IEEE80211_MAX_QUEUES; i++) { for (i = 0; i < IEEE80211_MAX_QUEUES; i++) {
skb_queue_walk_safe(&local->pending[i], skb, tmp) { skb_queue_walk_safe(&local->pending[i], skb, tmp) {
...@@ -1012,22 +1005,10 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata, ...@@ -1012,22 +1005,10 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata,
} }
spin_unlock_irqrestore(&local->queue_stop_reason_lock, flags); spin_unlock_irqrestore(&local->queue_stop_reason_lock, flags);
if (txq_sdata->vif.txq) { if (sdata->vif.type == NL80211_IFTYPE_AP_VLAN)
struct txq_info *txqi = to_txq_info(txq_sdata->vif.txq); ieee80211_txq_remove_vlan(local, sdata);
/* sdata->bss = NULL;
* FIXME FIXME
*
* We really shouldn't purge the *entire* txqi since that
* contains frames for the other AP_VLANs (and possibly
* the AP itself) as well, but there's no API in FQ now
* to be able to filter.
*/
spin_lock_bh(&fq->lock);
ieee80211_txq_purge(local, txqi);
spin_unlock_bh(&fq->lock);
}
if (local->open_count == 0) if (local->open_count == 0)
ieee80211_clear_tx_pending(local); ieee80211_clear_tx_pending(local);
......
...@@ -1396,6 +1396,40 @@ static void ieee80211_txq_enqueue(struct ieee80211_local *local, ...@@ -1396,6 +1396,40 @@ static void ieee80211_txq_enqueue(struct ieee80211_local *local,
fq_flow_get_default_func); fq_flow_get_default_func);
} }
static bool fq_vlan_filter_func(struct fq *fq, struct fq_tin *tin,
struct fq_flow *flow, struct sk_buff *skb,
void *data)
{
struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
return info->control.vif == data;
}
void ieee80211_txq_remove_vlan(struct ieee80211_local *local,
struct ieee80211_sub_if_data *sdata)
{
struct fq *fq = &local->fq;
struct txq_info *txqi;
struct fq_tin *tin;
struct ieee80211_sub_if_data *ap;
if (WARN_ON(sdata->vif.type != NL80211_IFTYPE_AP_VLAN))
return;
ap = container_of(sdata->bss, struct ieee80211_sub_if_data, u.ap);
if (!ap->vif.txq)
return;
txqi = to_txq_info(ap->vif.txq);
tin = &txqi->tin;
spin_lock_bh(&fq->lock);
fq_tin_filter(fq, tin, fq_vlan_filter_func, &sdata->vif,
fq_skb_free_func);
spin_unlock_bh(&fq->lock);
}
void ieee80211_txq_init(struct ieee80211_sub_if_data *sdata, void ieee80211_txq_init(struct ieee80211_sub_if_data *sdata,
struct sta_info *sta, struct sta_info *sta,
struct txq_info *txqi, int tid) struct txq_info *txqi, int tid)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment