From: Sascha Hauer <s.hauer@pengutronix.de>
To: Brian Norris <briannorris@chromium.org>
Cc: Francesco Dolcini <francesco@dolcini.it>,
Kalle Valo <kvalo@kernel.org>,
linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org,
David Lin <yu-hao.lin@nxp.com>,
kernel@pengutronix.de, stable@vger.kernel.org
Subject: Re: [PATCH v2 02/12] wifi: mwifiex: fix MAC address handling
Date: Wed, 13 Nov 2024 15:44:28 +0100 [thread overview]
Message-ID: <ZzS7TKwPC1uxqzbg@pengutronix.de> (raw)
In-Reply-To: <ZwB3FCdpL85yA2Si@google.com>
Hi Brian,
It's been a while, but I'd like to get this forward now.
On Fri, Oct 04, 2024 at 04:15:32PM -0700, Brian Norris wrote:
> I think I'm generally supportive of the direction this changes things,
> but I'm a bit hesitant about two things:
> 1. the potential user-visible changes and
> 2. the linux-stable backport (Cc stable below)
>
> For 1: MAC addresses are important in some contexts, and this might
> significantly change the addresses that devices get in practice. Such
> users might not really care about the weird details of when the address
> incremented; but they *probably* care that a certain sequence of "boot
> device; run hostapd with <foo> config file" produces the same address.
>
> Also, I'm not sure I know enough of the implications of potential
> over-use of the locally administered bit. Are there significant
> downsides to it (aside from the simple fact that it's a different
> address)?
Not that I know of, but that doesn't mean much.
>
> And I see that you rightly don't know how many addresses are actually
> reserved, but I have an educated guess that it's not just 1.
Even if there are more addresses reserved, we don't know which these
are, see below.
> For one,
> this driver used to default-create 3 interfaces:
> 1211c961170c mwifiex: do not create AP and P2P interfaces upon driver loading
>
> and when we stopped doing that, we still kept support for a module
> parameter for the old way:
> 0013c7cebed6 mwifiex: module load parameter for interface creation
>
> Perhaps these "initial" interfaces should at least be allowed permanent
> addresses?
I started up a board with the downstream driver. It comes up with these
MAC addresses:
wlp1s0 Link encap:Ethernet HWaddr 34:6F:24:4E:E0:3D
uap0 Link encap:Ethernet HWaddr 36:6F:24:4E:E1:3D
wfd0 Link encap:Ethernet HWaddr 36:6F:24:4E:E0:3D
The permanent address from EEPROM is 34:6F:24:4E:E0:3D which is
used for wlp1s0. For the other addresses the locally admistered bit is
set (34 -> 36). Here's the corresponding code:
if (priv->bss_type == MLAN_BSS_TYPE_WIFIDIRECT) {
if (priv->bss_virtual) {
...
} else {
priv->current_addr[0] |= 0x02;
}
}
if (priv->bss_type != MLAN_BSS_TYPE_WIFIDIRECT) {
if (priv->bss_index) {
priv->current_addr[0] |= 0x02;
priv->current_addr[4] += priv->bss_index;
}
}
See https://github.com/nxp-imx/mwifiex/blob/lf-6.6.3_1.0.0/mxm_wifiex/wlan_src/mlinux/moal_main.c#L8383
Note this behaviour was changed in the driver in a0835444f1
("mxm_wifiex: update to mxm5x17344.p1 release"). Before that the driver
has just done a priv->current_addr[4] += priv->bss_index without
setting the locally admistered bit. Of course the commit message
says nothing about the reasons for this change.
The downstream driver puts the bss_num (or bss_index) into different
bits than the upstream driver does. It uses current_addr[4] whereas the
upstream driver uses current_addr[5]. So even when there's more than
one MAC address reserved for one chip, both drivers disagree on which
addresses these are.
Given that, I think our safest bet is to always set the locally
admistered bit for derived MAC addresses.
>
> So anyway, I don't really know for sure the right answer, but I want to
> log my concerns, in case you had more thoughts on backward
> compatibility.
>
> And given all the uncertainty above, I'm extra hesitant about
> backporting likely-user-visible changes to stable (#2).
I can remove the stable tag if makes you feel more comfortable.
Sascha
--
Pengutronix e.K. | |
Steuerwalder Str. 21 | http://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
next prev parent reply other threads:[~2024-11-13 14:44 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-18 11:10 [PATCH v2 00/12] mwifiex: two fixes and cleanup Sascha Hauer
2024-09-18 11:10 ` [PATCH v2 01/12] wifi: mwifiex: add missing locking Sascha Hauer
2024-10-04 22:56 ` Brian Norris
2024-10-17 16:45 ` [v2,01/12] wifi: mwifiex: add missing locking for cfg80211 calls Kalle Valo
2024-09-18 11:10 ` [PATCH v2 02/12] wifi: mwifiex: fix MAC address handling Sascha Hauer
2024-10-04 23:15 ` Brian Norris
2024-10-05 8:55 ` Francesco Dolcini
2024-11-13 14:44 ` Sascha Hauer [this message]
2024-09-18 11:10 ` [PATCH v2 03/12] wifi: mwifiex: deduplicate code in mwifiex_cmd_tx_rate_cfg() Sascha Hauer
2024-09-18 11:10 ` [PATCH v2 04/12] wifi: mwifiex: use adapter as context pointer for mwifiex_hs_activated_event() Sascha Hauer
2024-09-18 11:10 ` [PATCH v2 05/12] wifi: mwifiex: drop unnecessary initialization Sascha Hauer
2024-09-18 11:10 ` [PATCH v2 06/12] wifi: mwifiex: make region_code_mapping_t const Sascha Hauer
2024-09-18 11:10 ` [PATCH v2 07/12] wifi: mwifiex: pass adapter to mwifiex_dnld_cmd_to_fw() Sascha Hauer
2024-09-18 11:10 ` [PATCH v2 08/12] wifi: mwifiex: simplify mwifiex_setup_ht_caps() Sascha Hauer
2024-09-18 11:10 ` [PATCH v2 09/12] wifi: mwifiex: fix indention Sascha Hauer
2024-09-18 11:10 ` [PATCH v2 10/12] wifi: mwifiex: make locally used function static Sascha Hauer
2024-09-18 11:10 ` [PATCH v2 11/12] wifi: mwifiex: move common settings out of switch/case Sascha Hauer
2024-09-18 11:10 ` [PATCH v2 12/12] wifi: mwifiex: drop asynchronous init waiting code Sascha Hauer
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=ZzS7TKwPC1uxqzbg@pengutronix.de \
--to=s.hauer@pengutronix.de \
--cc=briannorris@chromium.org \
--cc=francesco@dolcini.it \
--cc=kernel@pengutronix.de \
--cc=kvalo@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=stable@vger.kernel.org \
--cc=yu-hao.lin@nxp.com \
/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