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.
  • Loading branch information
qosmio committed Mar 9, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent 93fb35c commit 497a916
Showing 51 changed files with 2,945 additions and 236 deletions.
2 changes: 1 addition & 1 deletion package/kernel/mac80211/Makefile
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@ include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=mac80211

PKG_VERSION:=6.6.15
PKG_RELEASE:=1
PKG_RELEASE:=2
PKG_SOURCE_URL:=http://mirror2.openwrt.org/sources/
PKG_HASH:=3bbc461121134fda9089c084a5eed577d05e7837a157edf9a3797937172a3ece

1 change: 0 additions & 1 deletion package/kernel/mac80211/ath.mk
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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,
@@ -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,
@@ -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,
@@ -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,
@@ -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,
@@ -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,
Original file line number Diff line number Diff line change
@@ -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;

@@ -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;
}

@@ -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);
@@ -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;
@@ -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);
@@ -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);

@@ -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;
@@ -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);

@@ -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;
}

@@ -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;
}

Original file line number Diff line number Diff line change
@@ -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 &&
@@ -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;

@@ -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);
@@ -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);
@@ -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);

@@ -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;

Original file line number Diff line number Diff line change
@@ -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,
};

@@ -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;
}
Loading

0 comments on commit 497a916

Please sign in to comment.