aboutsummaryrefslogtreecommitdiffstats
path: root/package/kernel/mac80211/patches/subsys/382-mac80211-Switch-to-a-virtual-time-based-airtime-sche.patch
diff options
context:
space:
mode:
Diffstat (limited to 'package/kernel/mac80211/patches/subsys/382-mac80211-Switch-to-a-virtual-time-based-airtime-sche.patch')
-rw-r--r--package/kernel/mac80211/patches/subsys/382-mac80211-Switch-to-a-virtual-time-based-airtime-sche.patch66
1 files changed, 33 insertions, 33 deletions
diff --git a/package/kernel/mac80211/patches/subsys/382-mac80211-Switch-to-a-virtual-time-based-airtime-sche.patch b/package/kernel/mac80211/patches/subsys/382-mac80211-Switch-to-a-virtual-time-based-airtime-sche.patch
index 475715a2f9..d99ca5961c 100644
--- a/package/kernel/mac80211/patches/subsys/382-mac80211-Switch-to-a-virtual-time-based-airtime-sche.patch
+++ b/package/kernel/mac80211/patches/subsys/382-mac80211-Switch-to-a-virtual-time-based-airtime-sche.patch
@@ -50,7 +50,7 @@ Signed-off-by: Johannes Berg <johannes.berg@intel.com>
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
-@@ -6578,9 +6578,6 @@ static inline void ieee80211_txq_schedul
+@@ -6585,9 +6585,6 @@ static inline void ieee80211_txq_schedul
{
}
@@ -60,7 +60,7 @@ Signed-off-by: Johannes Berg <johannes.berg@intel.com>
/**
* ieee80211_schedule_txq - schedule a TXQ for transmission
*
-@@ -6593,11 +6590,7 @@ void __ieee80211_schedule_txq(struct iee
+@@ -6600,11 +6597,7 @@ void __ieee80211_schedule_txq(struct iee
* The driver may call this function if it has buffered packets for
* this TXQ internally.
*/
@@ -73,7 +73,7 @@ Signed-off-by: Johannes Berg <johannes.berg@intel.com>
/**
* ieee80211_return_txq - return a TXQ previously acquired by ieee80211_next_txq()
-@@ -6609,12 +6602,8 @@ ieee80211_schedule_txq(struct ieee80211_
+@@ -6616,12 +6609,8 @@ ieee80211_schedule_txq(struct ieee80211_
* The driver may set force=true if it has buffered packets for this TXQ
* internally.
*/
@@ -227,7 +227,7 @@ Signed-off-by: Johannes Berg <johannes.berg@intel.com>
#ifdef CONFIG_PM
static ssize_t reset_write(struct file *file, const char __user *user_buf,
size_t count, loff_t *ppos)
-@@ -624,7 +664,11 @@ void debugfs_hw_add(struct ieee80211_loc
+@@ -631,7 +671,11 @@ void debugfs_hw_add(struct ieee80211_loc
if (local->ops->wake_tx_queue)
DEBUGFS_ADD_MODE(aqm, 0600);
@@ -355,7 +355,7 @@ Signed-off-by: Johannes Berg <johannes.berg@intel.com>
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
-@@ -846,20 +846,16 @@ enum txq_info_flags {
+@@ -835,20 +835,16 @@ enum txq_info_flags {
* @def_flow: used as a fallback flow when a packet destined to @tin hashes to
* a fq_flow which is already owned by a different tin
* @def_cvars: codel vars for @def_flow
@@ -378,7 +378,7 @@ Signed-off-by: Johannes Berg <johannes.berg@intel.com>
unsigned long flags;
/* keep last! */
-@@ -938,6 +934,8 @@ struct ieee80211_sub_if_data {
+@@ -925,6 +921,8 @@ struct ieee80211_sub_if_data {
struct ieee80211_tx_queue_params tx_conf[IEEE80211_NUM_ACS];
struct mac80211_qos_map __rcu *qos_map;
@@ -387,7 +387,7 @@ Signed-off-by: Johannes Berg <johannes.berg@intel.com>
struct work_struct csa_finalize_work;
bool csa_block_tx; /* write-protected by sdata_lock and local->mtx */
struct cfg80211_chan_def csa_chandef;
-@@ -1150,6 +1148,44 @@ enum mac80211_scan_state {
+@@ -1137,6 +1135,44 @@ enum mac80211_scan_state {
SCAN_ABORT,
};
@@ -432,7 +432,7 @@ Signed-off-by: Johannes Berg <johannes.berg@intel.com>
DECLARE_STATIC_KEY_FALSE(aql_disable);
struct ieee80211_local {
-@@ -1163,13 +1199,8 @@ struct ieee80211_local {
+@@ -1150,13 +1186,8 @@ struct ieee80211_local {
struct codel_params cparams;
/* protects active_txqs and txqi->schedule_order */
@@ -447,7 +447,7 @@ Signed-off-by: Johannes Berg <johannes.berg@intel.com>
u32 aql_threshold;
atomic_t aql_total_pending_airtime;
-@@ -1587,6 +1618,125 @@ static inline bool txq_has_queue(struct
+@@ -1574,6 +1605,125 @@ static inline bool txq_has_queue(struct
return !(skb_queue_empty(&txqi->frags) && !txqi->tin.backlog_packets);
}
@@ -573,7 +573,7 @@ Signed-off-by: Johannes Berg <johannes.berg@intel.com>
static inline int ieee80211_bssid_match(const u8 *raddr, const u8 *addr)
{
return ether_addr_equal(raddr, addr) ||
-@@ -1827,6 +1977,14 @@ int ieee80211_tx_control_port(struct wip
+@@ -1814,6 +1964,14 @@ int ieee80211_tx_control_port(struct wip
u64 *cookie);
int ieee80211_probe_mesh_link(struct wiphy *wiphy, struct net_device *dev,
const u8 *buf, size_t len);
@@ -590,7 +590,7 @@ Signed-off-by: Johannes Berg <johannes.berg@intel.com>
void ieee80211_apply_htcap_overrides(struct ieee80211_sub_if_data *sdata,
--- a/net/mac80211/iface.c
+++ b/net/mac80211/iface.c
-@@ -2013,6 +2013,9 @@ int ieee80211_if_add(struct ieee80211_lo
+@@ -2018,6 +2018,9 @@ int ieee80211_if_add(struct ieee80211_lo
}
}
@@ -602,7 +602,7 @@ Signed-off-by: Johannes Berg <johannes.berg@intel.com>
sdata->ap_power_level = IEEE80211_UNSET_POWER_LEVEL;
--- a/net/mac80211/main.c
+++ b/net/mac80211/main.c
-@@ -691,10 +691,13 @@ struct ieee80211_hw *ieee80211_alloc_hw_
+@@ -698,10 +698,13 @@ struct ieee80211_hw *ieee80211_alloc_hw_
spin_lock_init(&local->queue_stop_reason_lock);
for (i = 0; i < IEEE80211_NUM_ACS; i++) {
@@ -638,7 +638,7 @@ Signed-off-by: Johannes Berg <johannes.berg@intel.com>
set_bit(tid, &sta->txq_buffered_tids);
--- a/net/mac80211/sta_info.c
+++ b/net/mac80211/sta_info.c
-@@ -424,15 +424,11 @@ struct sta_info *sta_info_alloc(struct i
+@@ -426,15 +426,11 @@ struct sta_info *sta_info_alloc(struct i
if (sta_prepare_rate_control(local, sta, gfp))
goto free_txq;
@@ -655,7 +655,7 @@ Signed-off-by: Johannes Berg <johannes.berg@intel.com>
}
for (i = 0; i < IEEE80211_NUM_TIDS; i++)
-@@ -1894,24 +1890,59 @@ void ieee80211_sta_set_buffered(struct i
+@@ -1893,24 +1889,59 @@ void ieee80211_sta_set_buffered(struct i
}
EXPORT_SYMBOL(ieee80211_sta_set_buffered);
@@ -727,7 +727,7 @@ Signed-off-by: Johannes Berg <johannes.berg@intel.com>
}
EXPORT_SYMBOL(ieee80211_sta_register_airtime);
-@@ -2360,7 +2391,7 @@ void sta_set_sinfo(struct sta_info *sta,
+@@ -2354,7 +2385,7 @@ void sta_set_sinfo(struct sta_info *sta,
}
if (!(sinfo->filled & BIT_ULL(NL80211_STA_INFO_AIRTIME_WEIGHT))) {
@@ -765,7 +765,7 @@ Signed-off-by: Johannes Berg <johannes.berg@intel.com>
struct sta_info;
-@@ -487,7 +494,6 @@ struct ieee80211_sta_rx_stats {
+@@ -515,7 +522,6 @@ struct ieee80211_fragment_cache {
* @tid_seq: per-TID sequence numbers for sending to this STA
* @airtime: per-AC struct airtime_info describing airtime statistics for this
* station
@@ -773,7 +773,7 @@ Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* @ampdu_mlme: A-MPDU state machine state
* @mesh: mesh STA information
* @debugfs_dir: debug filesystem directory dentry
-@@ -617,7 +623,6 @@ struct sta_info {
+@@ -646,7 +652,6 @@ struct sta_info {
u16 tid_seq[IEEE80211_QOS_CTL_TID_MASK + 1];
struct airtime_info airtime[IEEE80211_NUM_ACS];
@@ -839,7 +839,7 @@ Signed-off-by: Johannes Berg <johannes.berg@intel.com>
}
void ieee80211_txq_set_params(struct ieee80211_local *local)
-@@ -3768,102 +3767,259 @@ EXPORT_SYMBOL(ieee80211_tx_dequeue);
+@@ -3801,102 +3800,259 @@ EXPORT_SYMBOL(ieee80211_tx_dequeue);
struct ieee80211_txq *ieee80211_next_txq(struct ieee80211_hw *hw, u8 ac)
{
struct ieee80211_local *local = hw_to_local(hw);
@@ -999,7 +999,7 @@ Signed-off-by: Johannes Berg <johannes.berg@intel.com>
+{
+ struct airtime_info *air_info, *tmp;
+ u64 weight_sum = 0;
-
++
+ if (unlikely(!now))
+ now = ktime_get_boottime_ns();
+
@@ -1008,8 +1008,7 @@ Signed-off-by: Johannes Berg <johannes.berg@intel.com>
+ if (!force && (air_sched->last_weight_update <
+ now - AIRTIME_ACTIVE_DURATION))
+ return;
-
-- if (txqi->schedule_round == local->schedule_round[ac])
++
+ list_for_each_entry_safe(air_info, tmp,
+ &air_sched->active_list, list) {
+ if (airtime_is_active(air_info, now))
@@ -1020,7 +1019,7 @@ Signed-off-by: Johannes Berg <johannes.berg@intel.com>
+ airtime_weight_sum_set(air_sched, weight_sum);
+ air_sched->last_weight_update = now;
+}
-+
+
+void ieee80211_schedule_txq(struct ieee80211_hw *hw,
+ struct ieee80211_txq *txq)
+ __acquires(txq_lock) __releases(txq_lock)
@@ -1032,7 +1031,8 @@ Signed-off-by: Johannes Berg <johannes.berg@intel.com>
+ struct airtime_info *air_info;
+ u8 ac = txq->ac;
+ bool was_active;
-+
+
+- if (txqi->schedule_round == local->schedule_round[ac])
+ air_sched = &local->airtime[ac];
+ air_info = to_airtime_info(txq);
+
@@ -1161,7 +1161,7 @@ Signed-off-by: Johannes Berg <johannes.berg@intel.com>
struct ieee80211_local *local = hw_to_local(hw);
if (!wiphy_ext_feature_isset(local->hw.wiphy, NL80211_EXT_FEATURE_AQL))
-@@ -3878,15 +4034,12 @@ bool ieee80211_txq_airtime_check(struct
+@@ -3911,15 +4067,12 @@ bool ieee80211_txq_airtime_check(struct
if (unlikely(txq->tid == IEEE80211_NUM_TIDS))
return true;
@@ -1179,7 +1179,7 @@ Signed-off-by: Johannes Berg <johannes.berg@intel.com>
return true;
return false;
-@@ -3896,60 +4049,59 @@ EXPORT_SYMBOL(ieee80211_txq_airtime_chec
+@@ -3929,60 +4082,59 @@ EXPORT_SYMBOL(ieee80211_txq_airtime_chec
bool ieee80211_txq_may_transmit(struct ieee80211_hw *hw,
struct ieee80211_txq *txq)
{
@@ -1200,11 +1200,11 @@ Signed-off-by: Johannes Berg <johannes.berg@intel.com>
- goto out;
+ if (!ieee80211_txq_airtime_check(hw, txq))
+ return false;
-
-- if (list_empty(&txqi->schedule_order))
++
+ air_sched = &local->airtime[txq->ac];
+ spin_lock_bh(&air_sched->lock);
-+
+
+- if (list_empty(&txqi->schedule_order))
+ if (RB_EMPTY_NODE(&txqi->schedule_order))
goto out;
@@ -1223,7 +1223,6 @@ Signed-off-by: Johannes Berg <johannes.berg@intel.com>
- if (sta->airtime[ac].deficit < 0)
- sta->airtime[ac].deficit += sta->airtime_weight;
- list_move_tail(&iter->schedule_order, &local->active_txqs[ac]);
-- }
+ /* Like in ieee80211_next_txq(), make sure the first station in the
+ * scheduling order is eligible for transmission to avoid starvation.
+ */
@@ -1232,14 +1231,15 @@ Signed-off-by: Johannes Berg <johannes.berg@intel.com>
+ first_txqi = container_of(node, struct txq_info,
+ schedule_order);
+ air_info = to_airtime_info(&first_txqi->txq);
++
++ if (air_sched->v_t < air_info->v_t)
++ airtime_catchup_v_t(air_sched, air_info->v_t, now);
+ }
- sta = container_of(txqi->txq.sta, struct sta_info, sta);
- if (sta->airtime[ac].deficit >= 0)
- goto out;
-+ if (air_sched->v_t < air_info->v_t)
-+ airtime_catchup_v_t(air_sched, air_info->v_t, now);
-+ }
-
+-
- sta->airtime[ac].deficit += sta->airtime_weight;
- list_move_tail(&txqi->schedule_order, &local->active_txqs[ac]);
- spin_unlock_bh(&local->active_txq_lock[ac]);