ath11k: Fix htt stats sounding info and pdev cca stats
A message that is not in the archive (sent off-list or not yet received): [email protected]
PATCH 1/10 ath11k: Fix htt stats sounding info and pdev cca stats
From: Ganesh Sesetti <[email protected]>
The Previous configuartion of htt stats sounding info and pdev cca stats are invalid due to that getting time out error.
Changing htt stats sounding info value from 0xFF to 0x00 and htt pdev cca stats from 0x10 to 0x00
--- drivers/net/wireless/ath/ath11k/dp.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/wireless/ath/ath11k/dp.h +2 -2
@@ -1365,8 +1365,8 @@ struct htt_ext_stats_cfg_cmd {#define HTT_STAT_DEFAULT_CFG0_ALL_CMDQS 0xffff#define HTT_STAT_DEFAULT_CFG0_ALL_RINGS 0xffff#define HTT_STAT_DEFAULT_CFG0_ACTIVE_PEERS 0xff -#define HTT_STAT_DEFAULT_CFG0_CCA_CUMULATIVE 0x10 -#define HTT_STAT_DEFAULT_CFG0_ACTIVE_VDEVS 0xff +#define HTT_STAT_DEFAULT_CFG0_CCA_CUMULATIVE 0x00 +#define HTT_STAT_DEFAULT_CFG0_ACTIVE_VDEVS 0x00/* HTT_DBG_EXT_STATS_PEER_INFO * PARAMS:
Signature · 1 line
2.7.4
Quoted 8 lines · Kalle Valo
The Previous configuartion of htt stats sounding info and pdev cca stats are invalid due to that getting time out error.
Changing htt stats sounding info value from
0xFFto0x00and htt pdev cca stats from0x10to0x00Signed-off-by Ganesh Sesetti <[email protected]>Signed-off-by Kalle Valo <[email protected]>
10 patches applied to ath-next branch of ath.git, thanks.
86d4def890fd ath11k: Fix htt stats sounding info and pdev cca stats 5e97128759b4 ath11k: fix resource leak in ath11k_mac_sta_state 5b90fc760db5 ath11k: fix wmi service ready ext tlv parsing 0f37fbf43c3f ath11k: update tcl cmd descriptor parameters for STA mode 293cb5839729 ath11k: optimize RX path latencyf1d34a01ed54 ath11k: avoid WMM param truncationd12ac6c47a32 ath11k: remove unused tx ring countersd2f510fa0103 ath11k: Fix skb_panic observed during msdu coalescing 79c647a3c59d ath11k: Fixing TLV length issue in peer pktlog WMI command 051cefa44667 ath11k: Fix target crash due to WBM_IDLE_LINK ring desc shortage
Signature · 3 lines
https://patchwork.kernel.org/patch/11261935/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
Quoted 8 lines · Kalle Valo
The Previous configuartion of htt stats sounding info and pdev cca stats are invalid due to that getting time out error.
Changing htt stats sounding info value from
0xFFto0x00and htt pdev cca stats from0x10to0x00Signed-off-by Ganesh Sesetti <[email protected]>Signed-off-by Kalle Valo <[email protected]>
10 patches applied to ath-next branch of ath.git, thanks.
86d4def890fd ath11k: Fix htt stats sounding info and pdev cca stats 5e97128759b4 ath11k: fix resource leak in ath11k_mac_sta_state 5b90fc760db5 ath11k: fix wmi service ready ext tlv parsing 0f37fbf43c3f ath11k: update tcl cmd descriptor parameters for STA mode 293cb5839729 ath11k: optimize RX path latencyf1d34a01ed54 ath11k: avoid WMM param truncationd12ac6c47a32 ath11k: remove unused tx ring countersd2f510fa0103 ath11k: Fix skb_panic observed during msdu coalescing 79c647a3c59d ath11k: Fixing TLV length issue in peer pktlog WMI command 051cefa44667 ath11k: Fix target crash due to WBM_IDLE_LINK ring desc shortage
Signature · 9 lines
https://patchwork.kernel.org/patch/11261935/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches _______________________________________________ ath11k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath11k
PATCH 1/10 ath11k: Fix htt stats sounding info and pdev cca stats
In reply to a message not in the archiveFrom: Ganesh Sesetti <[email protected]>
The Previous configuartion of htt stats sounding info and pdev cca stats are invalid due to that getting time out error.
Changing htt stats sounding info value from 0xFF to 0x00 and htt pdev cca stats from 0x10 to 0x00
--- drivers/net/wireless/ath/ath11k/dp.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/wireless/ath/ath11k/dp.h +2 -2
@@ -1365,8 +1365,8 @@ struct htt_ext_stats_cfg_cmd {#define HTT_STAT_DEFAULT_CFG0_ALL_CMDQS 0xffff#define HTT_STAT_DEFAULT_CFG0_ALL_RINGS 0xffff#define HTT_STAT_DEFAULT_CFG0_ACTIVE_PEERS 0xff -#define HTT_STAT_DEFAULT_CFG0_CCA_CUMULATIVE 0x10 -#define HTT_STAT_DEFAULT_CFG0_ACTIVE_VDEVS 0xff +#define HTT_STAT_DEFAULT_CFG0_CCA_CUMULATIVE 0x00 +#define HTT_STAT_DEFAULT_CFG0_ACTIVE_VDEVS 0x00/* HTT_DBG_EXT_STATS_PEER_INFO * PARAMS:
Signature · 7 lines
2.7.4 _______________________________________________ ath11k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath11k
PATCH 2/10 ath11k: fix resource leak in ath11k_mac_sta_state
In reply to a message not in the archiveFrom: Karthikeyan Periyasamy <[email protected]>
Handled the error case with proper resource cleanup and moved the handling into a separate function from ath11k_mac_sta_state.
--- drivers/net/wireless/ath/ath11k/mac.c | 144 ++++++++++++++++++++-------------- 1 file changed, 86 insertions(+), 58 deletions(-)
drivers/net/wireless/ath/ath11k/mac.c +86 -58
@@ -2682,6 +2682,87 @@ static void ath11k_mac_dec_num_stations(struct ath11k_vif *arvif, ar->num_stations--; } +static int ath11k_mac_station_add (struct ath11k *ar, +struct ieee80211_vif *vif, +struct ieee80211_sta *sta) +{ +struct ath11k_base *ab = ar->ab; +struct ath11k_vif *arvif =ath11k_vif_to_arvif (vif); +struct ath11k_sta *arsta = (struct ath11k_sta *)sta->drv_priv; +struct peer_create_params peer_param; +int ret; + +lockdep_assert_held (&ar->conf_mutex); + + ret =ath11k_mac_inc_num_stations (arvif, sta); +if (ret) { +ath11k_warn (ab,"refusing to associate station: too many connected already (%d)\n" , + ar->max_num_stations); + goto exit; + } + + arsta->rx_stats =kzalloc (sizeof (*arsta->rx_stats),GFP_KERNEL ); +if (!arsta->rx_stats) { + ret = -ENOMEM ; + goto dec_num_station; + } + + peer_param.vdev_id = arvif->vdev_id; + peer_param.peer_addr = sta->addr; + peer_param.peer_type =WMI_PEER_TYPE_DEFAULT ; + + ret =ath11k_peer_create (ar, arvif, sta, &peer_param); +if (ret) { +ath11k_warn (ab,"Failed to add peer: %pM for VDEV: %d\n" , + sta->addr, arvif->vdev_id); + goto free_rx_stats; + } + +ath11k_dbg (ab,ATH11K_DBG_MAC ,"Added peer: %pM for VDEV: %d\n" , + sta->addr, arvif->vdev_id); + +if (ath11k_debug_is_extd_tx_stats_enabled (ar)) { + arsta->tx_stats =kzalloc (sizeof (*arsta->tx_stats),GFP_KERNEL ); +if (!arsta->tx_stats) { + ret = -ENOMEM ; + goto free_peer; + } + } + +if (ieee80211_vif_is_mesh (vif)) { + ret =ath11k_wmi_set_peer_param (ar, sta->addr, + arvif->vdev_id, +WMI_PEER_USE_4ADDR ,1 ); +if (ret) { +ath11k_warn (ab,"failed to STA %pM 4addr capability: %d\n" , + sta->addr, ret); + goto free_tx_stats; + } + } + + ret =ath11k_dp_peer_setup (ar, arvif->vdev_id, sta->addr); +if (ret) { +ath11k_warn (ab,"failed to setup dp for peer %pM on vdev %i (%d)\n" , + sta->addr, arvif->vdev_id, ret); + goto free_tx_stats; + } + +return 0 ; + +free_tx_stats: +kfree (arsta->tx_stats); + arsta->tx_stats =NULL ; +free_peer: +ath11k_peer_delete (ar, arvif->vdev_id, sta->addr); +free_rx_stats: +kfree (arsta->rx_stats); + arsta->rx_stats =NULL ; +dec_num_station: +ath11k_mac_dec_num_stations (arvif, sta); +exit: +return ret; +} + static int ath11k_mac_op_sta_state(struct ieee80211_hw *hw, struct ieee80211_vif *vif, struct ieee80211_sta *sta,
@@ -2691,7 +2772,6 @@ static int ath11k_mac_op_sta_state(struct ieee80211_hw *hw,struct ath11k *ar = hw->priv;struct ath11k_vif *arvif =ath11k_vif_to_arvif (vif);struct ath11k_sta *arsta = (struct ath11k_sta *)sta->drv_priv; -struct peer_create_params peer_param;int ret =0 ;/* cancel must be done outside the mutex to avoid deadlock */
@@ -2707,60 +2787,10 @@ static int ath11k_mac_op_sta_state(struct ieee80211_hw *hw, arsta->arvif = arvif;INIT_WORK (&arsta->update_wk, ath11k_sta_rc_update_wk); - ret =ath11k_mac_inc_num_stations (arvif, sta); -if (ret) { -ath11k_warn (ar->ab,"refusing to associate station: too many connected already (%d)\n" , - ar->max_num_stations); - goto exit; - } - - arsta->rx_stats =kzalloc (sizeof (*arsta->rx_stats),GFP_KERNEL ); -if (!arsta->rx_stats) { - ret = -ENOMEM ; - goto exit; - } - - peer_param.vdev_id = arvif->vdev_id; - peer_param.peer_addr = sta->addr; - peer_param.peer_type =WMI_PEER_TYPE_DEFAULT ; - ret =ath11k_peer_create (ar, arvif, sta, &peer_param); -if (ret) { -ath11k_warn (ar->ab,"Failed to add peer: %pM for VDEV: %d\n" , + ret =ath11k_mac_station_add (ar, vif, sta); +if (ret) +ath11k_warn (ar->ab,"Failed to add station: %pM for VDEV: %d\n" , sta->addr, arvif->vdev_id); -ath11k_mac_dec_num_stations (arvif, sta); - goto exit; - } - -ath11k_info (ar->ab,"Added peer: %pM for VDEV: %d\n" , - sta->addr, arvif->vdev_id); - -if (ath11k_debug_is_extd_tx_stats_enabled (ar)) { - arsta->tx_stats =kzalloc (sizeof (*arsta->tx_stats), -GFP_KERNEL ); -if (!arsta->tx_stats) { - ret = -ENOMEM ; - goto exit; - } - } - -if (ieee80211_vif_is_mesh (vif)) { - ret =ath11k_wmi_set_peer_param (ar, sta->addr, - arvif->vdev_id, -WMI_PEER_USE_4ADDR ,1 ); -if (ret) { -ath11k_warn (ar->ab,"failed to STA %pM 4addr capability: %d\n" , - sta->addr, ret); - goto exit; - } - } - - ret =ath11k_dp_peer_setup (ar, arvif->vdev_id, sta->addr); -if (ret) { -ath11k_warn (ar->ab,"failed to setup dp for peer %pM on vdev %i (%d)\n" , - sta->addr, arvif->vdev_id, ret); -ath11k_peer_delete (ar, arvif->vdev_id, sta->addr); -ath11k_mac_dec_num_stations (arvif, sta); - } }else if ((old_state ==IEEE80211_STA_NONE && new_state ==IEEE80211_STA_NOTEXIST )) {ath11k_dp_peer_cleanup (ar, arvif->vdev_id, sta->addr);
@@ -2770,9 +2800,8 @@ static int ath11k_mac_op_sta_state(struct ieee80211_hw *hw,ath11k_warn (ar->ab,"Failed to delete peer: %pM for VDEV: %d\n" , sta->addr, arvif->vdev_id); else - ath11k_info(ar->ab, -"Removed peer: %pM for VDEV: %d\n" , - sta->addr, arvif->vdev_id); + ath11k_dbg(ar->ab, ATH11K_DBG_MAC, "Removed peer: %pM for VDEV: %d\n", + sta->addr, arvif->vdev_id);ath11k_mac_dec_num_stations (arvif, sta);
@@ -2809,7 +2838,6 @@ static int ath11k_mac_op_sta_state(struct ieee80211_hw *hw, sta->addr); } -exit:mutex_unlock (&ar->conf_mutex);return ret; }
Signature · 7 lines
2.7.4 _______________________________________________ ath11k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath11k
PATCH 2/10 ath11k: fix resource leak in ath11k_mac_sta_state
In reply to a message not in the archiveFrom: Karthikeyan Periyasamy <[email protected]>
Handled the error case with proper resource cleanup and moved the handling into a separate function from ath11k_mac_sta_state.
--- drivers/net/wireless/ath/ath11k/mac.c | 144 ++++++++++++++++++++-------------- 1 file changed, 86 insertions(+), 58 deletions(-)
drivers/net/wireless/ath/ath11k/mac.c +86 -58
@@ -2682,6 +2682,87 @@ static void ath11k_mac_dec_num_stations(struct ath11k_vif *arvif, ar->num_stations--; } +static int ath11k_mac_station_add (struct ath11k *ar, +struct ieee80211_vif *vif, +struct ieee80211_sta *sta) +{ +struct ath11k_base *ab = ar->ab; +struct ath11k_vif *arvif =ath11k_vif_to_arvif (vif); +struct ath11k_sta *arsta = (struct ath11k_sta *)sta->drv_priv; +struct peer_create_params peer_param; +int ret; + +lockdep_assert_held (&ar->conf_mutex); + + ret =ath11k_mac_inc_num_stations (arvif, sta); +if (ret) { +ath11k_warn (ab,"refusing to associate station: too many connected already (%d)\n" , + ar->max_num_stations); + goto exit; + } + + arsta->rx_stats =kzalloc (sizeof (*arsta->rx_stats),GFP_KERNEL ); +if (!arsta->rx_stats) { + ret = -ENOMEM ; + goto dec_num_station; + } + + peer_param.vdev_id = arvif->vdev_id; + peer_param.peer_addr = sta->addr; + peer_param.peer_type =WMI_PEER_TYPE_DEFAULT ; + + ret =ath11k_peer_create (ar, arvif, sta, &peer_param); +if (ret) { +ath11k_warn (ab,"Failed to add peer: %pM for VDEV: %d\n" , + sta->addr, arvif->vdev_id); + goto free_rx_stats; + } + +ath11k_dbg (ab,ATH11K_DBG_MAC ,"Added peer: %pM for VDEV: %d\n" , + sta->addr, arvif->vdev_id); + +if (ath11k_debug_is_extd_tx_stats_enabled (ar)) { + arsta->tx_stats =kzalloc (sizeof (*arsta->tx_stats),GFP_KERNEL ); +if (!arsta->tx_stats) { + ret = -ENOMEM ; + goto free_peer; + } + } + +if (ieee80211_vif_is_mesh (vif)) { + ret =ath11k_wmi_set_peer_param (ar, sta->addr, + arvif->vdev_id, +WMI_PEER_USE_4ADDR ,1 ); +if (ret) { +ath11k_warn (ab,"failed to STA %pM 4addr capability: %d\n" , + sta->addr, ret); + goto free_tx_stats; + } + } + + ret =ath11k_dp_peer_setup (ar, arvif->vdev_id, sta->addr); +if (ret) { +ath11k_warn (ab,"failed to setup dp for peer %pM on vdev %i (%d)\n" , + sta->addr, arvif->vdev_id, ret); + goto free_tx_stats; + } + +return 0 ; + +free_tx_stats: +kfree (arsta->tx_stats); + arsta->tx_stats =NULL ; +free_peer: +ath11k_peer_delete (ar, arvif->vdev_id, sta->addr); +free_rx_stats: +kfree (arsta->rx_stats); + arsta->rx_stats =NULL ; +dec_num_station: +ath11k_mac_dec_num_stations (arvif, sta); +exit: +return ret; +} + static int ath11k_mac_op_sta_state(struct ieee80211_hw *hw, struct ieee80211_vif *vif, struct ieee80211_sta *sta,
@@ -2691,7 +2772,6 @@ static int ath11k_mac_op_sta_state(struct ieee80211_hw *hw,struct ath11k *ar = hw->priv;struct ath11k_vif *arvif =ath11k_vif_to_arvif (vif);struct ath11k_sta *arsta = (struct ath11k_sta *)sta->drv_priv; -struct peer_create_params peer_param;int ret =0 ;/* cancel must be done outside the mutex to avoid deadlock */
@@ -2707,60 +2787,10 @@ static int ath11k_mac_op_sta_state(struct ieee80211_hw *hw, arsta->arvif = arvif;INIT_WORK (&arsta->update_wk, ath11k_sta_rc_update_wk); - ret =ath11k_mac_inc_num_stations (arvif, sta); -if (ret) { -ath11k_warn (ar->ab,"refusing to associate station: too many connected already (%d)\n" , - ar->max_num_stations); - goto exit; - } - - arsta->rx_stats =kzalloc (sizeof (*arsta->rx_stats),GFP_KERNEL ); -if (!arsta->rx_stats) { - ret = -ENOMEM ; - goto exit; - } - - peer_param.vdev_id = arvif->vdev_id; - peer_param.peer_addr = sta->addr; - peer_param.peer_type =WMI_PEER_TYPE_DEFAULT ; - ret =ath11k_peer_create (ar, arvif, sta, &peer_param); -if (ret) { -ath11k_warn (ar->ab,"Failed to add peer: %pM for VDEV: %d\n" , + ret =ath11k_mac_station_add (ar, vif, sta); +if (ret) +ath11k_warn (ar->ab,"Failed to add station: %pM for VDEV: %d\n" , sta->addr, arvif->vdev_id); -ath11k_mac_dec_num_stations (arvif, sta); - goto exit; - } - -ath11k_info (ar->ab,"Added peer: %pM for VDEV: %d\n" , - sta->addr, arvif->vdev_id); - -if (ath11k_debug_is_extd_tx_stats_enabled (ar)) { - arsta->tx_stats =kzalloc (sizeof (*arsta->tx_stats), -GFP_KERNEL ); -if (!arsta->tx_stats) { - ret = -ENOMEM ; - goto exit; - } - } - -if (ieee80211_vif_is_mesh (vif)) { - ret =ath11k_wmi_set_peer_param (ar, sta->addr, - arvif->vdev_id, -WMI_PEER_USE_4ADDR ,1 ); -if (ret) { -ath11k_warn (ar->ab,"failed to STA %pM 4addr capability: %d\n" , - sta->addr, ret); - goto exit; - } - } - - ret =ath11k_dp_peer_setup (ar, arvif->vdev_id, sta->addr); -if (ret) { -ath11k_warn (ar->ab,"failed to setup dp for peer %pM on vdev %i (%d)\n" , - sta->addr, arvif->vdev_id, ret); -ath11k_peer_delete (ar, arvif->vdev_id, sta->addr); -ath11k_mac_dec_num_stations (arvif, sta); - } }else if ((old_state ==IEEE80211_STA_NONE && new_state ==IEEE80211_STA_NOTEXIST )) {ath11k_dp_peer_cleanup (ar, arvif->vdev_id, sta->addr);
@@ -2770,9 +2800,8 @@ static int ath11k_mac_op_sta_state(struct ieee80211_hw *hw,ath11k_warn (ar->ab,"Failed to delete peer: %pM for VDEV: %d\n" , sta->addr, arvif->vdev_id); else - ath11k_info(ar->ab, -"Removed peer: %pM for VDEV: %d\n" , - sta->addr, arvif->vdev_id); + ath11k_dbg(ar->ab, ATH11K_DBG_MAC, "Removed peer: %pM for VDEV: %d\n", + sta->addr, arvif->vdev_id);ath11k_mac_dec_num_stations (arvif, sta);
@@ -2809,7 +2838,6 @@ static int ath11k_mac_op_sta_state(struct ieee80211_hw *hw, sta->addr); } -exit:mutex_unlock (&ar->conf_mutex);return ret; }
Signature · 1 line
2.7.4
PATCH 3/10 ath11k: fix wmi service ready ext tlv parsing
In reply to a message not in the archiveFrom: Anilkumar Kolli <[email protected]>
The current ath11k driver failed to parse wmi_tlv_svc_rdy_ext_parse if there is change in wmi_mac_phy_capabilities length with below error.
ath11k c000000.wifi1: failed to extract mac caps, idx :0 ath11k c000000.wifi1: failed to parse tlv -22
This is needed to get firmware version WLAN.HK.2.0.0.1-00240-QCAHKSWPL_SILICONZ-1 working.
--- drivers/net/wireless/ath/ath11k/wmi.c | 14 +++++++++++--- drivers/net/wireless/ath/ath11k/wmi.h | 1 - 2 files changed, 11 insertions(+), 4 deletions(-)
drivers/net/wireless/ath/ath11k/wmi.c +11 -3
@@ -310,7 +310,7 @@ ath11k_pull_mac_phy_cap_svc_ready_ext(struct ath11k_pdev_wmi *wmi_handle,if (phy_id >= hal_reg_caps->num_phy)return -EINVAL ; - mac_phy_caps = &wmi_mac_phy_caps[phy_idx]; + mac_phy_caps = wmi_mac_phy_caps + phy_idx; pdev->pdev_id = mac_phy_caps->pdev_id; pdev_cap->supported_bands = mac_phy_caps->supported_bands;
@@ -2959,6 +2959,15 @@ static int ath11k_wmi_tlv_mac_phy_caps_parse(struct ath11k_base *soc,if (svc_rdy_ext->n_mac_phy_caps >= svc_rdy_ext->tot_phy_id)return -ENOBUFS ; + len =min_t (u16, len,sizeof (struct wmi_mac_phy_capabilities )); +if (!svc_rdy_ext->n_mac_phy_caps) { + svc_rdy_ext->mac_phy_caps =kzalloc ((svc_rdy_ext->tot_phy_id) * len, +GFP_ATOMIC ); +if (!svc_rdy_ext->mac_phy_caps) +return -ENOMEM ; + } + +memcpy (svc_rdy_ext->mac_phy_caps + svc_rdy_ext->n_mac_phy_caps, ptr, len); svc_rdy_ext->n_mac_phy_caps++;return 0 ; }
@@ -3092,8 +3101,6 @@ static int ath11k_wmi_tlv_svc_rdy_ext_parse(struct ath11k_base *ab, svc_rdy_ext->hw_mode_done = true; }else if (!svc_rdy_ext->mac_phy_done) { svc_rdy_ext->n_mac_phy_caps =0 ; - svc_rdy_ext->mac_phy_caps = - (struct wmi_mac_phy_capabilities *)ptr; ret =ath11k_wmi_tlv_iter (ab, ptr, len, ath11k_wmi_tlv_mac_phy_caps_parse, svc_rdy_ext);
@@ -3134,6 +3141,7 @@ static int ath11k_service_ready_ext_event(struct ath11k_base *ab,return ret; } +kfree (svc_rdy_ext.mac_phy_caps);return 0 ; }
drivers/net/wireless/ath/ath11k/wmi.h +0 -1
@@ -2276,7 +2276,6 @@ struct wmi_hw_mode_capabilities {#define WMI_MAX_HECAP_PHY_SIZE (3)struct wmi_mac_phy_capabilities { -u32 tlv_header;u32 hw_mode_id;u32 pdev_id;u32 phy_id;
Signature · 7 lines
2.7.4 _______________________________________________ ath11k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath11k
PATCH 3/10 ath11k: fix wmi service ready ext tlv parsing
In reply to a message not in the archiveFrom: Anilkumar Kolli <[email protected]>
The current ath11k driver failed to parse wmi_tlv_svc_rdy_ext_parse if there is change in wmi_mac_phy_capabilities length with below error.
ath11k c000000.wifi1: failed to extract mac caps, idx :0 ath11k c000000.wifi1: failed to parse tlv -22
This is needed to get firmware version WLAN.HK.2.0.0.1-00240-QCAHKSWPL_SILICONZ-1 working.
--- drivers/net/wireless/ath/ath11k/wmi.c | 14 +++++++++++--- drivers/net/wireless/ath/ath11k/wmi.h | 1 - 2 files changed, 11 insertions(+), 4 deletions(-)
drivers/net/wireless/ath/ath11k/wmi.c +11 -3
@@ -310,7 +310,7 @@ ath11k_pull_mac_phy_cap_svc_ready_ext(struct ath11k_pdev_wmi *wmi_handle,if (phy_id >= hal_reg_caps->num_phy)return -EINVAL ; - mac_phy_caps = &wmi_mac_phy_caps[phy_idx]; + mac_phy_caps = wmi_mac_phy_caps + phy_idx; pdev->pdev_id = mac_phy_caps->pdev_id; pdev_cap->supported_bands = mac_phy_caps->supported_bands;
@@ -2959,6 +2959,15 @@ static int ath11k_wmi_tlv_mac_phy_caps_parse(struct ath11k_base *soc,if (svc_rdy_ext->n_mac_phy_caps >= svc_rdy_ext->tot_phy_id)return -ENOBUFS ; + len =min_t (u16, len,sizeof (struct wmi_mac_phy_capabilities )); +if (!svc_rdy_ext->n_mac_phy_caps) { + svc_rdy_ext->mac_phy_caps =kzalloc ((svc_rdy_ext->tot_phy_id) * len, +GFP_ATOMIC ); +if (!svc_rdy_ext->mac_phy_caps) +return -ENOMEM ; + } + +memcpy (svc_rdy_ext->mac_phy_caps + svc_rdy_ext->n_mac_phy_caps, ptr, len); svc_rdy_ext->n_mac_phy_caps++;return 0 ; }
@@ -3092,8 +3101,6 @@ static int ath11k_wmi_tlv_svc_rdy_ext_parse(struct ath11k_base *ab, svc_rdy_ext->hw_mode_done = true; }else if (!svc_rdy_ext->mac_phy_done) { svc_rdy_ext->n_mac_phy_caps =0 ; - svc_rdy_ext->mac_phy_caps = - (struct wmi_mac_phy_capabilities *)ptr; ret =ath11k_wmi_tlv_iter (ab, ptr, len, ath11k_wmi_tlv_mac_phy_caps_parse, svc_rdy_ext);
@@ -3134,6 +3141,7 @@ static int ath11k_service_ready_ext_event(struct ath11k_base *ab,return ret; } +kfree (svc_rdy_ext.mac_phy_caps);return 0 ; }
drivers/net/wireless/ath/ath11k/wmi.h +0 -1
@@ -2276,7 +2276,6 @@ struct wmi_hw_mode_capabilities {#define WMI_MAX_HECAP_PHY_SIZE (3)struct wmi_mac_phy_capabilities { -u32 tlv_header;u32 hw_mode_id;u32 pdev_id;u32 phy_id;
Signature · 1 line
2.7.4
PATCH 4/10 ath11k: update tcl cmd descriptor parameters for STA mode
In reply to a message not in the archiveFrom: Anilkumar Kolli <[email protected]>
It is observed that ath11k STA mode UL throughput is low. This is due to packets delivered to FW from TCL instead of TQM. TCL AST search fail causes packet delivered to FW, fix this by properly configuring the TCL address search type and ast_hash. STA UL throughput is improved 10times with 11AC AP.
--- drivers/net/wireless/ath/ath11k/dp.c | 9 ++++----- drivers/net/wireless/ath/ath11k/dp_rx.c | 2 +- drivers/net/wireless/ath/ath11k/hal_desc.h | 5 ++--- drivers/net/wireless/ath/ath11k/hal_tx.c | 6 +++--- drivers/net/wireless/ath/ath11k/hal_tx.h | 4 ++-- 5 files changed, 12 insertions(+), 14 deletions(-)
drivers/net/wireless/ath/ath11k/dp.c +4 -5
@@ -758,13 +758,12 @@ int ath11k_dp_htt_connect(struct ath11k_dp *dp)static void ath11k_dp_update_vdev_search (struct ath11k_vif *arvif) { -/* Enable AddrY (SA based search) for STA mode. All other modes it -* is going to be AddrX (DA based search). For STA mode, set search -* type based on AST value. -*/ +/* For STA mode, enable address search index, +* tcl uses ast_hash value in the descriptor. +*/ switch (arvif->vdev_type) {case WMI_VDEV_TYPE_STA : - arvif->hal_addr_search_flags =HAL_TX_ADDRY_EN ; + arvif->hal_addr_search_flags =HAL_TX_ADDRX_EN ; arvif->search_type =HAL_TX_ADDR_SEARCH_INDEX ;break ;case WMI_VDEV_TYPE_AP :
drivers/net/wireless/ath/ath11k/dp_rx.c +1 -1
@@ -1312,7 +1312,7 @@ void ath11k_dp_htt_htc_t2h_msg_handler(struct ath11k_base *ab,ath11k_dp_get_mac_addr (resp->peer_map_ev.mac_addr_l32, peer_mac_h16, mac_addr); ast_hash =FIELD_GET (HTT_T2H_PEER_MAP_INFO2_AST_HASH_VAL , - resp->peer_map_ev.info1); + resp->peer_map_ev.info2);ath11k_peer_map_event (ab, vdev_id, peer_id, mac_addr, ast_hash);break ;case HTT_T2H_MSG_TYPE_PEER_UNMAP :
drivers/net/wireless/ath/ath11k/hal_desc.h +2 -3
@@ -934,9 +934,8 @@ struct hal_reo_flush_cache {#define HAL_TCL_DATA_CMD_INFO0_ENCRYPT_TYPE GENMASK(7, 4)#define HAL_TCL_DATA_CMD_INFO0_SRC_BUF_SWAP BIT(8)#define HAL_TCL_DATA_CMD_INFO0_LNK_META_SWAP BIT(9) -#define HAL_TCL_DATA_CMD_INFO0_SEARCH_TYPE BIT(12) -#define HAL_TCL_DATA_CMD_INFO0_ADDRX_EN BIT(14) -#define HAL_TCL_DATA_CMD_INFO0_ADDRY_EN BIT(15) +#define HAL_TCL_DATA_CMD_INFO0_SEARCH_TYPE GENMASK(13, 12) +#define HAL_TCL_DATA_CMD_INFO0_ADDR_EN GENMASK(15, 14)#define HAL_TCL_DATA_CMD_INFO0_CMD_NUM GENMASK(31, 16)#define HAL_TCL_DATA_CMD_INFO1_DATA_LEN GENMASK(15, 0)
drivers/net/wireless/ath/ath11k/hal_tx.c +3 -3
@@ -52,9 +52,9 @@ void ath11k_hal_tx_cmd_desc_setup(struct ath11k_base *ab, void *cmd,FIELD_PREP (HAL_TCL_DATA_CMD_INFO0_ENCAP_TYPE , ti->encap_type) |FIELD_PREP (HAL_TCL_DATA_CMD_INFO0_ENCRYPT_TYPE , ti->encrypt_type) | -FIELD_PREP (HAL_TCL_DATA_CMD_INFO0_ADDRX_EN , - ti->addr_search_flags) | -FIELD_PREP (HAL_TCL_DATA_CMD_INFO0_ADDRY_EN , +FIELD_PREP (HAL_TCL_DATA_CMD_INFO0_SEARCH_TYPE , + ti->search_type) | +FIELD_PREP (HAL_TCL_DATA_CMD_INFO0_ADDR_EN , ti->addr_search_flags) |FIELD_PREP (HAL_TCL_DATA_CMD_INFO0_CMD_NUM , ti->meta_data_flags);
drivers/net/wireless/ath/ath11k/hal_tx.h +2 -2
@@ -11,8 +11,8 @@#define HAL_TX_ADDRX_EN 1#define HAL_TX_ADDRY_EN 2 -#define HAL_TX_ADDR_SEARCH_INDEX 0 -#define HAL_TX_ADDR_SEARCH_DEFAULT 1 +#define HAL_TX_ADDR_SEARCH_DEFAULT 0 +#define HAL_TX_ADDR_SEARCH_INDEX 1struct hal_tx_info {u16 meta_data_flags;/* %HAL_TCL_DATA_CMD_INFO0_META_ */
Signature · 7 lines
2.7.4 _______________________________________________ ath11k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath11k
PATCH 4/10 ath11k: update tcl cmd descriptor parameters for STA mode
In reply to a message not in the archiveFrom: Anilkumar Kolli <[email protected]>
It is observed that ath11k STA mode UL throughput is low. This is due to packets delivered to FW from TCL instead of TQM. TCL AST search fail causes packet delivered to FW, fix this by properly configuring the TCL address search type and ast_hash. STA UL throughput is improved 10times with 11AC AP.
--- drivers/net/wireless/ath/ath11k/dp.c | 9 ++++----- drivers/net/wireless/ath/ath11k/dp_rx.c | 2 +- drivers/net/wireless/ath/ath11k/hal_desc.h | 5 ++--- drivers/net/wireless/ath/ath11k/hal_tx.c | 6 +++--- drivers/net/wireless/ath/ath11k/hal_tx.h | 4 ++-- 5 files changed, 12 insertions(+), 14 deletions(-)
drivers/net/wireless/ath/ath11k/dp.c +4 -5
@@ -758,13 +758,12 @@ int ath11k_dp_htt_connect(struct ath11k_dp *dp)static void ath11k_dp_update_vdev_search (struct ath11k_vif *arvif) { -/* Enable AddrY (SA based search) for STA mode. All other modes it -* is going to be AddrX (DA based search). For STA mode, set search -* type based on AST value. -*/ +/* For STA mode, enable address search index, +* tcl uses ast_hash value in the descriptor. +*/ switch (arvif->vdev_type) {case WMI_VDEV_TYPE_STA : - arvif->hal_addr_search_flags =HAL_TX_ADDRY_EN ; + arvif->hal_addr_search_flags =HAL_TX_ADDRX_EN ; arvif->search_type =HAL_TX_ADDR_SEARCH_INDEX ;break ;case WMI_VDEV_TYPE_AP :
drivers/net/wireless/ath/ath11k/dp_rx.c +1 -1
@@ -1312,7 +1312,7 @@ void ath11k_dp_htt_htc_t2h_msg_handler(struct ath11k_base *ab,ath11k_dp_get_mac_addr (resp->peer_map_ev.mac_addr_l32, peer_mac_h16, mac_addr); ast_hash =FIELD_GET (HTT_T2H_PEER_MAP_INFO2_AST_HASH_VAL , - resp->peer_map_ev.info1); + resp->peer_map_ev.info2);ath11k_peer_map_event (ab, vdev_id, peer_id, mac_addr, ast_hash);break ;case HTT_T2H_MSG_TYPE_PEER_UNMAP :
drivers/net/wireless/ath/ath11k/hal_desc.h +2 -3
@@ -934,9 +934,8 @@ struct hal_reo_flush_cache {#define HAL_TCL_DATA_CMD_INFO0_ENCRYPT_TYPE GENMASK(7, 4)#define HAL_TCL_DATA_CMD_INFO0_SRC_BUF_SWAP BIT(8)#define HAL_TCL_DATA_CMD_INFO0_LNK_META_SWAP BIT(9) -#define HAL_TCL_DATA_CMD_INFO0_SEARCH_TYPE BIT(12) -#define HAL_TCL_DATA_CMD_INFO0_ADDRX_EN BIT(14) -#define HAL_TCL_DATA_CMD_INFO0_ADDRY_EN BIT(15) +#define HAL_TCL_DATA_CMD_INFO0_SEARCH_TYPE GENMASK(13, 12) +#define HAL_TCL_DATA_CMD_INFO0_ADDR_EN GENMASK(15, 14)#define HAL_TCL_DATA_CMD_INFO0_CMD_NUM GENMASK(31, 16)#define HAL_TCL_DATA_CMD_INFO1_DATA_LEN GENMASK(15, 0)
drivers/net/wireless/ath/ath11k/hal_tx.c +3 -3
@@ -52,9 +52,9 @@ void ath11k_hal_tx_cmd_desc_setup(struct ath11k_base *ab, void *cmd,FIELD_PREP (HAL_TCL_DATA_CMD_INFO0_ENCAP_TYPE , ti->encap_type) |FIELD_PREP (HAL_TCL_DATA_CMD_INFO0_ENCRYPT_TYPE , ti->encrypt_type) | -FIELD_PREP (HAL_TCL_DATA_CMD_INFO0_ADDRX_EN , - ti->addr_search_flags) | -FIELD_PREP (HAL_TCL_DATA_CMD_INFO0_ADDRY_EN , +FIELD_PREP (HAL_TCL_DATA_CMD_INFO0_SEARCH_TYPE , + ti->search_type) | +FIELD_PREP (HAL_TCL_DATA_CMD_INFO0_ADDR_EN , ti->addr_search_flags) |FIELD_PREP (HAL_TCL_DATA_CMD_INFO0_CMD_NUM , ti->meta_data_flags);
drivers/net/wireless/ath/ath11k/hal_tx.h +2 -2
@@ -11,8 +11,8 @@#define HAL_TX_ADDRX_EN 1#define HAL_TX_ADDRY_EN 2 -#define HAL_TX_ADDR_SEARCH_INDEX 0 -#define HAL_TX_ADDR_SEARCH_DEFAULT 1 +#define HAL_TX_ADDR_SEARCH_DEFAULT 0 +#define HAL_TX_ADDR_SEARCH_INDEX 1struct hal_tx_info {u16 meta_data_flags;/* %HAL_TCL_DATA_CMD_INFO0_META_ */
Signature · 1 line
2.7.4
PATCH 5/10 ath11k: optimize RX path latency
In reply to a message not in the archiveFrom: John Crispin <[email protected]>
This patch drops ath11k_hal_rx_parse_dst_ring_desc(). This function was creating a huge amount of load, which lead to a signifcant latency delay when processing data in the RX path.
Pegging the processing on a specific core and running perf --top we get the following output when running HE80 at a fixed bandwidth of 1gbit.
with patch
19.19% [ath11k] [k] ath11k_dp_process_rx
5.02% [ath11k] [k] ath11k_dp_rx_tid_del_func
4.39% [kernel] [k] v7_dma_inv_range
4.15% [kernel] [k] __slab_alloc.constprop.1
4.03% [kernel] [k] dev_gro_receive
3.86% [kernel] [k] tcp_gro_receive
3.07% [ip_tables] [k] ipt_do_table
2.96% [kernel] [k] dma_cache_maint_pagewithout patch
21.64% [ath11k] [k] ath11k_hal_rx_parse_dst_ring_desc
10.80% [ath11k] [k] ath11k_dp_process_rx
3.77% [kernel] [k] v7_dma_inv_range
3.48% [kernel] [k] dev_gro_receive
3.32% [ath11k] [k] ath11k_dp_rx_tid_del_func
3.17% [mac80211] [k] ieee80211_rx_napi
2.70% [kernel] [k] dma_cache_maint_page
2.65% [mac80211] [k] ieee80211_sta_ps_transitionWhen removing the the bandwidth limit and rerunning the test we see an overall throughput improvement of 3-400mbit when running 4x4 HE80.
--- drivers/net/wireless/ath/ath11k/dp_rx.c | 47 ++++++++++++++++-------------- drivers/net/wireless/ath/ath11k/hal_rx.c | 49 +++----------------------------- drivers/net/wireless/ath/ath11k/hal_rx.h | 28 +----------------- 3 files changed, 31 insertions(+), 93 deletions(-)
drivers/net/wireless/ath/ath11k/dp_rx.c +26 -21
@@ -2124,7 +2124,6 @@ int ath11k_dp_process_rx(struct ath11k_base *ab, int mac_id,struct ieee80211_rx_status *rx_status = &dp->rx_status;struct dp_rxdma_ring *rx_ring = &dp->rx_refill_buf_ring;struct hal_srng *srng; -struct hal_rx_meta_info meta_info;struct sk_buff *msdu;struct sk_buff_head msdu_list;struct sk_buff_head amsdu_list;
@@ -2160,11 +2159,14 @@ int ath11k_dp_process_rx(struct ath11k_base *ab, int mac_id, try_again:while ((rx_desc =ath11k_hal_srng_dst_get_next_entry (ab, srng))) { -memset (&meta_info,0 ,sizeof (meta_info)); -ath11k_hal_rx_parse_dst_ring_desc (ab, rx_desc, &meta_info); +struct hal_reo_dest_ring *desc = (struct hal_reo_dest_ring *)rx_desc; +enum hal_reo_dest_ring_push_reason push_reason; +u32 cookie; + cookie =FIELD_GET (BUFFER_ADDR_INFO1_SW_COOKIE , + desc->buf_addr_info.info1); buf_id =FIELD_GET (DP_RXDMA_BUF_COOKIE_BUF_ID , - meta_info.msdu_meta.cookie); + cookie);spin_lock_bh (&rx_ring->idr_lock); msdu =idr_find (&rx_ring->bufs_idr, buf_id);if (!msdu) {
@@ -2184,7 +2186,9 @@ int ath11k_dp_process_rx(struct ath11k_base *ab, int mac_id, num_buffs_reaped++; -if (meta_info.push_reason != + push_reason =FIELD_GET (HAL_REO_DEST_RING_INFO0_PUSH_REASON , + desc->info0); +if (push_reason !=HAL_REO_DEST_RING_PUSH_REASON_ROUTING_INSTRUCTION ) {/* TODO: Check if the msdu can be sent up for processing */ dev_kfree_skb_any (msdu);
@@ -2192,9 +2196,12 @@ int ath11k_dp_process_rx(struct ath11k_base *ab, int mac_id,continue ; } - rxcb->is_first_msdu = meta_info.msdu_meta.first; - rxcb->is_last_msdu = meta_info.msdu_meta.last; - rxcb->is_continuation = meta_info.msdu_meta.continuation; + rxcb->is_first_msdu = !!(desc->rx_msdu_info.info0 & +RX_MSDU_DESC_INFO0_FIRST_MSDU_IN_MPDU ); + rxcb->is_last_msdu = !!(desc->rx_msdu_info.info0 & +RX_MSDU_DESC_INFO0_LAST_MSDU_IN_MPDU ); + rxcb->is_continuation = !!(desc->rx_msdu_info.info0 & +RX_MSDU_DESC_INFO0_MSDU_CONTINUATION ); rxcb->mac_id = mac_id;__skb_queue_tail (&msdu_list, msdu);
@@ -2770,12 +2777,11 @@ ath11k_dp_process_rx_err_buf(struct ath11k *ar, struct napi_struct *napi,int ath11k_dp_process_rx_err (struct ath11k_base *ab,struct napi_struct *napi,int budget) { -struct hal_rx_msdu_meta meta[HAL_NUM_RX_MSDUS_PER_LINK_DESC ]; +u32 msdu_cookies[HAL_NUM_RX_MSDUS_PER_LINK_DESC ];struct dp_link_desc_bank *link_desc_banks;enum hal_rx_buf_return_buf_manager rbm;int tot_n_bufs_reaped, quota, ret, i;int n_bufs_reaped[MAX_RADIOS ] = {0 }; -struct hal_rx_meta_info meta_info;struct dp_rxdma_ring *rx_ring;struct dp_srng *reo_except;u32 desc_bank, num_msdus;
@@ -2803,6 +2809,8 @@ int ath11k_dp_process_rx_err(struct ath11k_base *ab, struct napi_struct *napi,while (budget && (desc =ath11k_hal_srng_dst_get_next_entry (ab, srng))) { +struct hal_reo_dest_ring *reo_desc = (struct hal_reo_dest_ring *)desc; + ab->soc_stats.err_ring_pkts++; ret =ath11k_hal_desc_reo_parse_err (ab, desc, &paddr, &desc_bank);
@@ -2813,7 +2821,7 @@ int ath11k_dp_process_rx_err(struct ath11k_base *ab, struct napi_struct *napi, } link_desc_va = link_desc_banks[desc_bank].vaddr + (paddr - link_desc_banks[desc_bank].paddr); -ath11k_hal_rx_msdu_link_info_get (link_desc_va, &num_msdus, meta, +ath11k_hal_rx_msdu_link_info_get (link_desc_va, &num_msdus, msdu_cookies, &rbm);if (rbm !=HAL_RX_BUF_RBM_WBM_IDLE_DESC_LIST && rbm !=HAL_RX_BUF_RBM_SW3_BM ) {
@@ -2824,10 +2832,7 @@ int ath11k_dp_process_rx_err(struct ath11k_base *ab, struct napi_struct *napi,continue ; } -memset (&meta_info,0 ,sizeof (meta_info)); -ath11k_hal_rx_parse_dst_ring_desc (ab, desc, &meta_info); - - is_frag = meta_info.mpdu_meta.frag; + is_frag = !!(reo_desc->rx_mpdu_info.info0 &RX_MPDU_DESC_INFO0_FRAG_FLAG );/* Return the link desc back to wbm idle list */ ath11k_dp_rx_link_desc_return(ab, desc,
@@ -2835,10 +2840,10 @@ int ath11k_dp_process_rx_err(struct ath11k_base *ab, struct napi_struct *napi,for (i =0 ; i < num_msdus; i++) { buf_id =FIELD_GET (DP_RXDMA_BUF_COOKIE_BUF_ID , - meta[i].cookie); + msdu_cookies[i]); mac_id =FIELD_GET (DP_RXDMA_BUF_COOKIE_PDEV_ID , - meta[i].cookie); + msdu_cookies[i]); ar = ab->pdevs[mac_id].ar;
@@ -3192,7 +3197,7 @@ int ath11k_dp_process_rxdma_err(struct ath11k_base *ab, int mac_id, int budget)struct dp_rxdma_ring *rx_ring = &ar->dp.rx_refill_buf_ring;struct dp_link_desc_bank *link_desc_banks = ab->dp.link_desc_banks;struct hal_srng *srng; -struct hal_rx_msdu_meta meta[HAL_NUM_RX_MSDUS_PER_LINK_DESC ]; +u32 msdu_cookies[HAL_NUM_RX_MSDUS_PER_LINK_DESC ];enum hal_rx_buf_return_buf_manager rbm;enum hal_reo_entr_rxdma_ecode rxdma_err_code;struct ath11k_skb_rxcb *rxcb;
@@ -3226,12 +3231,12 @@ int ath11k_dp_process_rxdma_err(struct ath11k_base *ab, int mac_id, int budget) link_desc_va = link_desc_banks[desc_bank].vaddr + (paddr - link_desc_banks[desc_bank].paddr); -ath11k_hal_rx_msdu_link_info_get (link_desc_va, &num_msdus, meta, - &rbm); +ath11k_hal_rx_msdu_link_info_get (link_desc_va, &num_msdus, + msdu_cookies, &rbm);for (i =0 ; i < num_msdus; i++) { buf_id =FIELD_GET (DP_RXDMA_BUF_COOKIE_BUF_ID , - meta[i].cookie); + msdu_cookies[i]);spin_lock_bh (&rx_ring->idr_lock); skb =idr_find (&rx_ring->bufs_idr, buf_id);
drivers/net/wireless/ath/ath11k/hal_rx.c +4 -45
67 lines not on this page · raw message
drivers/net/wireless/ath/ath11k/hal_rx.h +1 -27
@@ -6,30 +6,6 @@ #ifndef ATH11K_HAL_RX_H #define ATH11K_HAL_RX_H -struct hal_rx_mpdu_meta { - u32 peer_meta; - u16 msdu_cnt; - u16 seq_num; - bool frag; - bool retry; - bool ampdu; - bool raw; -}; - -struct hal_rx_msdu_meta { - u32 cookie; - u32 msdu_len; - bool first; - bool last; - bool continuation; -}; - -struct hal_rx_meta_info { - enum hal_reo_dest_ring_push_reason push_reason; - struct hal_rx_mpdu_meta mpdu_meta; - struct hal_rx_msdu_meta msdu_meta; -}; - struct hal_rx_wbm_rel_info { u32 cookie; enum hal_wbm_rel_src_module err_rel_src;
@@ -320,7 +296,7 @@ void ath11k_hal_reo_update_rx_reo_queue_status(struct ath11k_base *ab, struct hal_reo_status *status);int ath11k_hal_reo_process_status (u8 *reo_desc,u8 *status);void ath11k_hal_rx_msdu_link_info_get (void *link_desc,u32 *num_msdus, -struct hal_rx_msdu_meta *meta, +u32 *msdu_cookies,enum hal_rx_buf_return_buf_manager *rbm); void ath11k_hal_rx_msdu_link_desc_set(struct ath11k_base *ab, void *desc, void *link_desc,
@@ -331,8 +307,6 @@ void ath11k_hal_rx_buf_addr_info_get(void *desc, dma_addr_t *paddr, u32 *cookie, u8 *rbm);int ath11k_hal_desc_reo_parse_err (struct ath11k_base *ab,u32 *rx_desc,dma_addr_t *paddr,u32 *desc_bank); -void ath11k_hal_rx_parse_dst_ring_desc (struct ath11k_base *ab,u32 *rx_desc, -struct hal_rx_meta_info *meta_info);int ath11k_hal_wbm_desc_parse_err (struct ath11k_base *ab,void *desc,struct hal_rx_wbm_rel_info *rel_info); void ath11k_hal_rx_reo_ent_paddr_get(struct ath11k_base *ab, void *desc,
Signature · 1 line
2.7.4
PATCH 5/10 ath11k: optimize RX path latency
In reply to a message not in the archiveFrom: John Crispin <[email protected]>
This patch drops ath11k_hal_rx_parse_dst_ring_desc(). This function was creating a huge amount of load, which lead to a signifcant latency delay when processing data in the RX path.
Pegging the processing on a specific core and running perf --top we get the following output when running HE80 at a fixed bandwidth of 1gbit.
with patch
19.19% [ath11k] [k] ath11k_dp_process_rx
5.02% [ath11k] [k] ath11k_dp_rx_tid_del_func
4.39% [kernel] [k] v7_dma_inv_range
4.15% [kernel] [k] __slab_alloc.constprop.1
4.03% [kernel] [k] dev_gro_receive
3.86% [kernel] [k] tcp_gro_receive
3.07% [ip_tables] [k] ipt_do_table
2.96% [kernel] [k] dma_cache_maint_pagewithout patch
21.64% [ath11k] [k] ath11k_hal_rx_parse_dst_ring_desc
10.80% [ath11k] [k] ath11k_dp_process_rx
3.77% [kernel] [k] v7_dma_inv_range
3.48% [kernel] [k] dev_gro_receive
3.32% [ath11k] [k] ath11k_dp_rx_tid_del_func
3.17% [mac80211] [k] ieee80211_rx_napi
2.70% [kernel] [k] dma_cache_maint_page
2.65% [mac80211] [k] ieee80211_sta_ps_transitionWhen removing the the bandwidth limit and rerunning the test we see an overall throughput improvement of 3-400mbit when running 4x4 HE80.
--- drivers/net/wireless/ath/ath11k/dp_rx.c | 47 ++++++++++++++++-------------- drivers/net/wireless/ath/ath11k/hal_rx.c | 49 +++----------------------------- drivers/net/wireless/ath/ath11k/hal_rx.h | 28 +----------------- 3 files changed, 31 insertions(+), 93 deletions(-)
drivers/net/wireless/ath/ath11k/dp_rx.c +26 -21
@@ -2124,7 +2124,6 @@ int ath11k_dp_process_rx(struct ath11k_base *ab, int mac_id,struct ieee80211_rx_status *rx_status = &dp->rx_status;struct dp_rxdma_ring *rx_ring = &dp->rx_refill_buf_ring;struct hal_srng *srng; -struct hal_rx_meta_info meta_info;struct sk_buff *msdu;struct sk_buff_head msdu_list;struct sk_buff_head amsdu_list;
@@ -2160,11 +2159,14 @@ int ath11k_dp_process_rx(struct ath11k_base *ab, int mac_id, try_again:while ((rx_desc =ath11k_hal_srng_dst_get_next_entry (ab, srng))) { -memset (&meta_info,0 ,sizeof (meta_info)); -ath11k_hal_rx_parse_dst_ring_desc (ab, rx_desc, &meta_info); +struct hal_reo_dest_ring *desc = (struct hal_reo_dest_ring *)rx_desc; +enum hal_reo_dest_ring_push_reason push_reason; +u32 cookie; + cookie =FIELD_GET (BUFFER_ADDR_INFO1_SW_COOKIE , + desc->buf_addr_info.info1); buf_id =FIELD_GET (DP_RXDMA_BUF_COOKIE_BUF_ID , - meta_info.msdu_meta.cookie); + cookie);spin_lock_bh (&rx_ring->idr_lock); msdu =idr_find (&rx_ring->bufs_idr, buf_id);if (!msdu) {
@@ -2184,7 +2186,9 @@ int ath11k_dp_process_rx(struct ath11k_base *ab, int mac_id, num_buffs_reaped++; -if (meta_info.push_reason != + push_reason =FIELD_GET (HAL_REO_DEST_RING_INFO0_PUSH_REASON , + desc->info0); +if (push_reason !=HAL_REO_DEST_RING_PUSH_REASON_ROUTING_INSTRUCTION ) {/* TODO: Check if the msdu can be sent up for processing */ dev_kfree_skb_any (msdu);
@@ -2192,9 +2196,12 @@ int ath11k_dp_process_rx(struct ath11k_base *ab, int mac_id,continue ; } - rxcb->is_first_msdu = meta_info.msdu_meta.first; - rxcb->is_last_msdu = meta_info.msdu_meta.last; - rxcb->is_continuation = meta_info.msdu_meta.continuation; + rxcb->is_first_msdu = !!(desc->rx_msdu_info.info0 & +RX_MSDU_DESC_INFO0_FIRST_MSDU_IN_MPDU ); + rxcb->is_last_msdu = !!(desc->rx_msdu_info.info0 & +RX_MSDU_DESC_INFO0_LAST_MSDU_IN_MPDU ); + rxcb->is_continuation = !!(desc->rx_msdu_info.info0 & +RX_MSDU_DESC_INFO0_MSDU_CONTINUATION ); rxcb->mac_id = mac_id;__skb_queue_tail (&msdu_list, msdu);
@@ -2770,12 +2777,11 @@ ath11k_dp_process_rx_err_buf(struct ath11k *ar, struct napi_struct *napi,int ath11k_dp_process_rx_err (struct ath11k_base *ab,struct napi_struct *napi,int budget) { -struct hal_rx_msdu_meta meta[HAL_NUM_RX_MSDUS_PER_LINK_DESC ]; +u32 msdu_cookies[HAL_NUM_RX_MSDUS_PER_LINK_DESC ];struct dp_link_desc_bank *link_desc_banks;enum hal_rx_buf_return_buf_manager rbm;int tot_n_bufs_reaped, quota, ret, i;int n_bufs_reaped[MAX_RADIOS ] = {0 }; -struct hal_rx_meta_info meta_info;struct dp_rxdma_ring *rx_ring;struct dp_srng *reo_except;u32 desc_bank, num_msdus;
@@ -2803,6 +2809,8 @@ int ath11k_dp_process_rx_err(struct ath11k_base *ab, struct napi_struct *napi,while (budget && (desc =ath11k_hal_srng_dst_get_next_entry (ab, srng))) { +struct hal_reo_dest_ring *reo_desc = (struct hal_reo_dest_ring *)desc; + ab->soc_stats.err_ring_pkts++; ret =ath11k_hal_desc_reo_parse_err (ab, desc, &paddr, &desc_bank);
@@ -2813,7 +2821,7 @@ int ath11k_dp_process_rx_err(struct ath11k_base *ab, struct napi_struct *napi, } link_desc_va = link_desc_banks[desc_bank].vaddr + (paddr - link_desc_banks[desc_bank].paddr); -ath11k_hal_rx_msdu_link_info_get (link_desc_va, &num_msdus, meta, +ath11k_hal_rx_msdu_link_info_get (link_desc_va, &num_msdus, msdu_cookies, &rbm);if (rbm !=HAL_RX_BUF_RBM_WBM_IDLE_DESC_LIST && rbm !=HAL_RX_BUF_RBM_SW3_BM ) {
@@ -2824,10 +2832,7 @@ int ath11k_dp_process_rx_err(struct ath11k_base *ab, struct napi_struct *napi,continue ; } -memset (&meta_info,0 ,sizeof (meta_info)); -ath11k_hal_rx_parse_dst_ring_desc (ab, desc, &meta_info); - - is_frag = meta_info.mpdu_meta.frag; + is_frag = !!(reo_desc->rx_mpdu_info.info0 &RX_MPDU_DESC_INFO0_FRAG_FLAG );/* Return the link desc back to wbm idle list */ ath11k_dp_rx_link_desc_return(ab, desc,
@@ -2835,10 +2840,10 @@ int ath11k_dp_process_rx_err(struct ath11k_base *ab, struct napi_struct *napi,for (i =0 ; i < num_msdus; i++) { buf_id =FIELD_GET (DP_RXDMA_BUF_COOKIE_BUF_ID , - meta[i].cookie); + msdu_cookies[i]); mac_id =FIELD_GET (DP_RXDMA_BUF_COOKIE_PDEV_ID , - meta[i].cookie); + msdu_cookies[i]); ar = ab->pdevs[mac_id].ar;
@@ -3192,7 +3197,7 @@ int ath11k_dp_process_rxdma_err(struct ath11k_base *ab, int mac_id, int budget)struct dp_rxdma_ring *rx_ring = &ar->dp.rx_refill_buf_ring;struct dp_link_desc_bank *link_desc_banks = ab->dp.link_desc_banks;struct hal_srng *srng; -struct hal_rx_msdu_meta meta[HAL_NUM_RX_MSDUS_PER_LINK_DESC ]; +u32 msdu_cookies[HAL_NUM_RX_MSDUS_PER_LINK_DESC ];enum hal_rx_buf_return_buf_manager rbm;enum hal_reo_entr_rxdma_ecode rxdma_err_code;struct ath11k_skb_rxcb *rxcb;
@@ -3226,12 +3231,12 @@ int ath11k_dp_process_rxdma_err(struct ath11k_base *ab, int mac_id, int budget) link_desc_va = link_desc_banks[desc_bank].vaddr + (paddr - link_desc_banks[desc_bank].paddr); -ath11k_hal_rx_msdu_link_info_get (link_desc_va, &num_msdus, meta, - &rbm); +ath11k_hal_rx_msdu_link_info_get (link_desc_va, &num_msdus, + msdu_cookies, &rbm);for (i =0 ; i < num_msdus; i++) { buf_id =FIELD_GET (DP_RXDMA_BUF_COOKIE_BUF_ID , - meta[i].cookie); + msdu_cookies[i]);spin_lock_bh (&rx_ring->idr_lock); skb =idr_find (&rx_ring->bufs_idr, buf_id);
drivers/net/wireless/ath/ath11k/hal_rx.c +4 -45
67 lines not on this page · raw message
drivers/net/wireless/ath/ath11k/hal_rx.h +1 -27
@@ -6,30 +6,6 @@ #ifndef ATH11K_HAL_RX_H #define ATH11K_HAL_RX_H -struct hal_rx_mpdu_meta { - u32 peer_meta; - u16 msdu_cnt; - u16 seq_num; - bool frag; - bool retry; - bool ampdu; - bool raw; -}; - -struct hal_rx_msdu_meta { - u32 cookie; - u32 msdu_len; - bool first; - bool last; - bool continuation; -}; - -struct hal_rx_meta_info { - enum hal_reo_dest_ring_push_reason push_reason; - struct hal_rx_mpdu_meta mpdu_meta; - struct hal_rx_msdu_meta msdu_meta; -}; - struct hal_rx_wbm_rel_info { u32 cookie; enum hal_wbm_rel_src_module err_rel_src;
@@ -320,7 +296,7 @@ void ath11k_hal_reo_update_rx_reo_queue_status(struct ath11k_base *ab, struct hal_reo_status *status);int ath11k_hal_reo_process_status (u8 *reo_desc,u8 *status);void ath11k_hal_rx_msdu_link_info_get (void *link_desc,u32 *num_msdus, -struct hal_rx_msdu_meta *meta, +u32 *msdu_cookies,enum hal_rx_buf_return_buf_manager *rbm); void ath11k_hal_rx_msdu_link_desc_set(struct ath11k_base *ab, void *desc, void *link_desc,
@@ -331,8 +307,6 @@ void ath11k_hal_rx_buf_addr_info_get(void *desc, dma_addr_t *paddr, u32 *cookie, u8 *rbm);int ath11k_hal_desc_reo_parse_err (struct ath11k_base *ab,u32 *rx_desc,dma_addr_t *paddr,u32 *desc_bank); -void ath11k_hal_rx_parse_dst_ring_desc (struct ath11k_base *ab,u32 *rx_desc, -struct hal_rx_meta_info *meta_info);int ath11k_hal_wbm_desc_parse_err (struct ath11k_base *ab,void *desc,struct hal_rx_wbm_rel_info *rel_info); void ath11k_hal_rx_reo_ent_paddr_get(struct ath11k_base *ab, void *desc,
Signature · 7 lines
2.7.4 _______________________________________________ ath11k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath11k
PATCH 6/10 ath11k: avoid WMM param truncation
In reply to a message not in the archiveFrom: Karthikeyan Periyasamy <[email protected]>
In conf_tx() mac operation callback, we are truncating the tx params cw_min and cw_max due to lower data type cast. so modified the data type of cwmin and cwmax to avoid the trucation issue.
--- drivers/net/wireless/ath/ath11k/wmi.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/wireless/ath/ath11k/wmi.h +2 -2
@@ -4501,8 +4501,8 @@ struct wmi_wmm_params {struct wmi_wmm_params_arg {u8 acm;u8 aifs; -u8 cwmin; -u8 cwmax; +u16 cwmin; +u16 cwmax;u16 txop;u8 no_ack; };
Signature · 7 lines
2.7.4 _______________________________________________ ath11k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath11k
PATCH 6/10 ath11k: avoid WMM param truncation
In reply to a message not in the archiveFrom: Karthikeyan Periyasamy <[email protected]>
In conf_tx() mac operation callback, we are truncating the tx params cw_min and cw_max due to lower data type cast. so modified the data type of cwmin and cwmax to avoid the trucation issue.
--- drivers/net/wireless/ath/ath11k/wmi.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/wireless/ath/ath11k/wmi.h +2 -2
@@ -4501,8 +4501,8 @@ struct wmi_wmm_params {struct wmi_wmm_params_arg {u8 acm;u8 aifs; -u8 cwmin; -u8 cwmax; +u16 cwmin; +u16 cwmax;u16 txop;u8 no_ack; };
Signature · 1 line
2.7.4
PATCH 7/10 ath11k: remove unused tx ring counters
In reply to a message not in the archiveFrom: Pradeep Kumar Chitrapu <[email protected]>
remove unused counter to avoid taking locks inorder to optimize cpu load.
Using Flamegraph, cpu usage of ath11k_dp_tx() observed to be decreased from 5.58% to 3.74% with iperf traffic running with 80MHz bandwidth ap mode.
--- drivers/net/wireless/ath/ath11k/dp.h | 1 - drivers/net/wireless/ath/ath11k/dp_tx.c | 7 ------- 2 files changed, 8 deletions(-)
drivers/net/wireless/ath/ath11k/dp.h +0 -1
@@ -63,7 +63,6 @@ struct dp_tx_ring {struct dp_srng tcl_data_ring;struct dp_srng tcl_comp_ring;struct idr txbuf_idr; -u32 num_tx_pending;/* Protects txbuf_idr and num_pending */ spinlock_t tx_idr_lock; DECLARE_KFIFO_PTR(tx_status_fifo, struct hal_wbm_release_ring);
drivers/net/wireless/ath/ath11k/dp_tx.c +0 -7
@@ -196,10 +196,6 @@ int ath11k_dp_tx(struct ath11k *ar, struct ath11k_vif *arvif,spin_unlock_bh (&tcl_ring->lock); -spin_lock_bh (&tx_ring->tx_idr_lock); - tx_ring->num_tx_pending++; -spin_unlock_bh (&tx_ring->tx_idr_lock); -atomic_inc (&ar->dp.num_tx_pending);return 0 ;
@@ -236,7 +232,6 @@ static void ath11k_dp_tx_free_txbuf(struct ath11k_base *ab, u8 mac_id, skb_cb =ATH11K_SKB_CB (msdu);idr_remove (&tx_ring->txbuf_idr, msdu_id); - tx_ring->num_tx_pending--;spin_unlock_bh (&tx_ring->tx_idr_lock);dma_unmap_single (ab->dev, skb_cb->paddr, msdu->len,DMA_TO_DEVICE );
@@ -272,7 +267,6 @@ ath11k_dp_tx_htt_tx_complete_buf(struct ath11k_base *ab, ar = skb_cb->ar;idr_remove (&tx_ring->txbuf_idr, ts->msdu_id); - tx_ring->num_tx_pending--;spin_unlock_bh (&tx_ring->tx_idr_lock);if (atomic_dec_and_test (&ar->dp.num_tx_pending))
@@ -495,7 +489,6 @@ void ath11k_dp_tx_completion_handler(struct ath11k_base *ab, int ring_id)continue ; }idr_remove (&tx_ring->txbuf_idr, msdu_id); - tx_ring->num_tx_pending--;spin_unlock_bh (&tx_ring->tx_idr_lock); ar = ab->pdevs[mac_id].ar;
Signature · 7 lines
2.7.4 _______________________________________________ ath11k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath11k
PATCH 7/10 ath11k: remove unused tx ring counters
In reply to a message not in the archiveFrom: Pradeep Kumar Chitrapu <[email protected]>
remove unused counter to avoid taking locks inorder to optimize cpu load.
Using Flamegraph, cpu usage of ath11k_dp_tx() observed to be decreased from 5.58% to 3.74% with iperf traffic running with 80MHz bandwidth ap mode.
--- drivers/net/wireless/ath/ath11k/dp.h | 1 - drivers/net/wireless/ath/ath11k/dp_tx.c | 7 ------- 2 files changed, 8 deletions(-)
drivers/net/wireless/ath/ath11k/dp.h +0 -1
@@ -63,7 +63,6 @@ struct dp_tx_ring {struct dp_srng tcl_data_ring;struct dp_srng tcl_comp_ring;struct idr txbuf_idr; -u32 num_tx_pending;/* Protects txbuf_idr and num_pending */ spinlock_t tx_idr_lock; DECLARE_KFIFO_PTR(tx_status_fifo, struct hal_wbm_release_ring);
drivers/net/wireless/ath/ath11k/dp_tx.c +0 -7
@@ -196,10 +196,6 @@ int ath11k_dp_tx(struct ath11k *ar, struct ath11k_vif *arvif,spin_unlock_bh (&tcl_ring->lock); -spin_lock_bh (&tx_ring->tx_idr_lock); - tx_ring->num_tx_pending++; -spin_unlock_bh (&tx_ring->tx_idr_lock); -atomic_inc (&ar->dp.num_tx_pending);return 0 ;
@@ -236,7 +232,6 @@ static void ath11k_dp_tx_free_txbuf(struct ath11k_base *ab, u8 mac_id, skb_cb =ATH11K_SKB_CB (msdu);idr_remove (&tx_ring->txbuf_idr, msdu_id); - tx_ring->num_tx_pending--;spin_unlock_bh (&tx_ring->tx_idr_lock);dma_unmap_single (ab->dev, skb_cb->paddr, msdu->len,DMA_TO_DEVICE );
@@ -272,7 +267,6 @@ ath11k_dp_tx_htt_tx_complete_buf(struct ath11k_base *ab, ar = skb_cb->ar;idr_remove (&tx_ring->txbuf_idr, ts->msdu_id); - tx_ring->num_tx_pending--;spin_unlock_bh (&tx_ring->tx_idr_lock);if (atomic_dec_and_test (&ar->dp.num_tx_pending))
@@ -495,7 +489,6 @@ void ath11k_dp_tx_completion_handler(struct ath11k_base *ab, int ring_id)continue ; }idr_remove (&tx_ring->txbuf_idr, msdu_id); - tx_ring->num_tx_pending--;spin_unlock_bh (&tx_ring->tx_idr_lock); ar = ab->pdevs[mac_id].ar;
Signature · 1 line
2.7.4
PATCH 8/10 ath11k: Fix skb_panic observed during msdu coalescing
In reply to a message not in the archiveFrom: Sriram R <[email protected]>
skb_panic is hit during msdu coalescing whenever enough tailroom is not allocated based on the remaining msdu length which is spread across in different rx buffers.
Compute the extra length for resizing the skb based on the total msdu length and the msdu length of the first buffer.
--- drivers/net/wireless/ath/ath11k/dp_rx.c | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-)
drivers/net/wireless/ath/ath11k/dp_rx.c +14 -8
@@ -1344,15 +1344,22 @@ static int ath11k_dp_rx_msdu_coalesce(struct ath11k *ar, {struct sk_buff *skb;struct ath11k_skb_rxcb *rxcb =ATH11K_SKB_RXCB (first); +int buf_first_hdr_len, buf_first_len;struct hal_rx_desc *ldesc;int space_extra;int rem_len;int buf_len; -if (WARN_ON_ONCE (msdu_len <= (DP_RX_BUFFER_SIZE - - (HAL_RX_DESC_SIZE + l3pad_bytes)))) { -skb_put (first,HAL_RX_DESC_SIZE + l3pad_bytes + msdu_len); -skb_pull (first,HAL_RX_DESC_SIZE + l3pad_bytes); +/* As the msdu is spread across multiple rx buffers, +* find the offset to the start of msdu for computing +* the length of the msdu in the first buffer. +*/ + buf_first_hdr_len =HAL_RX_DESC_SIZE + l3pad_bytes; + buf_first_len =DP_RX_BUFFER_SIZE - buf_first_hdr_len; + +if (WARN_ON_ONCE (msdu_len <= buf_first_len)) { +skb_put (first, buf_first_hdr_len + msdu_len); +skb_pull (first, buf_first_hdr_len);return 0 ; }
@@ -1365,9 +1372,9 @@ static int ath11k_dp_rx_msdu_coalesce(struct ath11k *ar,* in the first buf is of length DP_RX_BUFFER_SIZE - HAL_RX_DESC_SIZE. */ skb_put (first,DP_RX_BUFFER_SIZE ); -skb_pull (first,HAL_RX_DESC_SIZE + l3pad_bytes); +skb_pull (first, buf_first_hdr_len); - space_extra = msdu_len - (DP_RX_BUFFER_SIZE +skb_tailroom (first)); + space_extra = msdu_len - (buf_first_len +skb_tailroom (first));if (space_extra >0 && (pskb_expand_head (first,0 , space_extra,GFP_ATOMIC ) <0 )) {/* Free up all buffers of the MSDU */
@@ -1387,8 +1394,7 @@ static int ath11k_dp_rx_msdu_coalesce(struct ath11k *ar,*/ ath11k_dp_rx_desc_end_tlv_copy (rxcb->rx_desc, ldesc); - rem_len = msdu_len - - (DP_RX_BUFFER_SIZE -HAL_RX_DESC_SIZE - l3pad_bytes); + rem_len = msdu_len - buf_first_len;while ((skb =__skb_dequeue (msdu_list)) !=NULL && rem_len >0 ) { rxcb =ATH11K_SKB_RXCB (skb);if (rxcb->is_continuation)
Signature · 7 lines
2.7.4 _______________________________________________ ath11k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath11k
PATCH 8/10 ath11k: Fix skb_panic observed during msdu coalescing
In reply to a message not in the archiveFrom: Sriram R <[email protected]>
skb_panic is hit during msdu coalescing whenever enough tailroom is not allocated based on the remaining msdu length which is spread across in different rx buffers.
Compute the extra length for resizing the skb based on the total msdu length and the msdu length of the first buffer.
--- drivers/net/wireless/ath/ath11k/dp_rx.c | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-)
drivers/net/wireless/ath/ath11k/dp_rx.c +14 -8
@@ -1344,15 +1344,22 @@ static int ath11k_dp_rx_msdu_coalesce(struct ath11k *ar, {struct sk_buff *skb;struct ath11k_skb_rxcb *rxcb =ATH11K_SKB_RXCB (first); +int buf_first_hdr_len, buf_first_len;struct hal_rx_desc *ldesc;int space_extra;int rem_len;int buf_len; -if (WARN_ON_ONCE (msdu_len <= (DP_RX_BUFFER_SIZE - - (HAL_RX_DESC_SIZE + l3pad_bytes)))) { -skb_put (first,HAL_RX_DESC_SIZE + l3pad_bytes + msdu_len); -skb_pull (first,HAL_RX_DESC_SIZE + l3pad_bytes); +/* As the msdu is spread across multiple rx buffers, +* find the offset to the start of msdu for computing +* the length of the msdu in the first buffer. +*/ + buf_first_hdr_len =HAL_RX_DESC_SIZE + l3pad_bytes; + buf_first_len =DP_RX_BUFFER_SIZE - buf_first_hdr_len; + +if (WARN_ON_ONCE (msdu_len <= buf_first_len)) { +skb_put (first, buf_first_hdr_len + msdu_len); +skb_pull (first, buf_first_hdr_len);return 0 ; }
@@ -1365,9 +1372,9 @@ static int ath11k_dp_rx_msdu_coalesce(struct ath11k *ar,* in the first buf is of length DP_RX_BUFFER_SIZE - HAL_RX_DESC_SIZE. */ skb_put (first,DP_RX_BUFFER_SIZE ); -skb_pull (first,HAL_RX_DESC_SIZE + l3pad_bytes); +skb_pull (first, buf_first_hdr_len); - space_extra = msdu_len - (DP_RX_BUFFER_SIZE +skb_tailroom (first)); + space_extra = msdu_len - (buf_first_len +skb_tailroom (first));if (space_extra >0 && (pskb_expand_head (first,0 , space_extra,GFP_ATOMIC ) <0 )) {/* Free up all buffers of the MSDU */
@@ -1387,8 +1394,7 @@ static int ath11k_dp_rx_msdu_coalesce(struct ath11k *ar,*/ ath11k_dp_rx_desc_end_tlv_copy (rxcb->rx_desc, ldesc); - rem_len = msdu_len - - (DP_RX_BUFFER_SIZE -HAL_RX_DESC_SIZE - l3pad_bytes); + rem_len = msdu_len - buf_first_len;while ((skb =__skb_dequeue (msdu_list)) !=NULL && rem_len >0 ) { rxcb =ATH11K_SKB_RXCB (skb);if (rxcb->is_continuation)
Signature · 1 line
2.7.4
PATCH 9/10 ath11k: Fixing TLV length issue in peer pktlog WMI command
In reply to a message not in the archiveFrom: Vikas Patel <[email protected]>
TLV length was 0 for TLV tag 'WMI_TAG_ARRAY_STRUCT' causing Q6 to crash when trying to configure pktlog filter via debugfs.
--- drivers/net/wireless/ath/ath11k/wmi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/ath/ath11k/wmi.c +1 -1
@@ -2329,7 +2329,7 @@ int ath11k_wmi_pdev_peer_pktlog_filter(struct ath11k *ar, u8 *addr, u8 enable) tlv = ptr; tlv->header =FIELD_PREP (WMI_TLV_TAG ,WMI_TAG_ARRAY_STRUCT ) | -FIELD_PREP (WMI_TLV_LEN ,0 ); +FIELD_PREP (WMI_TLV_LEN ,sizeof (*info)); ptr +=TLV_HDR_SIZE ; info = ptr;
Signature · 1 line
2.7.4
PATCH 9/10 ath11k: Fixing TLV length issue in peer pktlog WMI command
In reply to a message not in the archiveFrom: Vikas Patel <[email protected]>
TLV length was 0 for TLV tag 'WMI_TAG_ARRAY_STRUCT' causing Q6 to crash when trying to configure pktlog filter via debugfs.
--- drivers/net/wireless/ath/ath11k/wmi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/ath/ath11k/wmi.c +1 -1
@@ -2329,7 +2329,7 @@ int ath11k_wmi_pdev_peer_pktlog_filter(struct ath11k *ar, u8 *addr, u8 enable) tlv = ptr; tlv->header =FIELD_PREP (WMI_TLV_TAG ,WMI_TAG_ARRAY_STRUCT ) | -FIELD_PREP (WMI_TLV_LEN ,0 ); +FIELD_PREP (WMI_TLV_LEN ,sizeof (*info)); ptr +=TLV_HDR_SIZE ; info = ptr;
Signature · 7 lines
2.7.4 _______________________________________________ ath11k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath11k
PATCH 10/10 ath11k: Fix target crash due to WBM_IDLE_LINK ring desc shortage
In reply to a message not in the archiveFrom: Vasanthakumar Thiagarajan <[email protected]>
Make sure the number of WBM_IDLE_LINK ring descriptors is power of 2. This increases the number of descriptors to 32k from the current ~18k to fix the target assert because of the shortage in the descriptors in WBM_IDLE_LINK ring. Remove unnecessary power of 2 calculation in ath11k_dp_link_desc_setup() as it is not required after this change.
--- drivers/net/wireless/ath/ath11k/dp.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/net/wireless/ath/ath11k/dp.c +3 -3
@@ -478,6 +478,9 @@ static int ath11k_wbm_idle_ring_setup(struct ath11k_base *ab, u32 *n_link_desc) *n_link_desc = n_mpdu_link_desc + n_mpdu_queue_desc + n_tx_msdu_link_desc + n_rx_msdu_link_desc; +if (*n_link_desc & (*n_link_desc -1 )) + *n_link_desc =1 <<fls (*n_link_desc); + ret =ath11k_dp_srng_setup (ab, &dp->wbm_idle_ring,HAL_WBM_IDLE_LINK ,0 ,0 , *n_link_desc);if (ret) {
@@ -499,9 +502,6 @@ int ath11k_dp_link_desc_setup(struct ath11k_base *ab,u32 *desc;int i, ret; -if (n_link_desc & (n_link_desc -1 )) - n_link_desc =1 <<fls (n_link_desc); - tot_mem_sz = n_link_desc *HAL_LINK_DESC_SIZE ; tot_mem_sz +=HAL_LINK_DESC_ALIGN ;
Signature · 7 lines
2.7.4 _______________________________________________ ath11k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath11k
PATCH 10/10 ath11k: Fix target crash due to WBM_IDLE_LINK ring desc shortage
In reply to a message not in the archiveFrom: Vasanthakumar Thiagarajan <[email protected]>
Make sure the number of WBM_IDLE_LINK ring descriptors is power of 2. This increases the number of descriptors to 32k from the current ~18k to fix the target assert because of the shortage in the descriptors in WBM_IDLE_LINK ring. Remove unnecessary power of 2 calculation in ath11k_dp_link_desc_setup() as it is not required after this change.
--- drivers/net/wireless/ath/ath11k/dp.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/net/wireless/ath/ath11k/dp.c +3 -3
@@ -478,6 +478,9 @@ static int ath11k_wbm_idle_ring_setup(struct ath11k_base *ab, u32 *n_link_desc) *n_link_desc = n_mpdu_link_desc + n_mpdu_queue_desc + n_tx_msdu_link_desc + n_rx_msdu_link_desc; +if (*n_link_desc & (*n_link_desc -1 )) + *n_link_desc =1 <<fls (*n_link_desc); + ret =ath11k_dp_srng_setup (ab, &dp->wbm_idle_ring,HAL_WBM_IDLE_LINK ,0 ,0 , *n_link_desc);if (ret) {
@@ -499,9 +502,6 @@ int ath11k_dp_link_desc_setup(struct ath11k_base *ab,u32 *desc;int i, ret; -if (n_link_desc & (n_link_desc -1 )) - n_link_desc =1 <<fls (n_link_desc); - tot_mem_sz = n_link_desc *HAL_LINK_DESC_SIZE ; tot_mem_sz +=HAL_LINK_DESC_ALIGN ;
Signature · 1 line
2.7.4