wlan-ap-Telecominfraproject/feeds/ipq95xx/mac80211/patches/qca/720-d-ath12k-Avoid-initialization-of-all-the-variables-ear.patch
John Crispin 144c5d00f4 ipq95xx/mac80211: update to ATH12.3-CS
Signed-off-by: John Crispin <john@phrozen.org>
2024-02-28 18:56:21 +01:00

119 lines
4.2 KiB
Diff

From 7a5c34b80622fc7003228ff8b0ce0c09b389c60f Mon Sep 17 00:00:00 2001
From: Ramanathan Choodamani <quic_rchoodam@quicinc.com>
Date: Wed, 8 Mar 2023 09:19:50 -0800
Subject: [PATCH 4/6] ath12k: Avoid initialization of all the
variables early in the function
Intializing all the variables takes cpu. Avoid it earlier in the function
and initialize it just before use. All the variables do not need to be
initialized to enter fast xmit path
Signed-off-by: Balamurugan Mahalingam <quic_bmahalin@quicinc.com>
Signed-off-by: Ramanathan Choodamani <quic_rchoodam@quicinc.com>
---
drivers/net/wireless/ath/ath12k/dp_tx.c | 7 ++++---
drivers/net/wireless/ath/ath12k/mac.c | 30 +++++++++++++++++++++---------
2 files changed, 25 insertions(+), 12 deletions(-)
--- a/drivers/net/wireless/ath/ath12k/dp_tx.c
+++ b/drivers/net/wireless/ath/ath12k/dp_tx.c
@@ -155,14 +155,14 @@ static int ath12k_dp_prepare_htt_metadat
int ath12k_dp_tx_direct(struct ath12k_link_vif *arvif, struct sk_buff *skb)
{
struct ath12k *ar = arvif->ar;
- struct ath12k_base *ab = arvif->ar->ab;
+ struct ath12k_base *ab = ar->ab;
struct ath12k_dp *dp = &ab->dp;
struct ath12k_tx_desc_info *tx_desc = NULL;
struct ath12k_skb_cb *skb_cb = ATH12K_SKB_CB(skb);
struct hal_srng *tcl_ring;
struct dp_tx_ring *tx_ring;
void *hal_tcl_desc;
- struct hal_tcl_data_cmd tcl_desc = { 0 };
+ struct hal_tcl_data_cmd tcl_desc;
u8 hal_ring_id, ring_id;
int ret;
@@ -218,6 +218,7 @@ int ath12k_dp_tx_direct(struct ath12k_li
tcl_desc.info3 = arvif->desc.info3;
tcl_desc.info4 = arvif->desc.info4;
+ tcl_desc.info5 = 0;
memcpy(hal_tcl_desc, &tcl_desc, sizeof(tcl_desc));
dsb(st);
ath12k_hal_srng_access_umac_src_ring_end_nolock(ab->mem, tcl_ring);
--- a/drivers/net/wireless/ath/ath12k/mac.c
+++ b/drivers/net/wireless/ath/ath12k/mac.c
@@ -8465,23 +8465,23 @@ static void ath12k_mac_op_tx(struct ieee
struct ieee80211_tx_control *control,
struct sk_buff *skb)
{
- struct ath12k_skb_cb *skb_cb = ATH12K_SKB_CB(skb);
- struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
- struct ieee80211_vif *vif = info->control.vif;
- struct ath12k_vif *ahvif = ath12k_vif_to_ahvif(vif);
+ struct ath12k_skb_cb *skb_cb;
+ struct ieee80211_tx_info *info;
+ struct ieee80211_vif *vif;
+ struct ath12k_vif *ahvif;
struct ath12k_link_vif *arvif, *tmp_arvif;
struct ath12k *ar, *tmp_ar;
struct ath12k_hw *ah;
- struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
+ struct ieee80211_hdr *hdr;
struct ethhdr *eth = (struct ethhdr *)skb->data;
- struct ieee80211_key_conf *key = info->control.hw_key;
- struct ath12k_mgmt_frame_stats *mgmt_stats = &ahvif->mgmt_stats;
+ struct ieee80211_key_conf *key;
+ struct ath12k_mgmt_frame_stats *mgmt_stats;
struct ath12k_sta *ahsta = NULL;
struct sk_buff *msdu_copied;
struct ath12k_link_sta *arsta = NULL;
struct ieee80211_sta *sta = NULL;
struct ath12k_peer *peer;
- u32 info_flags = info->flags;
+ u32 info_flags;
bool is_prb_rsp;
bool is_mcast = false;
bool gsn_valid;
@@ -8489,7 +8489,13 @@ static void ath12k_mac_op_tx(struct ieee
u8 link_id;
u16 mcbc_gsn;
int ret;
- u8 link = u32_get_bits(info->control.flags, IEEE80211_TX_CTRL_MLO_LINK);
+ u8 link;
+
+ info = IEEE80211_SKB_CB(skb);
+ vif = info->control.vif;
+ ahvif = ath12k_vif_to_ahvif(vif);
+ link = u32_get_bits(info->control.flags, IEEE80211_TX_CTRL_MLO_LINK);
+ info_flags = info->flags;
if (control)
sta = control->sta;
@@ -8499,6 +8505,8 @@ static void ath12k_mac_op_tx(struct ieee
return;
}
+ skb_cb = ATH12K_SKB_CB(skb);
+ key = info->control.hw_key;
memset(skb_cb, 0, sizeof(*skb_cb));
skb_cb->vif = vif;
/* handle only for MLO case, use deflink for non MLO case */
@@ -8543,12 +8551,15 @@ static void ath12k_mac_op_tx(struct ieee
skb_cb->flags |= ATH12K_SKB_CIPHER_SET;
}
+ hdr = (struct ieee80211_hdr *)skb->data;
+
if (info_flags & IEEE80211_TX_CTL_HW_80211_ENCAP) {
skb_cb->flags |= ATH12K_SKB_HW_80211_ENCAP;
is_mcast = is_multicast_ether_addr(eth->h_dest);
} else if (ieee80211_is_mgmt(hdr->frame_control)) {
frm_type = FIELD_GET(IEEE80211_FCTL_STYPE, hdr->frame_control);
is_prb_rsp = ieee80211_is_probe_resp(hdr->frame_control);
+ mgmt_stats = &ahvif->mgmt_stats;
ret = ath12k_mac_mgmt_tx(ar, skb, is_prb_rsp);
if (ret) {
if (ret != -EBUSY)