wlan-ap-Telecominfraproject/feeds/ipq807x/mac80211/patches/192-ath11k-fix-rx-bytes-value-not-updated-on-mesh.patch
John Crispin 3affbc1cad QualComm/AX: add Hawkeye and Cypress support
This series is based on
* 2020-07-10 ipq6018-ilq-11-0_qca_oem-034672b0676c37b1f4519e5720e18e95fe6236ef

Add support for
* qsdk kernel/v4.4
* qsdk ethernet subsystem
* v5.7 ath11k backport + QualComm staging patches (wlan_ap_1.0)
* ath11k-firmware
* hostapd/iw/...

Feature support
* full boot, system detection
* sysupgrade to nand
* HE support via latest hostapd
* driver support for usb, crypto, hwmon, cpufreq, ...

Missing
* NSS/HW flow offloading - FW blob is not redistributable

Using the qsdk v4.4 is an intermediate solution while the vanilla is being
tested. Vanilla kernel is almost on feature par. Work has already started
to upstream the ethernet and switch drivers. Once complete the target will
be fully upstream.

Signed-off-by: John Crispin <john@phrozen.org>
2020-07-23 18:54:03 +02:00

112 lines
3.7 KiB
Diff

From 7f711a26742fffdcf10cda6089b2442f1da4db60 Mon Sep 17 00:00:00 2001
From: Thiraviyam Mariyappan <tmariyap@codeaurora.org>
Date: Wed, 17 Jun 2020 11:19:32 +0530
Subject: [PATCH] mac80211: fix rx bytes values not updated on mesh link
Previously, for mesh link the rx stats from pcpu is not
updating. Due to this, rx bytes are not updated. Fixing
that by updating the rx stats from pcpu rx stats
Signed-off-by: Thiraviyam Mariyappan <tmariyap@codeaurora.org>
---
net/mac80211/rx.c | 27 ++++++++++++++++-----------
1 file changed, 16 insertions(+), 11 deletions(-)
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -1744,11 +1744,18 @@ ieee80211_rx_h_sta_process(struct ieee80
struct sk_buff *skb = rx->skb;
struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(skb);
struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
+ struct ieee80211_local *local = rx->sdata->local;
+ struct ieee80211_sta_rx_stats *stats;
int i;
if (!sta)
return RX_CONTINUE;
+ stats = &sta->rx_stats;
+
+ if (ieee80211_hw_check(&local->hw, USES_RSS))
+ stats = this_cpu_ptr(sta->pcpu_rx_stats);
+
/*
* Update last_rx only for IBSS packets which are for the current
* BSSID and for station already AUTHORIZED to avoid keeping the
@@ -1758,51 +1765,51 @@ ieee80211_rx_h_sta_process(struct ieee80
* something went wrong the first time.
*/
if (rx->sdata->vif.type == NL80211_IFTYPE_ADHOC) {
- u8 *bssid = ieee80211_get_bssid(hdr, rx->skb->len,
+ u8 *bssid = ieee80211_get_bssid(hdr, skb->len,
NL80211_IFTYPE_ADHOC);
if (ether_addr_equal(bssid, rx->sdata->u.ibss.bssid) &&
test_sta_flag(sta, WLAN_STA_AUTHORIZED)) {
- sta->rx_stats.last_rx = jiffies;
+ stats->last_rx = jiffies;
if (ieee80211_is_data(hdr->frame_control) &&
!is_multicast_ether_addr(hdr->addr1))
- sta->rx_stats.last_rate =
+ stats->last_rate =
sta_stats_encode_rate(status);
}
} else if (rx->sdata->vif.type == NL80211_IFTYPE_OCB) {
- sta->rx_stats.last_rx = jiffies;
+ stats->last_rx = jiffies;
} else if (!is_multicast_ether_addr(hdr->addr1)) {
/*
* Mesh beacons will update last_rx when if they are found to
* match the current local configuration when processed.
*/
- sta->rx_stats.last_rx = jiffies;
+ stats->last_rx = jiffies;
if (ieee80211_is_data(hdr->frame_control))
- sta->rx_stats.last_rate = sta_stats_encode_rate(status);
+ stats->last_rate = sta_stats_encode_rate(status);
}
if (rx->sdata->vif.type == NL80211_IFTYPE_STATION)
ieee80211_sta_rx_notify(rx->sdata, hdr);
- sta->rx_stats.fragments++;
+ stats->fragments++;
- u64_stats_update_begin(&rx->sta->rx_stats.syncp);
- sta->rx_stats.bytes += rx->skb->len;
- u64_stats_update_end(&rx->sta->rx_stats.syncp);
+ u64_stats_update_begin(&stats->syncp);
+ stats->bytes += skb->len;
+ u64_stats_update_end(&stats->syncp);
if (!(status->flag & RX_FLAG_NO_SIGNAL_VAL)) {
- sta->rx_stats.last_signal = status->signal;
+ stats->last_signal = status->signal;
ewma_signal_add(&sta->rx_stats_avg.signal, -status->signal);
}
if (status->chains) {
- sta->rx_stats.chains = status->chains;
+ stats->chains = status->chains;
for (i = 0; i < ARRAY_SIZE(status->chain_signal); i++) {
int signal = status->chain_signal[i];
if (!(status->chains & BIT(i)))
continue;
- sta->rx_stats.chain_signal_last[i] = signal;
+ stats->chain_signal_last[i] = signal;
ewma_signal_add(&sta->rx_stats_avg.chain_signal[i],
-signal);
}
@@ -1862,8 +1869,8 @@ ieee80211_rx_h_sta_process(struct ieee80
* Update counter and free packet here to avoid
* counting this as a dropped packed.
*/
- sta->rx_stats.packets++;
- dev_kfree_skb(rx->skb);
+ stats->packets++;
+ dev_kfree_skb(skb);
return RX_QUEUED;
}