Skip to content

Ethernet: fail on MAC/PHY bring-up errors and suppress noisy carrier reads#475

Open
smuppand wants to merge 2 commits into
qualcomm-linux:mainfrom
smuppand:eth-dynamic-fix
Open

Ethernet: fail on MAC/PHY bring-up errors and suppress noisy carrier reads#475
smuppand wants to merge 2 commits into
qualcomm-linux:mainfrom
smuppand:eth-dynamic-fix

Conversation

@smuppand
Copy link
Copy Markdown
Contributor

@smuppand smuppand commented Jun 3, 2026

Improve Ethernet CI diagnostics and result classification.

This change suppresses noisy /sys/class/net/<iface>/carrier read errors in ethIsLinkUp() and treats unreadable carrier state as unknown so the existing fallback checks can continue.

It also updates the Ethernet test to scan kernel logs for focused MAC/PHY/phylink errors before classifying link bring-up failure as a no-cable skip.

Issue on some platforms.
Some Ethernet drivers return EINVAL when reading the carrier file while MAC/PHY attach is not complete. The resulting cat errors pollute LAVA logs.

Also, the test previously treated carrier=0 or ethtool Link detected: no as a no-cable condition even when the kernel showed real errors such as:

qcom-ethqos ... validation of 2500base-x ... failed: -EINVAL
qcom-ethqos ... cannot attach to PHY (error: -EINVAL)

smuppand added 2 commits June 3, 2026 11:12
Some Ethernet drivers can return EINVAL when reading
/sys/class/net/<iface>/carrier while the MAC/PHY attach path is not fully
operational. The current Ethernet link polling can leak these cat errors
directly into LAVA stdout and obscure the real kernel failure.

Update ethIsLinkUp() to suppress carrier read stderr and treat unreadable
carrier as unknown, then continue through the existing fallback checks
such as is_link_up, operstate, LOWER_UP, and ethtool.

This keeps the helper behavior unchanged while making Ethernet CI logs
cleaner and easier to triage.

Signed-off-by: Srikanth Muppandam <smuppand@qti.qualcomm.com>
 

The Ethernet test currently treats carrier=0 or ethtool "Link detected:
no" as a no-cable condition after link bring-up fails. This can hide real
driver or device-tree issues where qcom-ethqos/phylink fails before cable
detection is meaningful.

Add a focused kernel-log scan before classifying no-link as SKIP. If
Ethernet MAC/PHY/phylink errors are detected, print the filtered kernel
lines to stdout and report FAIL instead of SKIP.

This preserves SKIP for clean no-cable/no-carrier cases while correctly
flagging failures such as phylink validation errors, 2500base-x mode
mismatches, and "cannot attach to PHY" errors.

Signed-off-by: Srikanth Muppandam <smuppand@qti.qualcomm.com>
@smuppand smuppand requested review from bhargav0610 and vnarapar June 3, 2026 10:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant