ath11k.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: Thiraviyam Mariyappan <tmariyap@codeaurora.org>,
	ath11k@lists.infradead.org
Cc: linux-wireless@vger.kernel.org
Subject: Re: [PATCH] mac80211: fix rx byte values not updated on mesh link
Date: Wed, 02 Dec 2020 09:23:57 +0100	[thread overview]
Message-ID: <9b1543d8798277bbfc891b794362451432d98884.camel@sipsolutions.net> (raw)
In-Reply-To: <1606884912-10987-1-git-send-email-tmariyap@codeaurora.org> (sfid-20201202_055729_704309_A90E5928)

On Wed, 2020-12-02 at 10:25 +0530, Thiraviyam Mariyappan wrote:
> In mesh link, rx byte values were not updating though rx packets keep
> increasing in the station dump. This is because of rx_stats were updated
> regardless of USES_RSS flag is enabled/disabled. Solved the issue by
> updating the rx_stats from percpu pointers according to the USES_RSS flag

You should write commit logs in imperative voice, e.g. "Solve the
issue..."

> +++ b/net/mac80211/rx.c
> @@ -2212,6 +2212,7 @@ ieee80211_rx_h_defragment(struct ieee80211_rx_data *rx)
>  	unsigned int frag, seq;
>  	struct ieee80211_fragment_entry *entry;
>  	struct sk_buff *skb;
> +	struct ieee80211_sta_rx_stats *stats;
>  
>  	hdr = (struct ieee80211_hdr *)rx->skb->data;
>  	fc = hdr->frame_control;
> @@ -2340,8 +2341,12 @@ ieee80211_rx_h_defragment(struct ieee80211_rx_data *rx)
>   out:
>  	ieee80211_led_rx(rx->local);
>   out_no_led:
> -	if (rx->sta)
> -		rx->sta->rx_stats.packets++;
> +	if (rx->sta) {
> +		stats = &rx->sta->rx_stats;
> +		if (ieee80211_hw_check(&rx->sdata->local->hw, USES_RSS))
> +			stats = this_cpu_ptr(rx->sta->pcpu_rx_stats);
> +		stats->packets++;
> +	}
>  	return RX_CONTINUE;
> 

This is certainly not only related to mesh, so the commit log is wrong.

Also, let's not copy/paste this code so much ...

johannes


-- 
ath11k mailing list
ath11k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath11k

      reply	other threads:[~2020-12-02  8:24 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-02  4:55 [PATCH] mac80211: fix rx byte values not updated on mesh link Thiraviyam Mariyappan
2020-12-02  8:23 ` Johannes Berg [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=9b1543d8798277bbfc891b794362451432d98884.camel@sipsolutions.net \
    --to=johannes@sipsolutions.net \
    --cc=ath11k@lists.infradead.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=tmariyap@codeaurora.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).