Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <periyasa@codeaurora.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/1612410960-9120-1-git-send-email-periyasa@codeaurora.org

authored by

Karthikeyan Periyasamy and committed by
Kalle Valo
4b965be5 7df28718

+20 -5
+1
drivers/net/wireless/ath/ath11k/core.h
··· 200 200 u32 beacon_interval; 201 201 u32 dtim_period; 202 202 u16 ast_hash; 203 + u16 ast_idx; 203 204 u16 tcl_metadata; 204 205 u8 hal_addr_search_flags; 205 206 u8 search_type;
+6 -2
drivers/net/wireless/ath/ath11k/dp_rx.c
··· 1652 1652 u8 mac_addr[ETH_ALEN]; 1653 1653 u16 peer_mac_h16; 1654 1654 u16 ast_hash; 1655 + u16 hw_peer_id; 1655 1656 1656 1657 ath11k_dbg(ab, ATH11K_DBG_DP_HTT, "dp_htt rx msg type :0x%0x\n", type); 1657 1658 ··· 1673 1672 resp->peer_map_ev.info1); 1674 1673 ath11k_dp_get_mac_addr(resp->peer_map_ev.mac_addr_l32, 1675 1674 peer_mac_h16, mac_addr); 1676 - ath11k_peer_map_event(ab, vdev_id, peer_id, mac_addr, 0); 1675 + ath11k_peer_map_event(ab, vdev_id, peer_id, mac_addr, 0, 0); 1677 1676 break; 1678 1677 case HTT_T2H_MSG_TYPE_PEER_MAP2: 1679 1678 vdev_id = FIELD_GET(HTT_T2H_PEER_MAP_INFO_VDEV_ID, ··· 1686 1685 peer_mac_h16, mac_addr); 1687 1686 ast_hash = FIELD_GET(HTT_T2H_PEER_MAP_INFO2_AST_HASH_VAL, 1688 1687 resp->peer_map_ev.info2); 1689 - ath11k_peer_map_event(ab, vdev_id, peer_id, mac_addr, ast_hash); 1688 + hw_peer_id = FIELD_GET(HTT_T2H_PEER_MAP_INFO1_HW_PEER_ID, 1689 + resp->peer_map_ev.info1); 1690 + ath11k_peer_map_event(ab, vdev_id, peer_id, mac_addr, ast_hash, 1691 + hw_peer_id); 1690 1692 break; 1691 1693 case HTT_T2H_MSG_TYPE_PEER_UNMAP: 1692 1694 case HTT_T2H_MSG_TYPE_PEER_UNMAP2:
+1
drivers/net/wireless/ath/ath11k/dp_tx.c
··· 165 165 ti.pkt_offset = 0; 166 166 ti.lmac_id = ar->lmac_id; 167 167 ti.bss_ast_hash = arvif->ast_hash; 168 + ti.bss_ast_idx = arvif->ast_idx; 168 169 ti.dscp_tid_tbl_idx = 0; 169 170 170 171 if (skb->ip_summed == CHECKSUM_PARTIAL &&
+2
drivers/net/wireless/ath/ath11k/hal_tx.c
··· 71 71 tcl_cmd->info3 = FIELD_PREP(HAL_TCL_DATA_CMD_INFO3_DSCP_TID_TABLE_IDX, 72 72 ti->dscp_tid_tbl_idx) | 73 73 FIELD_PREP(HAL_TCL_DATA_CMD_INFO3_SEARCH_INDEX, 74 + ti->bss_ast_idx) | 75 + FIELD_PREP(HAL_TCL_DATA_CMD_INFO3_CACHE_SET_NUM, 74 76 ti->bss_ast_hash); 75 77 tcl_cmd->info4 = 0; 76 78 }
+1
drivers/net/wireless/ath/ath11k/hal_tx.h
··· 29 29 u32 flags1; /* %HAL_TCL_DATA_CMD_INFO2_ */ 30 30 u16 addr_search_flags; /* %HAL_TCL_DATA_CMD_INFO0_ADDR(X/Y)_ */ 31 31 u16 bss_ast_hash; 32 + u16 bss_ast_idx; 32 33 u8 tid; 33 34 u8 search_type; /* %HAL_TX_ADDR_SEARCH_ */ 34 35 u8 lmac_id;
+7 -2
drivers/net/wireless/ath/ath11k/peer.c
··· 118 118 } 119 119 120 120 void ath11k_peer_map_event(struct ath11k_base *ab, u8 vdev_id, u16 peer_id, 121 - u8 *mac_addr, u16 ast_hash) 121 + u8 *mac_addr, u16 ast_hash, u16 hw_peer_id) 122 122 { 123 123 struct ath11k_peer *peer; 124 124 ··· 132 132 peer->vdev_id = vdev_id; 133 133 peer->peer_id = peer_id; 134 134 peer->ast_hash = ast_hash; 135 + peer->hw_peer_id = hw_peer_id; 135 136 ether_addr_copy(peer->addr, mac_addr); 136 137 list_add(&peer->list, &ab->peers); 137 138 wake_up(&ab->peer_mapping_wq); ··· 310 309 311 310 peer->pdev_idx = ar->pdev_idx; 312 311 peer->sta = sta; 313 - arvif->ast_hash = peer->ast_hash; 312 + 313 + if (arvif->vif->type == NL80211_IFTYPE_STATION) { 314 + arvif->ast_hash = peer->ast_hash; 315 + arvif->ast_idx = peer->hw_peer_id; 316 + } 314 317 315 318 peer->sec_type = HAL_ENCRYPT_TYPE_OPEN; 316 319 peer->sec_type_grp = HAL_ENCRYPT_TYPE_OPEN;
+2 -1
drivers/net/wireless/ath/ath11k/peer.h
··· 14 14 int peer_id; 15 15 u16 ast_hash; 16 16 u8 pdev_idx; 17 + u16 hw_peer_id; 17 18 18 19 /* protected by ab->data_lock */ 19 20 struct ieee80211_key_conf *keys[WMI_MAX_KEY_INDEX + 1]; ··· 32 31 33 32 void ath11k_peer_unmap_event(struct ath11k_base *ab, u16 peer_id); 34 33 void ath11k_peer_map_event(struct ath11k_base *ab, u8 vdev_id, u16 peer_id, 35 - u8 *mac_addr, u16 ast_hash); 34 + u8 *mac_addr, u16 ast_hash, u16 hw_peer_id); 36 35 struct ath11k_peer *ath11k_peer_find(struct ath11k_base *ab, int vdev_id, 37 36 const u8 *addr); 38 37 struct ath11k_peer *ath11k_peer_find_by_addr(struct ath11k_base *ab,