From 37efc3f06957c9c7c67ed42e9f10ec112e7cd428 Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Tue, 29 Jun 2021 12:03:04 +0800 Subject: [PATCH] ath11k: Update tx descriptor search index properly --- ...-tx-descriptor-search-index-properly.patch | 151 ++++++++++++++++++ ...emove-duplicate-function-declaration.patch | 36 +++++ 2 files changed, 187 insertions(+) create mode 100644 package/kernel/mac80211/patches/ath11k/002-v5.12-ath11k-Update-tx-descriptor-search-index-properly.patch create mode 100644 package/kernel/mac80211/patches/ath11k/003-v5.12-ath11k-remove-duplicate-function-declaration.patch diff --git a/package/kernel/mac80211/patches/ath11k/002-v5.12-ath11k-Update-tx-descriptor-search-index-properly.patch b/package/kernel/mac80211/patches/ath11k/002-v5.12-ath11k-Update-tx-descriptor-search-index-properly.patch new file mode 100644 index 000000000..a6351e5c8 --- /dev/null +++ b/package/kernel/mac80211/patches/ath11k/002-v5.12-ath11k-Update-tx-descriptor-search-index-properly.patch @@ -0,0 +1,151 @@ +From 4b965be536eefdd16ca0a88120fee23f5b92cd16 Mon Sep 17 00:00:00 2001 +From: Karthikeyan Periyasamy +Date: Mon, 8 Feb 2021 13:32:11 +0200 +Subject: ath11k: Update tx descriptor search index properly + +Tx descriptor search index field should be updated with hw peer id +and not by AST Hash as per the HW/FW recommendation. Incorrect search +index causes throughput degradation in all scenario for all the +platforms. so updated the search index field with hw peer id, which +is a common change applicable for all the platforms. Also no need of these +configuration for non station type. seen 10% throughput increase in WDS +traffic with this change. + +Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.4.0.1-01492-QCAHKSWPL_SILICONZ-1 + +Signed-off-by: Karthikeyan Periyasamy +Signed-off-by: Kalle Valo +Link: https://lore.kernel.org/r/1612410960-9120-1-git-send-email-periyasa@codeaurora.org +--- + drivers/net/wireless/ath/ath11k/core.h | 1 + + drivers/net/wireless/ath/ath11k/dp_rx.c | 8 ++++++-- + drivers/net/wireless/ath/ath11k/dp_tx.c | 1 + + drivers/net/wireless/ath/ath11k/hal_tx.c | 2 ++ + drivers/net/wireless/ath/ath11k/hal_tx.h | 1 + + drivers/net/wireless/ath/ath11k/peer.c | 9 +++++++-- + drivers/net/wireless/ath/ath11k/peer.h | 3 ++- + 7 files changed, 20 insertions(+), 5 deletions(-) + +--- a/drivers/net/wireless/ath/ath11k/core.h ++++ b/drivers/net/wireless/ath/ath11k/core.h +@@ -193,6 +193,7 @@ struct ath11k_vif { + u32 beacon_interval; + u32 dtim_period; + u16 ast_hash; ++ u16 ast_idx; + u16 tcl_metadata; + u8 hal_addr_search_flags; + u8 search_type; +--- a/drivers/net/wireless/ath/ath11k/dp_rx.c ++++ b/drivers/net/wireless/ath/ath11k/dp_rx.c +@@ -1648,6 +1648,7 @@ void ath11k_dp_htt_htc_t2h_msg_handler(s + u8 mac_addr[ETH_ALEN]; + u16 peer_mac_h16; + u16 ast_hash; ++ u16 hw_peer_id; + + ath11k_dbg(ab, ATH11K_DBG_DP_HTT, "dp_htt rx msg type :0x%0x\n", type); + +@@ -1668,7 +1669,7 @@ void ath11k_dp_htt_htc_t2h_msg_handler(s + resp->peer_map_ev.info1); + ath11k_dp_get_mac_addr(resp->peer_map_ev.mac_addr_l32, + peer_mac_h16, mac_addr); +- ath11k_peer_map_event(ab, vdev_id, peer_id, mac_addr, 0); ++ ath11k_peer_map_event(ab, vdev_id, peer_id, mac_addr, 0, 0); + break; + case HTT_T2H_MSG_TYPE_PEER_MAP2: + vdev_id = FIELD_GET(HTT_T2H_PEER_MAP_INFO_VDEV_ID, +@@ -1681,7 +1682,10 @@ void ath11k_dp_htt_htc_t2h_msg_handler(s + peer_mac_h16, mac_addr); + ast_hash = FIELD_GET(HTT_T2H_PEER_MAP_INFO2_AST_HASH_VAL, + resp->peer_map_ev.info2); +- ath11k_peer_map_event(ab, vdev_id, peer_id, mac_addr, ast_hash); ++ hw_peer_id = FIELD_GET(HTT_T2H_PEER_MAP_INFO1_HW_PEER_ID, ++ resp->peer_map_ev.info1); ++ ath11k_peer_map_event(ab, vdev_id, peer_id, mac_addr, ast_hash, ++ hw_peer_id); + break; + case HTT_T2H_MSG_TYPE_PEER_UNMAP: + case HTT_T2H_MSG_TYPE_PEER_UNMAP2: +--- a/drivers/net/wireless/ath/ath11k/dp_tx.c ++++ b/drivers/net/wireless/ath/ath11k/dp_tx.c +@@ -165,6 +165,7 @@ tcl_ring_sel: + ti.pkt_offset = 0; + ti.lmac_id = ar->lmac_id; + ti.bss_ast_hash = arvif->ast_hash; ++ ti.bss_ast_idx = arvif->ast_idx; + ti.dscp_tid_tbl_idx = 0; + + if (skb->ip_summed == CHECKSUM_PARTIAL && +--- a/drivers/net/wireless/ath/ath11k/hal_tx.c ++++ b/drivers/net/wireless/ath/ath11k/hal_tx.c +@@ -71,6 +71,8 @@ void ath11k_hal_tx_cmd_desc_setup(struct + tcl_cmd->info3 = FIELD_PREP(HAL_TCL_DATA_CMD_INFO3_DSCP_TID_TABLE_IDX, + ti->dscp_tid_tbl_idx) | + FIELD_PREP(HAL_TCL_DATA_CMD_INFO3_SEARCH_INDEX, ++ ti->bss_ast_idx) | ++ FIELD_PREP(HAL_TCL_DATA_CMD_INFO3_CACHE_SET_NUM, + ti->bss_ast_hash); + tcl_cmd->info4 = 0; + } +--- a/drivers/net/wireless/ath/ath11k/hal_tx.h ++++ b/drivers/net/wireless/ath/ath11k/hal_tx.h +@@ -29,6 +29,7 @@ struct hal_tx_info { + u32 flags1; /* %HAL_TCL_DATA_CMD_INFO2_ */ + u16 addr_search_flags; /* %HAL_TCL_DATA_CMD_INFO0_ADDR(X/Y)_ */ + u16 bss_ast_hash; ++ u16 bss_ast_idx; + u8 tid; + u8 search_type; /* %HAL_TX_ADDR_SEARCH_ */ + u8 lmac_id; +--- a/drivers/net/wireless/ath/ath11k/peer.c ++++ b/drivers/net/wireless/ath/ath11k/peer.c +@@ -118,7 +118,7 @@ exit: + } + + void ath11k_peer_map_event(struct ath11k_base *ab, u8 vdev_id, u16 peer_id, +- u8 *mac_addr, u16 ast_hash) ++ u8 *mac_addr, u16 ast_hash, u16 hw_peer_id) + { + struct ath11k_peer *peer; + +@@ -132,6 +132,7 @@ void ath11k_peer_map_event(struct ath11k + peer->vdev_id = vdev_id; + peer->peer_id = peer_id; + peer->ast_hash = ast_hash; ++ peer->hw_peer_id = hw_peer_id; + ether_addr_copy(peer->addr, mac_addr); + list_add(&peer->list, &ab->peers); + wake_up(&ab->peer_mapping_wq); +@@ -309,7 +310,11 @@ int ath11k_peer_create(struct ath11k *ar + + peer->pdev_idx = ar->pdev_idx; + peer->sta = sta; +- arvif->ast_hash = peer->ast_hash; ++ ++ if (arvif->vif->type == NL80211_IFTYPE_STATION) { ++ arvif->ast_hash = peer->ast_hash; ++ arvif->ast_idx = peer->hw_peer_id; ++ } + + peer->sec_type = HAL_ENCRYPT_TYPE_OPEN; + peer->sec_type_grp = HAL_ENCRYPT_TYPE_OPEN; +--- a/drivers/net/wireless/ath/ath11k/peer.h ++++ b/drivers/net/wireless/ath/ath11k/peer.h +@@ -14,6 +14,7 @@ struct ath11k_peer { + int peer_id; + u16 ast_hash; + u8 pdev_idx; ++ u16 hw_peer_id; + + /* protected by ab->data_lock */ + struct ieee80211_key_conf *keys[WMI_MAX_KEY_INDEX + 1]; +@@ -31,7 +32,7 @@ struct ath11k_peer { + + void ath11k_peer_unmap_event(struct ath11k_base *ab, u16 peer_id); + void ath11k_peer_map_event(struct ath11k_base *ab, u8 vdev_id, u16 peer_id, +- u8 *mac_addr, u16 ast_hash); ++ u8 *mac_addr, u16 ast_hash, u16 hw_peer_id); + struct ath11k_peer *ath11k_peer_find(struct ath11k_base *ab, int vdev_id, + const u8 *addr); + struct ath11k_peer *ath11k_peer_find_by_addr(struct ath11k_base *ab, diff --git a/package/kernel/mac80211/patches/ath11k/003-v5.12-ath11k-remove-duplicate-function-declaration.patch b/package/kernel/mac80211/patches/ath11k/003-v5.12-ath11k-remove-duplicate-function-declaration.patch new file mode 100644 index 000000000..1522273e5 --- /dev/null +++ b/package/kernel/mac80211/patches/ath11k/003-v5.12-ath11k-remove-duplicate-function-declaration.patch @@ -0,0 +1,36 @@ +From cf8480d338a1b9156121e5e035e6b9721db4332a Mon Sep 17 00:00:00 2001 +From: Karthikeyan Periyasamy +Date: Mon, 11 Jan 2021 19:49:30 +0200 +Subject: ath11k: remove duplicate function declaration + +Removed the duplicated peer related function declaration +from core.h since those functions are already declared in peer.h + +Founded in code review. + +Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.4.0.1-01492-QCAHKSWPL_SILICONZ-1 + +Signed-off-by: Karthikeyan Periyasamy +Signed-off-by: Kalle Valo +Link: https://lore.kernel.org/r/1608304793-20612-1-git-send-email-periyasa@codeaurora.org +--- + drivers/net/wireless/ath/ath11k/core.h | 8 -------- + 1 file changed, 8 deletions(-) + +--- a/drivers/net/wireless/ath/ath11k/core.h ++++ b/drivers/net/wireless/ath/ath11k/core.h +@@ -868,14 +868,6 @@ extern const struct service_to_pipe ath1 + extern const struct ce_pipe_config ath11k_target_ce_config_wlan_qca6390[]; + extern const struct service_to_pipe ath11k_target_service_to_ce_map_wlan_qca6390[]; + +-void ath11k_peer_unmap_event(struct ath11k_base *ab, u16 peer_id); +-void ath11k_peer_map_event(struct ath11k_base *ab, u8 vdev_id, u16 peer_id, +- u8 *mac_addr, u16 ast_hash); +-struct ath11k_peer *ath11k_peer_find(struct ath11k_base *ab, int vdev_id, +- const u8 *addr); +-struct ath11k_peer *ath11k_peer_find_by_addr(struct ath11k_base *ab, +- const u8 *addr); +-struct ath11k_peer *ath11k_peer_find_by_id(struct ath11k_base *ab, int peer_id); + int ath11k_core_qmi_firmware_ready(struct ath11k_base *ab); + int ath11k_core_pre_init(struct ath11k_base *ab); + int ath11k_core_init(struct ath11k_base *ath11k);