Skip to content

qps615-dlkm: fall back to random MAC address when none is predefined#2103

Open
ayaan-anwar wants to merge 1 commit into
qualcomm-linux:masterfrom
ayaan-anwar:qps615_mac_addr_random
Open

qps615-dlkm: fall back to random MAC address when none is predefined#2103
ayaan-anwar wants to merge 1 commit into
qualcomm-linux:masterfrom
ayaan-anwar:qps615_mac_addr_random

Conversation

@ayaan-anwar
Copy link
Copy Markdown
Contributor

@ayaan-anwar ayaan-anwar commented May 4, 2026

Rb3Gen2 lacks an EEPROM chip and the bootloader does not append a MAC address into the DTB. As a result, all boards running QLI 2.0 end up with the same static fallback MAC addresses on both ports, which can cause DHCP lease conflicts across the network.

Fix this by assigning a random MAC address (with NET_ADDR_RANDOM) when both of_get_mac_address() and parse_config_file() fail to provide one. This allows a userspace network manager (e.g. NetworkManager) to detect the DEV_ADDR_RANDOM flag and persist a stable, board-unique address for subsequent boots.

Copy link
Copy Markdown
Contributor

@lumag lumag left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A better method to
handle such scenarios

Why is it declared to be better?

@ayaan-anwar
Copy link
Copy Markdown
Contributor Author

A better method to
handle such scenarios

Why is it declared to be better?

This was something that was recently discussed on an internal thread (+ @ricardosalveti).
Rb3Gen2 doesn't have an EEPROM chip, and we are not appending the MAC address into the DTB from the bootloader. As a result, all the boards running QLI 2.0 end up having the same MAC address for both ports which causes DHCP lease issues.

With a random MAC address (and the DEV_ADDR_RANDOM flag), we can at least have a userspace network management entity create a semi-permanent address and use that for the interfaces.

@ayaan-anwar ayaan-anwar marked this pull request as draft May 6, 2026 05:57
@ayaan-anwar
Copy link
Copy Markdown
Contributor Author

Converting to draft. I think we should revisit this once we have a fork of the driver available.

@lumag
Copy link
Copy Markdown
Contributor

lumag commented May 6, 2026

@ayaan-anwar this need to be a part of the commit message.

@ricardosalveti
Copy link
Copy Markdown
Contributor

Converting to draft. I think we should revisit this once we have a fork of the driver available.

Still fine to include it here, just please add the justification as part of the commit.

Rb3Gen2 lacks an EEPROM chip and the bootloader does not append a MAC
address into the DTB. As a result, all boards running QLI 2.0 end up
with the same static fallback MAC addresses on both ports, which
can cause DHCP lease conflicts across the network.

Fix this by assigning a random MAC address (with NET_ADDR_RANDOM) when
both of_get_mac_address() and parse_config_file() fail to provide one.
This allows a userspace network manager (e.g. NetworkManager) to detect
the DEV_ADDR_RANDOM flag and persist a stable, board-unique address for
subsequent boots.

Signed-off-by: Mohd Ayaan Anwar <mohd.anwar@oss.qualcomm.com>
@ayaan-anwar ayaan-anwar force-pushed the qps615_mac_addr_random branch from 4f25305 to 19e928e Compare May 11, 2026 06:05
@ayaan-anwar ayaan-anwar changed the title qps615-dlkm: Use a random MAC address if no predefined address is found qps615-dlkm: fall back to random MAC address when none is predefined May 11, 2026
@ayaan-anwar ayaan-anwar marked this pull request as ready for review May 11, 2026 06:10
@github-actions
Copy link
Copy Markdown

Test run workflow

Test jobs for commit 19e928e

qcom-distro
Pass: 211 | Fail: 1 | Total: 226
qcom-distro_linux-qcom-6.18
Pass: 184 | Fail: 3 | Total: 208
nodistro
Pass: 9 | Fail: 0 | Total: 9

@test-reporting-app
Copy link
Copy Markdown

Test Results

   99 files  ± 0    528 suites  ±0   7h 41m 42s ⏱️ + 56m 7s
   95 tests  -  2     82 ✅ +14   1 💤 ±0  12 ❌  - 16 
4 999 runs  +19  4 943 ✅ +45  39 💤 +2  17 ❌  - 28 

For more details on these failures, see this check.

Results for commit 19e928e. ± Comparison against base commit 4c74258.

This pull request removes 2 tests.
lava ‑ auto-login-action
lava ‑ minimal-boot

+ /* There's no predefined MAC address so let's set a random
+ * address and let userland take care of handling it.
+ */
+ KPRINT_INFO("Falling back to random MAC address since there's no predefined address found");
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Drop or switch to dev_dbg(). There is no need to be noisy about the known good and default setup

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants