Skip to content

Commit

Permalink
ath11k_nss: Introduce skbuff_recycle for performance
Browse files Browse the repository at this point in the history
QSDK NSS builds utilize skbuff recycling for better handling of memory.

On a Dynalink DL-WRX36 (pbuf script should be set to 'auto') a significant drop in
memory usage was observed as well consistent sustained RX/TX speeds.

BEFORE:
echo 3 >! /proc/sys/vm/drop_caches

free -m
               total        used        free      shared  buff/cache   available
Mem:             867         338         547          90         101         528
Swap:              0           0           0

AFTER:
               total        used        free      shared  buff/cache   available
Mem:             867         242         594           1          81         624
Swap:              0           0           0

NOTE:

For 512MB platforms, users need to test with the following scenarios,
as the patch `999-233-ath11k-Disable-rx_header-tlv-for-2K-SKB.patch` is
really only testable on platforms with 512M or less RAM.

1.) Explicitly setting 'ATH11K_MEM_PROFILE_512M' on and see if system
    crashes on boot.

2.) Explicitly setting 'ATH11K_MEM_PROFILE_1G'

3.) Remove patches
    999-233-ath11k-Disable-rx_header-tlv-for-2K-SKB.patch
    999-311-ath11k-configure-nss-thread-priority-during-pdev_ini.patch

    And re-test with #1 and #2

It was incorrectly assumed that setting a 512M for 1G platforms would save
memory, instead it needs to be explicitly set to know proper memory
regions, otherwise it would cause fw crash.

ath11k_nss: fix typo in 512M memory profile

ath11k_nss: remove SFE patch 718-e-mac80211-Deliver-the-frame-to-driver-tx-ops-directly

It is not relevant to NSS builds and only meant for SFE.

ath11k_nss: remove unecessary patches

Color collision should be left on by default, as it's a primary feature
of 802.11AX.

ath11k_nss: fix spacing

ath11k_nss: Remove unnecessary TKIP bloat

Remove TKIP patches that are not being used as 99% of folks are running
modern encryption (AES-CCMP,SAE,etc).

ath11k_nss: parameterize DP_RXDMA_REFILL_RING_SIZE memory profile

ath11k_nss: Remove SFE related code

Cleanup SFE (shortcut fe) related code as we're not using it on NSS

ath11k_nss: idr, ampdu, and skb headroom check optimizations

ath11k_nss: get valid last_rate for rx_bitrate from cpu stats

ath11k_nss: Fix BCCA counter for EMA

Currently BCCA counter is updated to FW via csa counter offs and
beacon with new countdown is updated for every beacon tx completion event.
For EMA, all EMA beacons are updated in one shot, and counter update for
every tx event will mess up the actual sequence of countdown sent over the air.

Allow FW to update the countdown till 1 and finalize the color
change.

ath11k_nss: Fix compile for TRACE feature
  • Loading branch information
qosmio committed Jun 10, 2024
1 parent d8dce85 commit a55099e
Show file tree
Hide file tree
Showing 47 changed files with 2,547 additions and 521 deletions.
1 change: 0 additions & 1 deletion package/kernel/mac80211/ath.mk
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ config-$(CONFIG_ATH11K_NSS_SUPPORT) += ATH11K_NSS_SUPPORT
config-$(CONFIG_ATH11K_NSS_MESH_SUPPORT) += ATH11K_NSS_MESH_SUPPORT
config-$(CONFIG_ATH11K_DEBUGFS_STA) += ATH11K_DEBUGFS_STA
config-$(CONFIG_ATH11K_DEBUGFS_HTT_STATS) += ATH11K_DEBUGFS_HTT_STATS
config-$(CONFIG_ATH11K_NSS_MESH_SUPPORT) += ATH11K_NSS_MESH_SUPPORT

config-$(call config_package,ath9k-htc) += ATH9K_HTC
config-$(call config_package,ath10k,regular) += ATH10K ATH10K_PCI
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -245,15 +245,7 @@ Signed-off-by: Ramya Gnanasekar <rgnanase@codeaurora.org>
.num_vdevs = 16 + 1,
.num_peers = 512,
.supports_suspend = false,
@@ -210,6 +213,7 @@ static struct ath11k_hw_params ath11k_hw
.tx_ring_size = DP_TCL_DATA_RING_SIZE,
.smp2p_wow_exit = false,
.support_fw_mac_sequence = false,
+ .num_vdevs_peers = ath11k_vdevs_peers,
},
{
.name = "qca6390 hw2.0",
@@ -259,7 +263,7 @@ static struct ath11k_hw_params ath11k_hw
@@ -259,7 +262,7 @@ static struct ath11k_hw_params ath11k_hw
.coldboot_cal_mm = false,
.coldboot_cal_ftm = false,
.cbcal_restart_fw = false,
Expand All @@ -262,7 +254,7 @@ Signed-off-by: Ramya Gnanasekar <rgnanase@codeaurora.org>
.num_vdevs = 16 + 1,
.num_peers = 512,
.supports_suspend = true,
@@ -426,7 +430,7 @@ static struct ath11k_hw_params ath11k_hw
@@ -426,7 +429,7 @@ static struct ath11k_hw_params ath11k_hw
.coldboot_cal_mm = false,
.coldboot_cal_ftm = false,
.cbcal_restart_fw = false,
Expand All @@ -271,15 +263,15 @@ Signed-off-by: Ramya Gnanasekar <rgnanase@codeaurora.org>
.num_vdevs = 16 + 1,
.num_peers = 512,
.supports_suspend = true,
@@ -462,6 +466,7 @@ static struct ath11k_hw_params ath11k_hw
@@ -462,6 +465,7 @@ static struct ath11k_hw_params ath11k_hw
.tx_ring_size = DP_TCL_DATA_RING_SIZE,
.smp2p_wow_exit = false,
.support_fw_mac_sequence = true,
+ .num_vdevs_peers = ath11k_vdevs_peers,
},
{
.name = "wcn6855 hw2.1",
@@ -509,7 +514,7 @@ static struct ath11k_hw_params ath11k_hw
@@ -509,7 +513,7 @@ static struct ath11k_hw_params ath11k_hw
.coldboot_cal_mm = false,
.coldboot_cal_ftm = false,
.cbcal_restart_fw = false,
Expand All @@ -288,15 +280,15 @@ Signed-off-by: Ramya Gnanasekar <rgnanase@codeaurora.org>
.num_vdevs = 16 + 1,
.num_peers = 512,
.supports_suspend = true,
@@ -545,6 +550,7 @@ static struct ath11k_hw_params ath11k_hw
@@ -545,6 +549,7 @@ static struct ath11k_hw_params ath11k_hw
.tx_ring_size = DP_TCL_DATA_RING_SIZE,
.smp2p_wow_exit = false,
.support_fw_mac_sequence = true,
+ .num_vdevs_peers = ath11k_vdevs_peers,
},
{
.name = "wcn6750 hw1.0",
@@ -593,7 +599,7 @@ static struct ath11k_hw_params ath11k_hw
@@ -593,7 +598,7 @@ static struct ath11k_hw_params ath11k_hw
.coldboot_cal_mm = true,
.coldboot_cal_ftm = true,
.cbcal_restart_fw = false,
Expand All @@ -305,15 +297,7 @@ Signed-off-by: Ramya Gnanasekar <rgnanase@codeaurora.org>
.num_vdevs = 16 + 1,
.num_peers = 512,
.supports_suspend = false,
@@ -626,6 +632,7 @@ static struct ath11k_hw_params ath11k_hw
.tx_ring_size = DP_TCL_DATA_RING_SIZE_WCN6750,
.smp2p_wow_exit = true,
.support_fw_mac_sequence = true,
+ .num_vdevs_peers = ath11k_vdevs_peers,
},
{
.hw_rev = ATH11K_HW_IPQ5018_HW10,
@@ -672,7 +679,7 @@ static struct ath11k_hw_params ath11k_hw
@@ -672,7 +677,7 @@ static struct ath11k_hw_params ath11k_hw
.supports_monitor = false,
.supports_sta_ps = false,
.supports_shadow_regs = false,
Expand All @@ -322,7 +306,7 @@ Signed-off-by: Ramya Gnanasekar <rgnanase@codeaurora.org>
.num_vdevs = 16 + 1,
.num_peers = 512,
.supports_regdb = false,
@@ -707,6 +714,22 @@ static struct ath11k_hw_params ath11k_hw
@@ -707,6 +712,22 @@ static struct ath11k_hw_params ath11k_hw
.tx_ring_size = DP_TCL_DATA_RING_SIZE,
.smp2p_wow_exit = false,
.support_fw_mac_sequence = false,
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ Signed-off-by: Sathishkumar Muruganandam <murugana@codeaurora.org>
ieee80211_queue_work(ar->hw, &arsta->set_4addr_wk);
arsta->use_4addr_set = true;
}
@@ -6647,6 +6771,9 @@ static int ath11k_mac_op_update_vif_offl
@@ -6646,6 +6770,9 @@ static int ath11k_mac_op_update_vif_offl
u32 param_id, param_value;
int ret;

Expand All @@ -224,7 +224,7 @@ Signed-off-by: Sathishkumar Muruganandam <murugana@codeaurora.org>
param_id = WMI_VDEV_PARAM_TX_ENCAP_TYPE;
if (ath11k_frame_mode != ATH11K_HW_TXRX_ETHERNET ||
(vif->type != NL80211_IFTYPE_STATION &&
@@ -6867,7 +6994,8 @@ static int ath11k_mac_op_add_interface(s
@@ -6866,7 +6993,8 @@ static int ath11k_mac_op_add_interface(s
goto err;
}

Expand All @@ -234,7 +234,7 @@ Signed-off-by: Sathishkumar Muruganandam <murugana@codeaurora.org>
ath11k_warn(ab, "failed to create vdev %u, reached max vdev limit %d\n",
ar->num_created_vdevs, TARGET_NUM_VDEVS(ab));
ret = -EBUSY;
@@ -6887,6 +7015,28 @@ static int ath11k_mac_op_add_interface(s
@@ -6886,6 +7014,28 @@ static int ath11k_mac_op_add_interface(s
arvif->vif = vif;

INIT_LIST_HEAD(&arvif->list);
Expand Down Expand Up @@ -263,15 +263,15 @@ Signed-off-by: Sathishkumar Muruganandam <murugana@codeaurora.org>
INIT_DELAYED_WORK(&arvif->connection_loss_work,
ath11k_mac_vif_sta_connection_loss_work);

@@ -6916,6 +7066,7 @@ static int ath11k_mac_op_add_interface(s
@@ -6915,6 +7065,7 @@ static int ath11k_mac_op_add_interface(s
fallthrough;
case NL80211_IFTYPE_AP:
arvif->vdev_type = WMI_VDEV_TYPE_AP;
+ INIT_LIST_HEAD(&arvif->ap_vlan_arvifs);
break;
case NL80211_IFTYPE_MONITOR:
arvif->vdev_type = WMI_VDEV_TYPE_MONITOR;
@@ -7138,13 +7289,30 @@ static void ath11k_mac_op_remove_interfa
@@ -7137,13 +7288,30 @@ static void ath11k_mac_op_remove_interfa
struct ath11k *ar = hw->priv;
struct ath11k_vif *arvif = ath11k_vif_to_arvif(vif);
struct ath11k_base *ab = ar->ab;
Expand Down Expand Up @@ -304,7 +304,7 @@ Signed-off-by: Sathishkumar Muruganandam <murugana@codeaurora.org>
ath11k_dbg(ab, ATH11K_DBG_MAC, "remove interface (vdev %d)\n",
arvif->vdev_id);

@@ -7161,6 +7329,14 @@ static void ath11k_mac_op_remove_interfa
@@ -7160,6 +7328,14 @@ static void ath11k_mac_op_remove_interfa
if (ret)
ath11k_warn(ab, "failed to submit AP self-peer removal on vdev %d: %d\n",
arvif->vdev_id, ret);
Expand All @@ -319,7 +319,7 @@ Signed-off-by: Sathishkumar Muruganandam <murugana@codeaurora.org>
}

ret = ath11k_mac_vdev_delete(ar, arvif);
@@ -7204,8 +7380,7 @@ err_vdev_del:
@@ -7203,8 +7379,7 @@ err_vdev_del:

ath11k_debugfs_remove_interface(arvif);

Expand All @@ -329,7 +329,7 @@ Signed-off-by: Sathishkumar Muruganandam <murugana@codeaurora.org>
mutex_unlock(&ar->conf_mutex);
}

@@ -7265,16 +7440,17 @@ static int ath11k_mac_op_ampdu_action(st
@@ -7264,16 +7439,17 @@ static int ath11k_mac_op_ampdu_action(st
struct ieee80211_ampdu_params *params)
{
struct ath11k *ar = hw->priv;
Expand All @@ -349,15 +349,15 @@ Signed-off-by: Sathishkumar Muruganandam <murugana@codeaurora.org>
break;
case IEEE80211_AMPDU_TX_START:
case IEEE80211_AMPDU_TX_STOP_CONT:
@@ -8797,6 +8973,7 @@ static void ath11k_mac_op_sta_statistics
@@ -8796,6 +8972,7 @@ static void ath11k_mac_op_sta_statistics
{
struct ath11k_sta *arsta = ath11k_sta_to_arsta(sta);
struct ath11k *ar = arsta->arvif->ar;
+ struct ath11k_vif *arvif = ath11k_vif_to_arvif(vif);
s8 signal;
bool db2dbm = test_bit(WMI_TLV_SERVICE_HW_DB2DBM_CONVERSION_SUPPORT,
ar->ab->wmi_ab.svc_map);
@@ -8853,7 +9030,8 @@ static void ath11k_mac_op_sta_statistics
@@ -8852,7 +9029,8 @@ static void ath11k_mac_op_sta_statistics
ATH11K_DEFAULT_NOISE_FLOOR;
sinfo->filled |= BIT_ULL(NL80211_STA_INFO_SIGNAL_AVG);

Expand All @@ -380,7 +380,7 @@ Signed-off-by: Sathishkumar Muruganandam <murugana@codeaurora.org>
WMI_STA_PS_PARAM_TX_WAKE_THRESHOLD = 1,
--- a/drivers/net/wireless/ath/ath11k/dp_rx.c
+++ b/drivers/net/wireless/ath/ath11k/dp_rx.c
@@ -1156,12 +1156,13 @@ err_mem_free:
@@ -1121,12 +1121,13 @@ err_mem_free:
return ret;
}

Expand All @@ -396,7 +396,7 @@ Signed-off-by: Sathishkumar Muruganandam <murugana@codeaurora.org>
int ret;

ret = ath11k_peer_rx_tid_setup(ar, params->sta->addr, vdev_id,
@@ -1173,13 +1174,13 @@ int ath11k_dp_rx_ampdu_start(struct ath1
@@ -1138,13 +1139,13 @@ int ath11k_dp_rx_ampdu_start(struct ath1
return ret;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ Signed-off-by: Sathishkumar Muruganandam <murugana@codeaurora.org>
}
} else if (old_state == IEEE80211_STA_AUTHORIZED &&
new_state == IEEE80211_STA_ASSOC) {
@@ -7019,7 +7248,7 @@ static int ath11k_mac_op_add_interface(s
@@ -7018,7 +7247,7 @@ static int ath11k_mac_op_add_interface(s
if ((vif->type == NL80211_IFTYPE_AP_VLAN ||
vif->type == NL80211_IFTYPE_STATION) && ab->nss.enabled) {
if (ath11k_frame_mode == ATH11K_HW_TXRX_ETHERNET &&
Expand All @@ -432,15 +432,15 @@ Signed-off-by: Sathishkumar Muruganandam <murugana@codeaurora.org>
vif->offload_flags |= IEEE80211_OFFLOAD_ENCAP_4ADDR;
arvif->nss.encap = ATH11K_HW_TXRX_ETHERNET;
arvif->nss.decap = ATH11K_HW_TXRX_ETHERNET;
@@ -7032,6 +7261,7 @@ static int ath11k_mac_op_add_interface(s
@@ -7031,6 +7260,7 @@ static int ath11k_mac_op_add_interface(s
vif->addr, ret);
goto err;
}
+ INIT_LIST_HEAD(&arvif->dyn_vlan_cfg);
mutex_unlock(&ar->conf_mutex);
return ret;
}
@@ -7056,6 +7286,20 @@ static int ath11k_mac_op_add_interface(s
@@ -7055,6 +7285,20 @@ static int ath11k_mac_op_add_interface(s
arvif->vdev_id = bit;
arvif->vdev_subtype = WMI_VDEV_SUBTYPE_NONE;

Expand All @@ -461,7 +461,7 @@ Signed-off-by: Sathishkumar Muruganandam <murugana@codeaurora.org>
switch (vif->type) {
case NL80211_IFTYPE_UNSPECIFIED:
case NL80211_IFTYPE_STATION:
@@ -7096,7 +7340,7 @@ static int ath11k_mac_op_add_interface(s
@@ -7095,7 +7339,7 @@ static int ath11k_mac_op_add_interface(s
if (ret) {
ath11k_warn(ab, "failed to create WMI vdev %d: %d\n",
arvif->vdev_id, ret);
Expand All @@ -470,7 +470,7 @@ Signed-off-by: Sathishkumar Muruganandam <murugana@codeaurora.org>
}

ar->num_created_vdevs++;
@@ -7255,7 +7499,7 @@ err_peer_del:
@@ -7254,7 +7498,7 @@ err_peer_del:
if (fbret) {
ath11k_warn(ar->ab, "fallback fail to delete peer addr %pM vdev_id %d ret %d\n",
vif->addr, arvif->vdev_id, fbret);
Expand All @@ -479,7 +479,7 @@ Signed-off-by: Sathishkumar Muruganandam <murugana@codeaurora.org>
}
}

@@ -7266,6 +7510,8 @@ err_vdev_del:
@@ -7265,6 +7509,8 @@ err_vdev_del:
list_del(&arvif->list);
spin_unlock_bh(&ar->data_lock);

Expand All @@ -488,15 +488,15 @@ Signed-off-by: Sathishkumar Muruganandam <murugana@codeaurora.org>
err:
mutex_unlock(&ar->conf_mutex);

@@ -7363,6 +7609,7 @@ err_vdev_del:
@@ -7362,6 +7608,7 @@ err_vdev_del:
list_del(&arvif->list);
spin_unlock_bh(&ar->data_lock);

+ kfree(arvif->vlan_keyid_map);
ath11k_peer_cleanup(ar, arvif->vdev_id);

idr_for_each(&ar->txmgmt_idr,
@@ -9961,8 +10208,11 @@ static int __ath11k_mac_register(struct
@@ -9960,8 +10207,11 @@ static int __ath11k_mac_register(struct
ab->hw_params.bios_sar_capa)
ar->hw->wiphy->sar_capa = ab->hw_params.bios_sar_capa;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
u32 max_ast_index;
u32 num_ast_entries;

+ bool stats_disable;
+ bool stats_disable;
/* must be last */
u8 drv_priv[] __aligned(sizeof(void *));
};
--- a/drivers/net/wireless/ath/ath11k/debugfs.c
+++ b/drivers/net/wireless/ath/ath11k/debugfs.c
@@ -974,6 +974,79 @@ static const struct file_operations fops
@@ -973,6 +973,79 @@ static const struct file_operations fops
.llseek = default_llseek,
};

Expand Down Expand Up @@ -90,7 +90,7 @@
int ath11k_debugfs_pdev_create(struct ath11k_base *ab)
{
if (test_bit(ATH11K_FLAG_REGISTERED, &ab->dev_flags))
@@ -1023,6 +1096,8 @@ int ath11k_debugfs_soc_create(struct ath
@@ -1022,6 +1095,8 @@ int ath11k_debugfs_soc_create(struct ath
ret = PTR_ERR(ab->debugfs_soc);
goto out;
}
Expand Down
Loading

0 comments on commit a55099e

Please sign in to comment.