Commit 2bffdded authored by Felix Fietkau's avatar Felix Fietkau

mt76: remove retry_q from struct mt76_txq and related code

Since the switch to using AQL by default, mtxq->retry_q is never filled anymore
Remove it to get rid of a few more unnecessary cycles in the tx path
Signed-off-by: default avatarFelix Fietkau <nbd@nbd.name>
parent dd57a95c
...@@ -879,7 +879,6 @@ mt76_check_sta(struct mt76_dev *dev, struct sk_buff *skb) ...@@ -879,7 +879,6 @@ mt76_check_sta(struct mt76_dev *dev, struct sk_buff *skb)
struct ieee80211_hw *hw; struct ieee80211_hw *hw;
struct mt76_wcid *wcid = status->wcid; struct mt76_wcid *wcid = status->wcid;
bool ps; bool ps;
int i;
hw = mt76_phy_hw(dev, status->ext_phy); hw = mt76_phy_hw(dev, status->ext_phy);
if (ieee80211_is_pspoll(hdr->frame_control) && !wcid) { if (ieee80211_is_pspoll(hdr->frame_control) && !wcid) {
...@@ -929,20 +928,6 @@ mt76_check_sta(struct mt76_dev *dev, struct sk_buff *skb) ...@@ -929,20 +928,6 @@ mt76_check_sta(struct mt76_dev *dev, struct sk_buff *skb)
dev->drv->sta_ps(dev, sta, ps); dev->drv->sta_ps(dev, sta, ps);
ieee80211_sta_ps_transition(sta, ps); ieee80211_sta_ps_transition(sta, ps);
if (ps)
return;
for (i = 0; i < ARRAY_SIZE(sta->txq); i++) {
struct mt76_txq *mtxq;
if (!sta->txq[i])
continue;
mtxq = (struct mt76_txq *)sta->txq[i]->drv_priv;
if (!skb_queue_empty(&mtxq->retry_q))
ieee80211_schedule_txq(hw, sta->txq[i]);
}
} }
void mt76_rx_complete(struct mt76_dev *dev, struct sk_buff_head *frames, void mt76_rx_complete(struct mt76_dev *dev, struct sk_buff_head *frames,
...@@ -1004,8 +989,6 @@ mt76_sta_add(struct mt76_dev *dev, struct ieee80211_vif *vif, ...@@ -1004,8 +989,6 @@ mt76_sta_add(struct mt76_dev *dev, struct ieee80211_vif *vif,
mtxq = (struct mt76_txq *)sta->txq[i]->drv_priv; mtxq = (struct mt76_txq *)sta->txq[i]->drv_priv;
mtxq->wcid = wcid; mtxq->wcid = wcid;
mt76_txq_init(dev, sta->txq[i]);
} }
ewma_signal_init(&wcid->rssi); ewma_signal_init(&wcid->rssi);
...@@ -1033,8 +1016,6 @@ void __mt76_sta_remove(struct mt76_dev *dev, struct ieee80211_vif *vif, ...@@ -1033,8 +1016,6 @@ void __mt76_sta_remove(struct mt76_dev *dev, struct ieee80211_vif *vif,
dev->drv->sta_remove(dev, vif, sta); dev->drv->sta_remove(dev, vif, sta);
mt76_tx_status_check(dev, wcid, true); mt76_tx_status_check(dev, wcid, true);
for (i = 0; i < ARRAY_SIZE(sta->txq); i++)
mt76_txq_remove(dev, sta->txq[i]);
mt76_wcid_mask_clear(dev->wcid_mask, idx); mt76_wcid_mask_clear(dev->wcid_mask, idx);
mt76_wcid_mask_clear(dev->wcid_phy_mask, idx); mt76_wcid_mask_clear(dev->wcid_phy_mask, idx);
} }
......
...@@ -226,11 +226,8 @@ struct mt76_wcid { ...@@ -226,11 +226,8 @@ struct mt76_wcid {
}; };
struct mt76_txq { struct mt76_txq {
struct mt76_queue *q;
struct mt76_wcid *wcid; struct mt76_wcid *wcid;
struct sk_buff_head retry_q;
u16 agg_ssn; u16 agg_ssn;
bool send_bar; bool send_bar;
bool aggr; bool aggr;
...@@ -900,8 +897,6 @@ static inline bool mt76_testmode_enabled(struct mt76_dev *dev) ...@@ -900,8 +897,6 @@ static inline bool mt76_testmode_enabled(struct mt76_dev *dev)
void mt76_rx(struct mt76_dev *dev, enum mt76_rxq_id q, struct sk_buff *skb); void mt76_rx(struct mt76_dev *dev, enum mt76_rxq_id q, struct sk_buff *skb);
void mt76_tx(struct mt76_phy *dev, struct ieee80211_sta *sta, void mt76_tx(struct mt76_phy *dev, struct ieee80211_sta *sta,
struct mt76_wcid *wcid, struct sk_buff *skb); struct mt76_wcid *wcid, struct sk_buff *skb);
void mt76_txq_init(struct mt76_dev *dev, struct ieee80211_txq *txq);
void mt76_txq_remove(struct mt76_dev *dev, struct ieee80211_txq *txq);
void mt76_wake_tx_queue(struct ieee80211_hw *hw, struct ieee80211_txq *txq); void mt76_wake_tx_queue(struct ieee80211_hw *hw, struct ieee80211_txq *txq);
void mt76_stop_tx_queues(struct mt76_dev *dev, struct ieee80211_sta *sta, void mt76_stop_tx_queues(struct mt76_dev *dev, struct ieee80211_sta *sta,
bool send_bar); bool send_bar);
......
...@@ -75,7 +75,6 @@ mt7603_add_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif) ...@@ -75,7 +75,6 @@ mt7603_add_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif)
mtxq = (struct mt76_txq *)vif->txq->drv_priv; mtxq = (struct mt76_txq *)vif->txq->drv_priv;
mtxq->wcid = &mvif->sta.wcid; mtxq->wcid = &mvif->sta.wcid;
mt76_txq_init(&dev->mt76, vif->txq);
rcu_assign_pointer(dev->mt76.wcid[idx], &mvif->sta.wcid); rcu_assign_pointer(dev->mt76.wcid[idx], &mvif->sta.wcid);
out: out:
...@@ -99,7 +98,6 @@ mt7603_remove_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif) ...@@ -99,7 +98,6 @@ mt7603_remove_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif)
mt7603_beacon_set_timer(dev, mvif->idx, 0); mt7603_beacon_set_timer(dev, mvif->idx, 0);
rcu_assign_pointer(dev->mt76.wcid[idx], NULL); rcu_assign_pointer(dev->mt76.wcid[idx], NULL);
mt76_txq_remove(&dev->mt76, vif->txq);
spin_lock_bh(&dev->sta_poll_lock); spin_lock_bh(&dev->sta_poll_lock);
if (!list_empty(&msta->poll_list)) if (!list_empty(&msta->poll_list))
......
...@@ -205,7 +205,6 @@ static int mt7615_add_interface(struct ieee80211_hw *hw, ...@@ -205,7 +205,6 @@ static int mt7615_add_interface(struct ieee80211_hw *hw,
if (vif->txq) { if (vif->txq) {
mtxq = (struct mt76_txq *)vif->txq->drv_priv; mtxq = (struct mt76_txq *)vif->txq->drv_priv;
mtxq->wcid = &mvif->sta.wcid; mtxq->wcid = &mvif->sta.wcid;
mt76_txq_init(&dev->mt76, vif->txq);
} }
ret = mt7615_mcu_add_dev_info(dev, vif, true); ret = mt7615_mcu_add_dev_info(dev, vif, true);
...@@ -256,8 +255,6 @@ static void mt7615_remove_interface(struct ieee80211_hw *hw, ...@@ -256,8 +255,6 @@ static void mt7615_remove_interface(struct ieee80211_hw *hw,
mt7615_mcu_add_dev_info(dev, vif, false); mt7615_mcu_add_dev_info(dev, vif, false);
rcu_assign_pointer(dev->mt76.wcid[idx], NULL); rcu_assign_pointer(dev->mt76.wcid[idx], NULL);
if (vif->txq)
mt76_txq_remove(&dev->mt76, vif->txq);
dev->mphy.vif_mask &= ~BIT(mvif->idx); dev->mphy.vif_mask &= ~BIT(mvif->idx);
dev->omac_mask &= ~BIT(mvif->omac_idx); dev->omac_mask &= ~BIT(mvif->omac_idx);
......
...@@ -294,8 +294,6 @@ mt76x02_vif_init(struct mt76x02_dev *dev, struct ieee80211_vif *vif, ...@@ -294,8 +294,6 @@ mt76x02_vif_init(struct mt76x02_dev *dev, struct ieee80211_vif *vif,
mvif->group_wcid.hw_key_idx = -1; mvif->group_wcid.hw_key_idx = -1;
mtxq = (struct mt76_txq *)vif->txq->drv_priv; mtxq = (struct mt76_txq *)vif->txq->drv_priv;
mtxq->wcid = &mvif->group_wcid; mtxq->wcid = &mvif->group_wcid;
mt76_txq_init(&dev->mt76, vif->txq);
} }
int int
...@@ -347,7 +345,6 @@ void mt76x02_remove_interface(struct ieee80211_hw *hw, ...@@ -347,7 +345,6 @@ void mt76x02_remove_interface(struct ieee80211_hw *hw,
struct mt76x02_dev *dev = hw->priv; struct mt76x02_dev *dev = hw->priv;
struct mt76x02_vif *mvif = (struct mt76x02_vif *)vif->drv_priv; struct mt76x02_vif *mvif = (struct mt76x02_vif *)vif->drv_priv;
mt76_txq_remove(&dev->mt76, vif->txq);
dev->mphy.vif_mask &= ~BIT(mvif->idx); dev->mphy.vif_mask &= ~BIT(mvif->idx);
} }
EXPORT_SYMBOL_GPL(mt76x02_remove_interface); EXPORT_SYMBOL_GPL(mt76x02_remove_interface);
......
...@@ -169,7 +169,6 @@ static int mt7915_add_interface(struct ieee80211_hw *hw, ...@@ -169,7 +169,6 @@ static int mt7915_add_interface(struct ieee80211_hw *hw,
if (vif->txq) { if (vif->txq) {
mtxq = (struct mt76_txq *)vif->txq->drv_priv; mtxq = (struct mt76_txq *)vif->txq->drv_priv;
mtxq->wcid = &mvif->sta.wcid; mtxq->wcid = &mvif->sta.wcid;
mt76_txq_init(&dev->mt76, vif->txq);
} }
out: out:
...@@ -192,8 +191,6 @@ static void mt7915_remove_interface(struct ieee80211_hw *hw, ...@@ -192,8 +191,6 @@ static void mt7915_remove_interface(struct ieee80211_hw *hw,
mt7915_mcu_add_dev_info(dev, vif, false); mt7915_mcu_add_dev_info(dev, vif, false);
rcu_assign_pointer(dev->mt76.wcid[idx], NULL); rcu_assign_pointer(dev->mt76.wcid[idx], NULL);
if (vif->txq)
mt76_txq_remove(&dev->mt76, vif->txq);
mutex_lock(&dev->mt76.mutex); mutex_lock(&dev->mt76.mutex);
phy->mt76->vif_mask &= ~BIT(mvif->idx); phy->mt76->vif_mask &= ~BIT(mvif->idx);
......
...@@ -301,23 +301,13 @@ mt76_tx(struct mt76_phy *phy, struct ieee80211_sta *sta, ...@@ -301,23 +301,13 @@ mt76_tx(struct mt76_phy *phy, struct ieee80211_sta *sta,
EXPORT_SYMBOL_GPL(mt76_tx); EXPORT_SYMBOL_GPL(mt76_tx);
static struct sk_buff * static struct sk_buff *
mt76_txq_dequeue(struct mt76_phy *phy, struct mt76_txq *mtxq, bool ps) mt76_txq_dequeue(struct mt76_phy *phy, struct mt76_txq *mtxq)
{ {
struct ieee80211_txq *txq = mtxq_to_txq(mtxq); struct ieee80211_txq *txq = mtxq_to_txq(mtxq);
struct ieee80211_tx_info *info; struct ieee80211_tx_info *info;
bool ext_phy = phy != &phy->dev->phy; bool ext_phy = phy != &phy->dev->phy;
struct sk_buff *skb; struct sk_buff *skb;
skb = skb_dequeue(&mtxq->retry_q);
if (skb) {
u8 tid = skb->priority & IEEE80211_QOS_CTL_TID_MASK;
if (ps && skb_queue_empty(&mtxq->retry_q))
ieee80211_sta_set_buffered(txq->sta, tid, false);
return skb;
}
skb = ieee80211_tx_dequeue(phy->hw, txq); skb = ieee80211_tx_dequeue(phy->hw, txq);
if (!skb) if (!skb)
return NULL; return NULL;
...@@ -367,7 +357,7 @@ mt76_release_buffered_frames(struct ieee80211_hw *hw, struct ieee80211_sta *sta, ...@@ -367,7 +357,7 @@ mt76_release_buffered_frames(struct ieee80211_hw *hw, struct ieee80211_sta *sta,
continue; continue;
do { do {
skb = mt76_txq_dequeue(phy, mtxq, true); skb = mt76_txq_dequeue(phy, mtxq);
if (!skb) if (!skb)
break; break;
...@@ -410,7 +400,7 @@ mt76_txq_send_burst(struct mt76_phy *phy, struct mt76_queue *q, ...@@ -410,7 +400,7 @@ mt76_txq_send_burst(struct mt76_phy *phy, struct mt76_queue *q,
if (atomic_read(&wcid->non_aql_packets) >= MT_MAX_NON_AQL_PKT) if (atomic_read(&wcid->non_aql_packets) >= MT_MAX_NON_AQL_PKT)
return 0; return 0;
skb = mt76_txq_dequeue(phy, mtxq, false); skb = mt76_txq_dequeue(phy, mtxq);
if (!skb) if (!skb)
return 0; return 0;
...@@ -434,7 +424,7 @@ mt76_txq_send_burst(struct mt76_phy *phy, struct mt76_queue *q, ...@@ -434,7 +424,7 @@ mt76_txq_send_burst(struct mt76_phy *phy, struct mt76_queue *q,
if (q->queued + MT_TXQ_FREE_THR >= q->ndesc) if (q->queued + MT_TXQ_FREE_THR >= q->ndesc)
break; break;
skb = mt76_txq_dequeue(phy, mtxq, false); skb = mt76_txq_dequeue(phy, mtxq);
if (!skb) if (!skb)
break; break;
...@@ -499,8 +489,7 @@ mt76_txq_schedule_list(struct mt76_phy *phy, enum mt76_txq_id qid) ...@@ -499,8 +489,7 @@ mt76_txq_schedule_list(struct mt76_phy *phy, enum mt76_txq_id qid)
} }
ret += mt76_txq_send_burst(phy, q, mtxq); ret += mt76_txq_send_burst(phy, q, mtxq);
ieee80211_return_txq(phy->hw, txq, ieee80211_return_txq(phy->hw, txq, false);
!skb_queue_empty(&mtxq->retry_q));
} }
spin_unlock_bh(&q->lock); spin_unlock_bh(&q->lock);
...@@ -562,8 +551,8 @@ void mt76_stop_tx_queues(struct mt76_dev *dev, struct ieee80211_sta *sta, ...@@ -562,8 +551,8 @@ void mt76_stop_tx_queues(struct mt76_dev *dev, struct ieee80211_sta *sta,
if (!txq) if (!txq)
continue; continue;
hwq = dev->q_tx[mt76_txq_get_qid(txq)];
mtxq = (struct mt76_txq *)txq->drv_priv; mtxq = (struct mt76_txq *)txq->drv_priv;
hwq = mtxq->q;
spin_lock_bh(&hwq->lock); spin_lock_bh(&hwq->lock);
mtxq->send_bar = mtxq->aggr && send_bar; mtxq->send_bar = mtxq->aggr && send_bar;
...@@ -584,34 +573,6 @@ void mt76_wake_tx_queue(struct ieee80211_hw *hw, struct ieee80211_txq *txq) ...@@ -584,34 +573,6 @@ void mt76_wake_tx_queue(struct ieee80211_hw *hw, struct ieee80211_txq *txq)
} }
EXPORT_SYMBOL_GPL(mt76_wake_tx_queue); EXPORT_SYMBOL_GPL(mt76_wake_tx_queue);
void mt76_txq_remove(struct mt76_dev *dev, struct ieee80211_txq *txq)
{
struct ieee80211_hw *hw;
struct mt76_txq *mtxq;
struct sk_buff *skb;
if (!txq)
return;
mtxq = (struct mt76_txq *)txq->drv_priv;
while ((skb = skb_dequeue(&mtxq->retry_q)) != NULL) {
hw = mt76_tx_status_get_hw(dev, skb);
ieee80211_free_txskb(hw, skb);
}
}
EXPORT_SYMBOL_GPL(mt76_txq_remove);
void mt76_txq_init(struct mt76_dev *dev, struct ieee80211_txq *txq)
{
struct mt76_txq *mtxq = (struct mt76_txq *)txq->drv_priv;
skb_queue_head_init(&mtxq->retry_q);
mtxq->q = dev->q_tx[mt76_txq_get_qid(txq)];
}
EXPORT_SYMBOL_GPL(mt76_txq_init);
u8 mt76_ac_to_hwq(u8 ac) u8 mt76_ac_to_hwq(u8 ac)
{ {
static const u8 wmm_queue_map[] = { static const u8 wmm_queue_map[] = {
......
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