linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ben Greear <greearb@candelatech.com>
To: linux-wireless@vger.kernel.org
Subject: Re: [PATCH-v2 1/6] mac80211: Fix station rx-packets counters.
Date: Wed, 31 Mar 2021 21:26:15 -0700	[thread overview]
Message-ID: <e6efe308-6359-a715-7766-b1bcc992d828@candelatech.com> (raw)
In-Reply-To: <20210324181441.13755-1-greearb@candelatech.com>

On 3/24/21 11:14 AM, greearb@candelatech.com wrote:
> From: Ben Greear <greearb@candelatech.com>
> 
> I noticed 'iw dev wlan6 station dump' showed almost no rx-packets
> one one of my radios.  The rx-amsdu path did not appear to gather
> any stats, and after code inspection, neither did the rx-data
> handler.
> 
> Add common method to deal with these stats.  Verified in AX
> and /a mode, stats look at least generally correct now.
> 
> Signed-off-by: Ben Greear <greearb@candelatech.com>
> ---

> @@ -2706,6 +2727,8 @@ ieee80211_rx_h_amsdu(struct ieee80211_rx_data *rx)
>   	struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(skb);
>   	struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
>   	__le16 fc = hdr->frame_control;
> +	ieee80211_rx_result rv;
> +	int orig_len = skb->len;
>   
>   	if (!(status->rx_flags & IEEE80211_RX_AMSDU))
>   		return RX_CONTINUE;
> @@ -2734,7 +2757,12 @@ ieee80211_rx_h_amsdu(struct ieee80211_rx_data *rx)
>   	if (is_multicast_ether_addr(hdr->addr1))
>   		return RX_DROP_UNUSABLE;
>   
> -	return __ieee80211_rx_h_amsdu(rx, 0);
> +	rv = __ieee80211_rx_h_amsdu(rx, 0);
> +	if ((rv == RX_QUEUED) && (rx->sta)) {
> +		struct ieee80211_sta_rx_stats *stats = &rx->sta->rx_stats;
> +		ieee80211_update_data_rx_stats(rx, stats, status, orig_len);
> +	}
> +	return rv;
>   }

I noticed this is buggy in several ways (potential use-after-free, bogus
status field).

I noticed too that upcoming changes changed some API that made later patches
in this series not apply cleanly..needed a bit of re-work.

Maybe best if I wait and rebase it against 5.13 when it is ready, unless
someone is actually interested enough in this to want to apply it earlier?

Thanks,
Ben

-- 
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc  http://www.candelatech.com

      parent reply	other threads:[~2021-04-01  4:27 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-24 18:14 [PATCH-v2 1/6] mac80211: Fix station rx-packets counters greearb
2021-03-24 18:14 ` [PATCH-v2 2/6] mac80211: Provide per-station stats in debugfs greearb
2021-03-24 18:14 ` [PATCH-v2 3/6] mac80211: Provide detailed station rx stats greearb
2021-03-24 18:14 ` [PATCH-v2 4/6] mac80211: Add counters for specific HE encoding types greearb
2021-03-24 18:14 ` [PATCH-v2 5/6] mac80211: Add some additional tx-stats to debugfs greearb
2021-03-24 18:14 ` [PATCH-v2 6/6] mac80211: last_rate is 32-bit number greearb
2021-04-01  4:26 ` Ben Greear [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e6efe308-6359-a715-7766-b1bcc992d828@candelatech.com \
    --to=greearb@candelatech.com \
    --cc=linux-wireless@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).