OSDN Git Service

Revert "mt76: use IEEE80211_OFFLOAD_ENCAP_ENABLED instead of MT_DRV_AMSDU_OFFLOAD"
authorBen Greear <greearb@candelatech.com>
Sat, 1 Oct 2022 14:19:20 +0000 (07:19 -0700)
committerFelix Fietkau <nbd@nbd.name>
Thu, 1 Dec 2022 16:29:12 +0000 (17:29 +0100)
This reverts commit f17f4864504d754bcbf31e4c89412cdf9946c409 and adds the
MT_DRV_AMSDU_OFFLOAD flag for MT7921 USB/SDIO

The reverted commit significantly decreases performance when running
a test where two MT7915 radios have 16 station vdevs each, configured
for AC mode, and transmitting UDP traffic to AP.

Co-developed-by: Felix Fietkau <nbd@nbd.name>
Reported-by: Carson Vandegriffe <carson.vandegriffe@candelatech.com>
Signed-off-by: Ben Greear <greearb@candelatech.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
drivers/net/wireless/mediatek/mt76/mac80211.c
drivers/net/wireless/mediatek/mt76/mt76.h
drivers/net/wireless/mediatek/mt76/mt7915/mmio.c
drivers/net/wireless/mediatek/mt76/mt7921/pci.c
drivers/net/wireless/mediatek/mt76/mt7921/sdio.c
drivers/net/wireless/mediatek/mt76/mt7921/usb.c

index 6de13d6..4bdbfd0 100644 (file)
@@ -443,8 +443,12 @@ mt76_phy_init(struct mt76_phy *phy, struct ieee80211_hw *hw)
        ieee80211_hw_set(hw, SUPPORTS_CLONED_SKBS);
        ieee80211_hw_set(hw, SUPPORTS_AMSDU_IN_AMPDU);
        ieee80211_hw_set(hw, SUPPORTS_REORDERING_BUFFER);
-       ieee80211_hw_set(hw, TX_AMSDU);
-       ieee80211_hw_set(hw, TX_FRAG_LIST);
+
+       if (!(dev->drv->drv_flags & MT_DRV_AMSDU_OFFLOAD)) {
+               ieee80211_hw_set(hw, TX_AMSDU);
+               ieee80211_hw_set(hw, TX_FRAG_LIST);
+       }
+
        ieee80211_hw_set(hw, MFP_CAPABLE);
        ieee80211_hw_set(hw, AP_LINK_PS);
        ieee80211_hw_set(hw, REPORTS_TX_ACK_STATUS);
index 26febc0..f9bdf16 100644 (file)
@@ -415,6 +415,7 @@ struct mt76_hw_cap {
 #define MT_DRV_SW_RX_AIRTIME           BIT(2)
 #define MT_DRV_RX_DMA_HDR              BIT(3)
 #define MT_DRV_HW_MGMT_TXQ             BIT(4)
+#define MT_DRV_AMSDU_OFFLOAD           BIT(5)
 
 struct mt76_driver_ops {
        u32 drv_flags;
index 2ffb509..be1b8ea 100644 (file)
@@ -781,7 +781,8 @@ struct mt7915_dev *mt7915_mmio_probe(struct device *pdev,
        static const struct mt76_driver_ops drv_ops = {
                /* txwi_size = txd size + txp size */
                .txwi_size = MT_TXD_SIZE + sizeof(struct mt76_connac_fw_txp),
-               .drv_flags = MT_DRV_TXWI_NO_FREE | MT_DRV_HW_MGMT_TXQ,
+               .drv_flags = MT_DRV_TXWI_NO_FREE | MT_DRV_HW_MGMT_TXQ |
+                            MT_DRV_AMSDU_OFFLOAD,
                .survey_flags = SURVEY_INFO_TIME_TX |
                                SURVEY_INFO_TIME_RX |
                                SURVEY_INFO_TIME_BSS_RX,
index 8a53d8f..b38d119 100644 (file)
@@ -228,7 +228,8 @@ static int mt7921_pci_probe(struct pci_dev *pdev,
        static const struct mt76_driver_ops drv_ops = {
                /* txwi_size = txd size + txp size */
                .txwi_size = MT_TXD_SIZE + sizeof(struct mt76_connac_hw_txp),
-               .drv_flags = MT_DRV_TXWI_NO_FREE | MT_DRV_HW_MGMT_TXQ,
+               .drv_flags = MT_DRV_TXWI_NO_FREE | MT_DRV_HW_MGMT_TXQ |
+                            MT_DRV_AMSDU_OFFLOAD,
                .survey_flags = SURVEY_INFO_TIME_TX |
                                SURVEY_INFO_TIME_RX |
                                SURVEY_INFO_TIME_BSS_RX,
index 3b25a06..377ca5f 100644 (file)
@@ -89,6 +89,7 @@ static int mt7921s_probe(struct sdio_func *func,
 {
        static const struct mt76_driver_ops drv_ops = {
                .txwi_size = MT_SDIO_TXD_SIZE,
+               .drv_flags = MT_DRV_AMSDU_OFFLOAD,
                .survey_flags = SURVEY_INFO_TIME_TX |
                                SURVEY_INFO_TIME_RX |
                                SURVEY_INFO_TIME_BSS_RX,
index 29c0ee3..89249f0 100644 (file)
@@ -170,7 +170,8 @@ static int mt7921u_probe(struct usb_interface *usb_intf,
 {
        static const struct mt76_driver_ops drv_ops = {
                .txwi_size = MT_SDIO_TXD_SIZE,
-               .drv_flags = MT_DRV_RX_DMA_HDR | MT_DRV_HW_MGMT_TXQ,
+               .drv_flags = MT_DRV_RX_DMA_HDR | MT_DRV_HW_MGMT_TXQ |
+                            MT_DRV_AMSDU_OFFLOAD,
                .survey_flags = SURVEY_INFO_TIME_TX |
                                SURVEY_INFO_TIME_RX |
                                SURVEY_INFO_TIME_BSS_RX,