qps615-dlkm: fall back to random MAC address when none is predefined#2103
qps615-dlkm: fall back to random MAC address when none is predefined#2103ayaan-anwar wants to merge 1 commit into
Conversation
1e14d32 to
4f25305
Compare
lumag
left a comment
There was a problem hiding this comment.
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). 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. |
|
Converting to draft. I think we should revisit this once we have a fork of the driver available. |
|
@ayaan-anwar this need to be a part of the commit message. |
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>
4f25305 to
19e928e
Compare
Test Results 99 files ± 0 528 suites ±0 7h 41m 42s ⏱️ + 56m 7s For more details on these failures, see this check. Results for commit 19e928e. ± Comparison against base commit 4c74258. This pull request removes 2 tests. |
| + /* 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"); |
There was a problem hiding this comment.
Drop or switch to dev_dbg(). There is no need to be noisy about the known good and default setup
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.