mirror of
https://github.com/outbackdingo/mt76.git
synced 2026-10-24 13:26:48 +00:00
mt76: avoid extra RCU synchronization on station removal
Use sta_pre_rcu_remove callback to clear wcid pointer earlier Signed-off-by: Felix Fietkau <[email protected]>
This commit is contained in:
+13
-3
@@ -983,9 +983,6 @@ void __mt76_sta_remove(struct mt76_dev *dev, struct ieee80211_vif *vif,
|
||||
struct mt76_wcid *wcid = (struct mt76_wcid *)sta->drv_priv;
|
||||
int i, idx = wcid->idx;
|
||||
|
||||
rcu_assign_pointer(dev->wcid[idx], NULL);
|
||||
synchronize_rcu();
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(wcid->aggr); i++)
|
||||
mt76_rx_aggr_stop(dev, wcid, i);
|
||||
|
||||
@@ -1035,6 +1032,19 @@ int mt76_sta_state(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(mt76_sta_state);
|
||||
|
||||
void mt76_sta_pre_rcu_remove(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
|
||||
struct ieee80211_sta *sta)
|
||||
{
|
||||
struct mt76_phy *phy = hw->priv;
|
||||
struct mt76_dev *dev = phy->dev;
|
||||
struct mt76_wcid *wcid = (struct mt76_wcid *)sta->drv_priv;
|
||||
|
||||
mutex_lock(&dev->mutex);
|
||||
rcu_assign_pointer(dev->wcid[wcid->idx], NULL);
|
||||
mutex_unlock(&dev->mutex);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(mt76_sta_pre_rcu_remove);
|
||||
|
||||
int mt76_get_txpower(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
|
||||
int *dbm)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user