On 2021-04-23 13:28, Johannes Berg wrote:
On Wed, 2021-04-21 at 22:18 +0530, Thiraviyam Mariyappan wrote:
In case of Mesh fast_rx is not applicable, but still USES_RSS can be
enabled from driver when parallel RX is supported by HW/Driver,
right?
Yes, I guess that's true.
Hence checked for USES_RSS support to update per cpu stats.Please
correct me if the meaning of USES_RSS is misunderstood and it applies
only when fast_rx for a STA is enabled.
Well, actually using multi-queue is pointless or even
counter-productive
when you don't have fast-RX, since then you'll run into a common lock,
and doing much processing on multiple CPUs but under a common lock
might
well be worse than doing it on a single CPU in the first place, since
you'll bounce the lock around all the time.
However, you're right that the driver might generally advertise
USES_RSS, but then not do it for mesh, but that throws off some
statistics.
Something like this might then be a much better fix though?
Below fix good to me and working fine.
diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c
index ec6973ee88ef..f87e883862d9 100644
--- a/net/mac80211/sta_info.c
+++ b/net/mac80211/sta_info.c
@@ -2092,7 +2092,7 @@ sta_get_last_rx_stats(struct sta_info *sta)
struct ieee80211_local *local = sta->local;
int cpu;
- if (!ieee80211_hw_check(&local->hw, USES_RSS))
+ if (!sta->pcpu_rx_stats)
return stats;
for_each_possible_cpu(cpu) {
@@ -2192,9 +2192,7 @@ static void sta_set_tidstats(struct sta_info
*sta,
int cpu;
if (!(tidstats->filled & BIT(NL80211_TID_STATS_RX_MSDU))) {
- if (!ieee80211_hw_check(&local->hw, USES_RSS))
- tidstats->rx_msdu +=
- sta_get_tidstats_msdu(&sta->rx_stats, tid);
+ tidstats->rx_msdu += sta_get_tidstats_msdu(&sta->rx_stats, tid);
if (sta->pcpu_rx_stats) {
for_each_possible_cpu(cpu) {
@@ -2308,8 +2306,7 @@ void sta_set_sinfo(struct sta_info *sta, struct
station_info *sinfo,
if (!(sinfo->filled & (BIT_ULL(NL80211_STA_INFO_RX_BYTES64) |
BIT_ULL(NL80211_STA_INFO_RX_BYTES)))) {
- if (!ieee80211_hw_check(&local->hw, USES_RSS))
- sinfo->rx_bytes += sta_get_stats_bytes(&sta->rx_stats);
+ sinfo->rx_bytes += sta_get_stats_bytes(&sta->rx_stats);
if (sta->pcpu_rx_stats) {
for_each_possible_cpu(cpu) {
johannes