linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Marlon Smith <marlon.smith10@gmail.com>
To: Felix Fietkau <nbd@nbd.name>,
	Ben Greear <greearb@candelatech.com>,
	linux-wireless@vger.kernel.org
Subject: Re: Strange performance issue when using two devices at once
Date: Thu, 30 Jan 2020 11:04:06 -0500	[thread overview]
Message-ID: <1580400246.26012.88.camel@gmail.com> (raw)
In-Reply-To: <0c80b739-b190-1a33-47d1-a04692a948c7@nbd.name>

On Thu, 2020-01-30 at 16:32 +0100, Felix Fietkau wrote:
> On 2020-01-30 15:43, Marlon Smith wrote:
> > 
> > So I did a few tests and got some pretty interesting results.
> > 
> > With the two devices connected to the access point and performing
> > slowly, I changed the MAC address of one of the devices (Just from
> > a B6
> > to a BA). Immediately, both devices began working properly!
> > 
> > Back to the original MAC address, I looked at my sniffer, and I do
> > not
> > see any evidence of one device acking another device's frames. With
> > one
> > device sitting idle and the other transferring data, I see high
> > numbers
> > of retransmitted frames, and then an eventual ack from the correct
> > device, but very little activity from the idle device. While this
> > is
> > happening, the device driver indicates that it is dropping lots of
> > duplicate received packets.
> Here's the cause and an approach for fixing it:
> 
> The MAC_BSSID_DW1 register configures the Multi-BSSID mode. It can be
> configured for 1, 2, 4 or 8 BSSIDs. This controls what MAC addresses
> the
> chip will respond to. The driver always sets it up for 8 BSSIDs.
> 
> The problem here is that the chip has a hardcoded pattern for how
> those
> BSSIDs are allocated:
> Depending on the number of BSSIDs, the lower 1, 2 or 3 bits are used
> to
> encode the BSS index. This means that when 8 BSSIDs are enabled, the
> lower 3 bits are effectively masked out on the MAC address filter
> that
> decides which frames to ACK. Because your MAC addresses are so close
> together, both devices try to ACK the same frames at the same time.
> This
> will not be visible in a sniffer, since they will be transmitting at
> the
> same time.
> 
> I'd say the first step in fixing this is to make the driver set
> MAC_BSSID_DW1_BSS_ID_MASK based on the MAC addresses of configured
> virtual interfaces. For older chips, this MAC address pattern cannot
> be
> fixed.
> 
> However, on at least RT3883, RT3352 and RT5350 (and thus most likely
> also RT5370), you can set BIT 21 in that register, which changes the
> pattern. With that bit set, the second interface only sets the local
> bit
> of the MAC address, and from the third interface on it adds (idx-
> 1)<<2
> to the first byte. That gets rid of the MAC address conflicts.
> 
> Hopefully someone familiar with the rt2x00 code will read this and
> write
> some patches :)
> 
> - Felix


Felix, this was exactly it. I set that bit and the problem disappeared.
Thank you so much!

Ben, your help was very much appreciated as well. Your suggestions
really helped narrow things down.

Is there a way I can help others who might come across this problem in
the future? Would filing a bug report help anyone out, even if just to
document this issue?

Thanks again both of you, you saved me countless hours of time here.

Marlon

  reply	other threads:[~2020-01-30 16:04 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-29 18:39 Strange performance issue when using two devices at once Marlon Smith
2020-01-29 18:42 ` Ben Greear
2020-01-29 19:22   ` Marlon Smith
2020-01-29 19:27     ` Ben Greear
2020-01-29 19:48       ` Marlon Smith
2020-01-29 20:01         ` Ben Greear
2020-01-29 20:49           ` Marlon Smith
2020-01-30 14:43           ` Marlon Smith
2020-01-30 15:32             ` Felix Fietkau
2020-01-30 16:04               ` Marlon Smith [this message]
2020-01-30 14:55 ` Jean-Pierre TOSONI
2020-01-30 15:26   ` Marlon Smith

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=1580400246.26012.88.camel@gmail.com \
    --to=marlon.smith10@gmail.com \
    --cc=greearb@candelatech.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=nbd@nbd.name \
    /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).