Connectivity: Ethernet test fast-path + smarter DHCP handling for minimal builds#235
Conversation
e33f6a7 to
62a7eef
Compare
|
Can you remove this commit 62a7eef as we are no longer relying on user input? Also please update the readme |
- In try_dhcp_client_safe(), detect a valid (non link-local) IPv4 early and return success without launching DHCP again. - When systemctl is available and NetworkManager/systemd-networkd is active, wait for IP instead of running udhcpc to avoid fighting the manager. - Keep the udhcpc safe-script behavior for minimal images while improving debug visibility around DHCP decisions and outcomes. Signed-off-by: Srikanth Muppandam <smuppand@qti.qualcomm.com>
62a7eef to
30685dc
Compare
We cannot remove this commit because we need some of the changes it contains. I have pushed the latest updates. |
- Add a fast-path: if Link detected=yes and a valid (non link-local) IPv4 is already present, skip link bring-up + IP acquisition and run ping directly. - Keep existing manager-aware behavior: when NetworkManager/systemd-networkd is active (via systemctl), don’t run udhcpc; only wait for IP. - Improve debug logs (ip-link / ethtool / ping output) for easier LAVA triage. - Preserve PASS/FAIL/SKIP summary reporting per interface. Signed-off-by: Srikanth Muppandam <smuppand@qti.qualcomm.com>
Signed-off-by: Srikanth Muppandam <smuppand@qti.qualcomm.com>
- Document auto-detection of Ethernet interfaces (not hardcoded eth0) - Mention manager-aware IP acquisition (NetworkManager/systemd-networkd) and the DHCP behavior when no manager is active - Describe fast-path when link + valid IPv4 already exist - Add new config knobs (LINK_TIMEOUT_S, IP_TIMEOUT_S, PING_* etc.) - Update result/summary expectations and sample logs - Note interface rename usage (e.g., end0) Signed-off-by: Srikanth Muppandam <smuppand@qti.qualcomm.com>
0a5b356 to
f86d6e0
Compare
| else | ||
| # Decide SKIP/FAIL post-failure | ||
| carrier="?" | ||
| if [ -r "/sys/class/net/$iface/carrier" ]; then |
There was a problem hiding this comment.
@smuppand hope Lines196- 199is not required as same is given at Line175 -> 178
|
|
||
| log_info "Link bring-up failed for $iface. Diagnostics:" | ||
| ip link show "$iface" 2>/dev/null | while IFS= read -r l; do [ -n "$l" ] && log_info "[ip-link] $l"; done | ||
| ethtool "$iface" 2>/dev/null | sed -n '1,80p' | while IFS= read -r l; do [ -n "$l" ] && log_info "[ethtool] $l"; done |
There was a problem hiding this comment.
@smuppand 201 to 203 lines are also not required as they are checked at Line#180,181 and not operations performed inbetween
| ip link set "$iface" up >/dev/null 2>&1 || true | ||
|
|
||
| # If link is down/no cable, don't try DHCP | ||
| if command -v is_link_up >/dev/null 2>&1; then |
There was a problem hiding this comment.
if condition not required as is_link_up is helper function
| log_warn "$iface link is down; skipping DHCP" | ||
| return 1 | ||
| fi | ||
| elif command -v ethIsLinkUp >/dev/null 2>&1; then |
There was a problem hiding this comment.
if condition not required as ethIsLinkUp is helper function
| return 1 | ||
| fi | ||
| elif command -v ethIsLinkUp >/dev/null 2>&1; then | ||
| if ! ethIsLinkUp "$iface"; then |
| fi | ||
|
|
||
| # 2) If helper exists and says up, accept it (but don't fail early) | ||
| if command -v is_link_up >/dev/null 2>&1; then |
| init_autoneg=$(ethGetAutonegState "$iface" 2>/dev/null || echo "unknown") | ||
|
|
||
| # Bring interface up using existing helper (admin-up) | ||
| if command -v bringup_interface >/dev/null 2>&1; then |
This PR improves the Ethernet validation flow to be less disruptive, less flaky, and easier to debug on both full userland images (NetworkManager/systemd-networkd) and minimal/kernel-only style images.
What changed