diff options
author | Johannes Berg <johannes.berg@intel.com> | 2017-12-19 10:11:54 +0100 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2017-12-19 10:12:48 +0100 |
commit | e7881bd5942df7df2fc450fd2aaa753fc4c4e125 (patch) | |
tree | 936a15e2817360d322ebe90373099da0d3f478a9 /net/mac80211 | |
parent | 0973dd45ecefd746569d414406f5733062fe2817 (diff) | |
download | linux-e7881bd5942df7df2fc450fd2aaa753fc4c4e125.tar.bz2 |
Revert "mac80211: Add TXQ scheduling API"
This reverts commit e937b8da5a591f141fe41aa48a2e898df9888c95.
Turns out that a new driver (mt76) is coming in through
Kalle's tree, and will conflict with this. It also has some
conflicting requirements, so we'll revisit this later.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211')
-rw-r--r-- | net/mac80211/agg-tx.c | 6 | ||||
-rw-r--r-- | net/mac80211/driver-ops.h | 12 | ||||
-rw-r--r-- | net/mac80211/ieee80211_i.h | 5 | ||||
-rw-r--r-- | net/mac80211/main.c | 3 | ||||
-rw-r--r-- | net/mac80211/sta_info.c | 7 | ||||
-rw-r--r-- | net/mac80211/trace.h | 32 | ||||
-rw-r--r-- | net/mac80211/tx.c | 49 |
7 files changed, 41 insertions, 73 deletions
diff --git a/net/mac80211/agg-tx.c b/net/mac80211/agg-tx.c index 6c6cad98ce92..595c662a61e8 100644 --- a/net/mac80211/agg-tx.c +++ b/net/mac80211/agg-tx.c @@ -226,13 +226,9 @@ ieee80211_agg_start_txq(struct sta_info *sta, int tid, bool enable) clear_bit(IEEE80211_TXQ_AMPDU, &txqi->flags); clear_bit(IEEE80211_TXQ_STOP, &txqi->flags); - - if (!ieee80211_schedule_txq(&sta->sdata->local->hw, txq)) - return; - local_bh_disable(); rcu_read_lock(); - drv_wake_tx_queue(sta->sdata->local); + drv_wake_tx_queue(sta->sdata->local, txqi); rcu_read_unlock(); local_bh_enable(); } diff --git a/net/mac80211/driver-ops.h b/net/mac80211/driver-ops.h index cdd76306cb8f..c7f93fd9ca7a 100644 --- a/net/mac80211/driver-ops.h +++ b/net/mac80211/driver-ops.h @@ -1158,10 +1158,16 @@ drv_tdls_recv_channel_switch(struct ieee80211_local *local, trace_drv_return_void(local); } -static inline void drv_wake_tx_queue(struct ieee80211_local *local) +static inline void drv_wake_tx_queue(struct ieee80211_local *local, + struct txq_info *txq) { - trace_drv_wake_tx_queue(local); - local->ops->wake_tx_queue(&local->hw); + struct ieee80211_sub_if_data *sdata = vif_to_sdata(txq->txq.vif); + + if (!check_sdata_in_driver(sdata)) + return; + + trace_drv_wake_tx_queue(local, sdata, txq); + local->ops->wake_tx_queue(&local->hw, &txq->txq); } static inline int drv_start_nan(struct ieee80211_local *local, diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h index 4155838c7bef..26900025de2f 100644 --- a/net/mac80211/ieee80211_i.h +++ b/net/mac80211/ieee80211_i.h @@ -832,7 +832,6 @@ struct txq_info { struct codel_vars def_cvars; struct codel_stats cstats; struct sk_buff_head frags; - struct list_head schedule_order; unsigned long flags; /* keep last! */ @@ -1123,10 +1122,6 @@ struct ieee80211_local { struct codel_vars *cvars; struct codel_params cparams; - /* protects active_txqs and txqi->schedule_order */ - spinlock_t active_txq_lock; - struct list_head active_txqs; - const struct ieee80211_ops *ops; /* diff --git a/net/mac80211/main.c b/net/mac80211/main.c index 935d6e2491b1..0785d04a80bc 100644 --- a/net/mac80211/main.c +++ b/net/mac80211/main.c @@ -619,9 +619,6 @@ struct ieee80211_hw *ieee80211_alloc_hw_nm(size_t priv_data_len, spin_lock_init(&local->rx_path_lock); spin_lock_init(&local->queue_stop_reason_lock); - INIT_LIST_HEAD(&local->active_txqs); - spin_lock_init(&local->active_txq_lock); - INIT_LIST_HEAD(&local->chanctx_list); mutex_init(&local->chanctx_mtx); diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c index e0bcf16df494..0c5627f8a104 100644 --- a/net/mac80211/sta_info.c +++ b/net/mac80211/sta_info.c @@ -1237,17 +1237,12 @@ void ieee80211_sta_ps_deliver_wakeup(struct sta_info *sta) drv_sta_notify(local, sdata, STA_NOTIFY_AWAKE, &sta->sta); if (sta->sta.txq[0]) { - bool wake = false; - for (i = 0; i < ARRAY_SIZE(sta->sta.txq); i++) { if (!txq_has_queue(sta->sta.txq[i])) continue; - if (ieee80211_schedule_txq(&local->hw, sta->sta.txq[i])) - wake = true; + drv_wake_tx_queue(local, to_txq_info(sta->sta.txq[i])); } - if (wake) - drv_wake_tx_queue(local); } skb_queue_head_init(&pending); diff --git a/net/mac80211/trace.h b/net/mac80211/trace.h index 08eaad85942e..591ad02e1fa4 100644 --- a/net/mac80211/trace.h +++ b/net/mac80211/trace.h @@ -2550,9 +2550,35 @@ TRACE_EVENT(drv_tdls_recv_channel_switch, ) ); -DEFINE_EVENT(local_only_evt, drv_wake_tx_queue, - TP_PROTO(struct ieee80211_local *local), - TP_ARGS(local) +TRACE_EVENT(drv_wake_tx_queue, + TP_PROTO(struct ieee80211_local *local, + struct ieee80211_sub_if_data *sdata, + struct txq_info *txq), + + TP_ARGS(local, sdata, txq), + + TP_STRUCT__entry( + LOCAL_ENTRY + VIF_ENTRY + STA_ENTRY + __field(u8, ac) + __field(u8, tid) + ), + + TP_fast_assign( + struct ieee80211_sta *sta = txq->txq.sta; + + LOCAL_ASSIGN; + VIF_ASSIGN; + STA_ASSIGN; + __entry->ac = txq->txq.ac; + __entry->tid = txq->txq.tid; + ), + + TP_printk( + LOCAL_PR_FMT VIF_PR_FMT STA_PR_FMT " ac:%d tid:%d", + LOCAL_PR_ARG, VIF_PR_ARG, STA_PR_ARG, __entry->ac, __entry->tid + ) ); #endif /* !__MAC80211_DRIVER_TRACE || TRACE_HEADER_MULTI_READ */ diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c index 842881ca8f20..25904af38839 100644 --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c @@ -1439,7 +1439,6 @@ void ieee80211_txq_init(struct ieee80211_sub_if_data *sdata, codel_vars_init(&txqi->def_cvars); codel_stats_init(&txqi->cstats); __skb_queue_head_init(&txqi->frags); - INIT_LIST_HEAD(&txqi->schedule_order); txqi->txq.vif = &sdata->vif; @@ -1463,7 +1462,6 @@ void ieee80211_txq_purge(struct ieee80211_local *local, fq_tin_reset(fq, tin, fq_skb_free_func); ieee80211_purge_tx_queue(&local->hw, &txqi->frags); - list_del_init(&txqi->schedule_order); } int ieee80211_txq_setup_flows(struct ieee80211_local *local) @@ -1560,8 +1558,7 @@ static bool ieee80211_queue_skb(struct ieee80211_local *local, ieee80211_txq_enqueue(local, txqi, skb); spin_unlock_bh(&fq->lock); - if (ieee80211_schedule_txq(&local->hw, &txqi->txq)) - drv_wake_tx_queue(local); + drv_wake_tx_queue(local, txqi); return true; } @@ -3556,50 +3553,6 @@ out: } EXPORT_SYMBOL(ieee80211_tx_dequeue); -bool ieee80211_schedule_txq(struct ieee80211_hw *hw, - struct ieee80211_txq *txq) -{ - struct ieee80211_local *local = hw_to_local(hw); - struct txq_info *txqi = to_txq_info(txq); - bool ret = false; - - spin_lock_bh(&local->active_txq_lock); - - if (list_empty(&txqi->schedule_order)) { - list_add_tail(&txqi->schedule_order, &local->active_txqs); - ret = true; - } - - spin_unlock_bh(&local->active_txq_lock); - - return ret; -} -EXPORT_SYMBOL(ieee80211_schedule_txq); - -struct ieee80211_txq *ieee80211_next_txq(struct ieee80211_hw *hw) -{ - struct ieee80211_local *local = hw_to_local(hw); - struct txq_info *txqi = NULL; - - spin_lock_bh(&local->active_txq_lock); - - if (list_empty(&local->active_txqs)) - goto out; - - txqi = list_first_entry(&local->active_txqs, - struct txq_info, schedule_order); - list_del_init(&txqi->schedule_order); - -out: - spin_unlock_bh(&local->active_txq_lock); - - if (!txqi) - return NULL; - - return &txqi->txq; -} -EXPORT_SYMBOL(ieee80211_next_txq); - void __ieee80211_subif_start_xmit(struct sk_buff *skb, struct net_device *dev, u32 info_flags) |