mt76: do not use skb_set_queue_mapping for internal purposes
authorFelix Fietkau <nbd@nbd.name>
Sat, 2 Jul 2022 13:56:23 +0000 (15:56 +0200)
committerFelix Fietkau <nbd@nbd.name>
Mon, 11 Jul 2022 11:40:03 +0000 (13:40 +0200)
Previously the code used skb_set_queue_mapping for management or non-bufferable
powersave frames that need to be sent to a different hardware queue.
This can confuse AQL, which expects the value to remain the same until the tx
status report.
The only place that currently uses the altered skb queue mapping is the txwi
write function. Change the code to pass the hardware queue id as a function
parameter instead.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
14 files changed:
drivers/net/wireless/mediatek/mt76/mt7615/mac.c
drivers/net/wireless/mediatek/mt76/mt7615/mcu.c
drivers/net/wireless/mediatek/mt76/mt7615/mt7615.h
drivers/net/wireless/mediatek/mt76/mt7615/pci_mac.c
drivers/net/wireless/mediatek/mt76/mt7615/usb_sdio.c
drivers/net/wireless/mediatek/mt76/mt76_connac.h
drivers/net/wireless/mediatek/mt76/mt76_connac_mac.c
drivers/net/wireless/mediatek/mt76/mt7915/mac.c
drivers/net/wireless/mediatek/mt76/mt7915/mcu.c
drivers/net/wireless/mediatek/mt76/mt7915/mt7915.h
drivers/net/wireless/mediatek/mt76/mt7921/mac.c
drivers/net/wireless/mediatek/mt76/mt7921/mcu.c
drivers/net/wireless/mediatek/mt76/mt7921/pci_mac.c
drivers/net/wireless/mediatek/mt76/tx.c

index 038774b3ced07bd09da6e4dbc7611ea96ab10c20..372862768bb4c023a2edcb89a4022582967af213 100644 (file)
@@ -717,7 +717,8 @@ mt7615_mac_tx_rate_val(struct mt7615_dev *dev,
 int mt7615_mac_write_txwi(struct mt7615_dev *dev, __le32 *txwi,
                          struct sk_buff *skb, struct mt76_wcid *wcid,
                          struct ieee80211_sta *sta, int pid,
-                         struct ieee80211_key_conf *key, bool beacon)
+                         struct ieee80211_key_conf *key,
+                         enum mt76_txq_id qid, bool beacon)
 {
        struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
        u8 fc_type, fc_stype, p_fmt, q_idx, omac_idx = 0, wmm_idx = 0;
@@ -755,7 +756,7 @@ int mt7615_mac_write_txwi(struct mt7615_dev *dev, __le32 *txwi,
        if (beacon) {
                p_fmt = MT_TX_TYPE_FW;
                q_idx = ext_phy ? MT_LMAC_BCN1 : MT_LMAC_BCN0;
-       } else if (skb_get_queue_mapping(skb) >= MT_TXQ_PSD) {
+       } else if (qid >= MT_TXQ_PSD) {
                p_fmt = is_mmio ? MT_TX_TYPE_CT : MT_TX_TYPE_SF;
                q_idx = ext_phy ? MT_LMAC_ALTX1 : MT_LMAC_ALTX0;
        } else {
index 3d35381013f1785af4cd68cac25d9fbb89f03089..e8b1be818c300d3b8cf890ead5c6b5d9318ec28d 100644 (file)
@@ -714,7 +714,7 @@ mt7615_mcu_add_beacon_offload(struct mt7615_dev *dev,
        }
 
        mt7615_mac_write_txwi(dev, (__le32 *)(req.pkt), skb, wcid, NULL,
-                             0, NULL, true);
+                             0, NULL, 0, true);
        memcpy(req.pkt + MT_TXD_SIZE, skb->data, skb->len);
        req.pkt_len = cpu_to_le16(MT_TXD_SIZE + skb->len);
        req.tim_ie_pos = cpu_to_le16(MT_TXD_SIZE + offs.tim_offset);
@@ -1086,7 +1086,7 @@ mt7615_mcu_uni_add_beacon_offload(struct mt7615_dev *dev,
        }
 
        mt7615_mac_write_txwi(dev, (__le32 *)(req.beacon_tlv.pkt), skb,
-                             wcid, NULL, 0, NULL, true);
+                             wcid, NULL, 0, NULL, 0, true);
        memcpy(req.beacon_tlv.pkt + MT_TXD_SIZE, skb->data, skb->len);
        req.beacon_tlv.pkt_len = cpu_to_le16(MT_TXD_SIZE + skb->len);
        req.beacon_tlv.tim_ie_pos = cpu_to_le16(MT_TXD_SIZE + offs.tim_offset);
index 93a9e8f46193ab123c1005273f0dd94f1eda3fd6..25880d1a50da1c06e8b2ff370754a54fd1873518 100644 (file)
@@ -477,7 +477,8 @@ void mt7615_mac_sta_poll(struct mt7615_dev *dev);
 int mt7615_mac_write_txwi(struct mt7615_dev *dev, __le32 *txwi,
                          struct sk_buff *skb, struct mt76_wcid *wcid,
                          struct ieee80211_sta *sta, int pid,
-                         struct ieee80211_key_conf *key, bool beacon);
+                         struct ieee80211_key_conf *key,
+                         enum mt76_txq_id qid, bool beacon);
 void mt7615_mac_set_timing(struct mt7615_phy *phy);
 int __mt7615_mac_wtbl_set_key(struct mt7615_dev *dev,
                              struct mt76_wcid *wcid,
index 05b6669466bad59d116c89dce7539af7144de0f6..26211c63dac4d0c00e47548f9b6935573ce090d9 100644 (file)
@@ -96,7 +96,7 @@ int mt7615_tx_prepare_skb(struct mt76_dev *mdev, void *txwi_ptr,
 
        pid = mt76_tx_status_skb_add(mdev, wcid, tx_info->skb);
        mt7615_mac_write_txwi(dev, txwi_ptr, tx_info->skb, wcid, sta,
-                             pid, key, false);
+                             pid, key, qid, false);
 
        txp = txwi + MT_TXD_SIZE;
        memset(txp, 0, sizeof(struct mt76_connac_txp_common));
index 5a6d7829c6e04f7fd9c101e62fbc047d75486b6b..0052d103e276a895e3eddb81edb4397e0149281b 100644 (file)
@@ -49,7 +49,7 @@ mt7663_usb_sdio_write_txwi(struct mt7615_dev *dev, struct mt76_wcid *wcid,
        __le32 *txwi = (__le32 *)(skb->data - MT_USB_TXD_SIZE);
 
        memset(txwi, 0, MT_USB_TXD_SIZE);
-       mt7615_mac_write_txwi(dev, txwi, skb, wcid, sta, pid, key, false);
+       mt7615_mac_write_txwi(dev, txwi, skb, wcid, sta, pid, key, qid, false);
        skb_push(skb, MT_USB_TXD_SIZE);
 }
 
index 1d32d55ba5873057f65270fafcba43a3d39ec0f3..9070162c68699e1f38ac1584e0875a6cebde5a87 100644 (file)
@@ -339,7 +339,7 @@ void mt76_connac_pm_dequeue_skbs(struct mt76_phy *phy,
 void mt76_connac2_mac_write_txwi(struct mt76_dev *dev, __le32 *txwi,
                                 struct sk_buff *skb, struct mt76_wcid *wcid,
                                 struct ieee80211_key_conf *key, int pid,
-                                u32 changed);
+                                enum mt76_txq_id qid, u32 changed);
 bool mt76_connac2_mac_add_txs_skb(struct mt76_dev *dev, struct mt76_wcid *wcid,
                                  int pid, __le32 *txs_data,
                                  struct mt76_sta_stats *stats);
index af2b33d738ca214c05995764fc10507e571d01a2..3ab0dcde7351cac8f9f7710e7d598f1830ea32be 100644 (file)
@@ -436,7 +436,7 @@ mt76_connac2_mac_write_txwi_80211(struct mt76_dev *dev, __le32 *txwi,
 void mt76_connac2_mac_write_txwi(struct mt76_dev *dev, __le32 *txwi,
                                 struct sk_buff *skb, struct mt76_wcid *wcid,
                                 struct ieee80211_key_conf *key, int pid,
-                                u32 changed)
+                                enum mt76_txq_id qid, u32 changed)
 {
        struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
        bool ext_phy = info->hw_queue & MT_TX_HW_QUEUE_EXT_PHY;
@@ -467,7 +467,7 @@ void mt76_connac2_mac_write_txwi(struct mt76_dev *dev, __le32 *txwi,
        } else if (beacon) {
                p_fmt = MT_TX_TYPE_FW;
                q_idx = MT_LMAC_BCN0;
-       } else if (skb_get_queue_mapping(skb) >= MT_TXQ_PSD) {
+       } else if (qid >= MT_TXQ_PSD) {
                p_fmt = mt76_is_mmio(dev) ? MT_TX_TYPE_CT : MT_TX_TYPE_SF;
                q_idx = MT_LMAC_ALTX0;
        } else {
index f696c20dc6e3d6d291be4b267709b74a5871d69e..757b4e1c3164d4d4000d8987171c302beed12044 100644 (file)
@@ -662,7 +662,8 @@ mt7915_mac_write_txwi_tm(struct mt7915_phy *phy, __le32 *txwi,
 
 void mt7915_mac_write_txwi(struct mt76_dev *dev, __le32 *txwi,
                           struct sk_buff *skb, struct mt76_wcid *wcid, int pid,
-                          struct ieee80211_key_conf *key, u32 changed)
+                          struct ieee80211_key_conf *key,
+                          enum mt76_txq_id qid, u32 changed)
 {
        struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
        struct mt76_phy *mphy = &dev->phy;
@@ -670,7 +671,7 @@ void mt7915_mac_write_txwi(struct mt76_dev *dev, __le32 *txwi,
        if ((info->hw_queue & MT_TX_HW_QUEUE_EXT_PHY) && dev->phy2)
                mphy = dev->phy2;
 
-       mt76_connac2_mac_write_txwi(dev, txwi, skb, wcid, key, pid, changed);
+       mt76_connac2_mac_write_txwi(dev, txwi, skb, wcid, key, pid, qid, changed);
 
        if (mt76_testmode_enabled(mphy))
                mt7915_mac_write_txwi_tm(mphy->priv, txwi, skb);
@@ -717,7 +718,8 @@ int mt7915_tx_prepare_skb(struct mt76_dev *mdev, void *txwi_ptr,
                return id;
 
        pid = mt76_tx_status_skb_add(mdev, wcid, tx_info->skb);
-       mt7915_mac_write_txwi(mdev, txwi_ptr, tx_info->skb, wcid, pid, key, 0);
+       mt7915_mac_write_txwi(mdev, txwi_ptr, tx_info->skb, wcid, pid, key,
+                             qid, 0);
 
        txp = (struct mt76_connac_fw_txp *)(txwi + MT_TXD_SIZE);
        for (i = 0; i < nbuf; i++) {
index 18fb205e26fbab99aa32ed1d4f86224b57ef9642..4a841bcead0ee157345aefbbd20cf1dc83483469 100644 (file)
@@ -1812,7 +1812,7 @@ mt7915_mcu_beacon_cont(struct mt7915_dev *dev, struct ieee80211_vif *vif,
 
        buf = (u8 *)tlv + sizeof(*cont);
        mt7915_mac_write_txwi(&dev->mt76, (__le32 *)buf, skb, wcid, 0, NULL,
-                             BSS_CHANGED_BEACON);
+                             0, BSS_CHANGED_BEACON);
        memcpy(buf + MT_TXD_SIZE, skb->data, skb->len);
 }
 
@@ -1957,7 +1957,7 @@ mt7915_mcu_beacon_inband_discov(struct mt7915_dev *dev, struct ieee80211_vif *vi
        buf = (u8 *)tlv + sizeof(*discov);
 
        mt7915_mac_write_txwi(&dev->mt76, (__le32 *)buf, skb, wcid, 0, NULL,
-                             changed);
+                             0, changed);
        memcpy(buf + MT_TXD_SIZE, skb->data, skb->len);
 
        dev_kfree_skb(skb);
index b6a6aa7fcf438d242e6f68875a8e2230833b9a33..db63012e8aa9eb38fc0174668ca42154c20e2db4 100644 (file)
@@ -551,7 +551,8 @@ void mt7915_mac_cca_stats_reset(struct mt7915_phy *phy);
 void mt7915_mac_enable_nf(struct mt7915_dev *dev, bool ext_phy);
 void mt7915_mac_write_txwi(struct mt76_dev *dev, __le32 *txwi,
                           struct sk_buff *skb, struct mt76_wcid *wcid, int pid,
-                          struct ieee80211_key_conf *key, u32 changed);
+                          struct ieee80211_key_conf *key,
+                          enum mt76_txq_id qid, u32 changed);
 void mt7915_mac_set_timing(struct mt7915_phy *phy);
 int mt7915_mac_sta_add(struct mt76_dev *mdev, struct ieee80211_vif *vif,
                       struct ieee80211_sta *sta);
index eb1bfb682e02491a00fe291d50e1bb01b8773559..49b7f0debc78961db0713115a2e813b47b74e78f 100644 (file)
@@ -999,7 +999,7 @@ mt7921_usb_sdio_write_txwi(struct mt7921_dev *dev, struct mt76_wcid *wcid,
        __le32 *txwi = (__le32 *)(skb->data - MT_SDIO_TXD_SIZE);
 
        memset(txwi, 0, MT_SDIO_TXD_SIZE);
-       mt76_connac2_mac_write_txwi(&dev->mt76, txwi, skb, wcid, key, pid, 0);
+       mt76_connac2_mac_write_txwi(&dev->mt76, txwi, skb, wcid, key, pid, qid, 0);
        skb_push(skb, MT_SDIO_TXD_SIZE);
 }
 
index 1b62135bdc8f75451cdcb41e2df5d5df9c4ad066..c232319d2071d49389aa834074a773c003dfa693 100644 (file)
@@ -919,7 +919,7 @@ mt7921_mcu_uni_add_beacon_offload(struct mt7921_dev *dev,
        }
 
        mt76_connac2_mac_write_txwi(&dev->mt76, (__le32 *)(req.beacon_tlv.pkt),
-                                   skb, wcid, NULL, 0, BSS_CHANGED_BEACON);
+                                   skb, wcid, NULL, 0, 0, BSS_CHANGED_BEACON);
        memcpy(req.beacon_tlv.pkt + MT_TXD_SIZE, skb->data, skb->len);
        req.beacon_tlv.pkt_len = cpu_to_le16(MT_TXD_SIZE + skb->len);
        req.beacon_tlv.tim_ie_pos = cpu_to_le16(MT_TXD_SIZE + offs.tim_offset);
index f6c605a59b81ff4569f096975ae010ca94b09c60..e1800674089ac9ddb388aa281f4209dfc6da7f7f 100644 (file)
@@ -42,7 +42,7 @@ int mt7921e_tx_prepare_skb(struct mt76_dev *mdev, void *txwi_ptr,
 
        pid = mt76_tx_status_skb_add(mdev, wcid, tx_info->skb);
        mt76_connac2_mac_write_txwi(mdev, txwi_ptr, tx_info->skb, wcid, key,
-                                   pid, 0);
+                                   pid, qid, 0);
 
        txp = (struct mt76_connac_hw_txp *)(txwi + MT_TXD_SIZE);
        memset(txp, 0, sizeof(struct mt76_connac_hw_txp));
index e1d5996c4675afc7a9b6f68176ea69c0213d4ac7..13c5e78dd39dd224244f58f09ded6d42c5338821 100644 (file)
@@ -327,7 +327,6 @@ mt76_tx(struct mt76_phy *phy, struct ieee80211_sta *sta,
            !ieee80211_is_data(hdr->frame_control) &&
            !ieee80211_is_bufferable_mmpdu(hdr->frame_control)) {
                qid = MT_TXQ_PSD;
-               skb_set_queue_mapping(skb, qid);
        }
 
        if (wcid && !(wcid->tx_info & MT_WCID_TX_INFO_SET))