Skip to content

Add configurable link-up delay to simulate real NIC carrier negotiation#2

Closed
edcdavid wants to merge 1 commit into
mainfrom
port-up-delay
Closed

Add configurable link-up delay to simulate real NIC carrier negotiation#2
edcdavid wants to merge 1 commit into
mainfrom
port-up-delay

Conversation

@edcdavid
Copy link
Copy Markdown
Collaborator

Summary

  • Adds a per-port link_up_delay_ms debugfs knob (default 0 = instant, backward-compatible) that keeps carrier off after ip link set up and fires netif_carrier_on via a delayed work after the configured delay
  • PTP clocks remain accessible throughout the delay period
  • Includes CI smoke test: sets a 3s delay, verifies carrier is down during delay, comes up after, and confirms PTP clock and hwtstamp config still work

Test plan

  • CI dkms-test passes on ubuntu-22.04 and ubuntu-24.04
  • New "Smoke test — link up delay" step passes (carrier off during delay, on after)
  • PTP clock readable after link-up delay completes

Assisted-By: Cursor

Real NICs don't bring carrier up instantly — there is link negotiation,
PHY training, etc. Add a per-port link_up_delay_ms debugfs knob
(default 0 = instant) that keeps carrier off after ip link set up and
fires netif_carrier_on via a delayed work after the configured delay.
PTP clocks remain accessible throughout.

Includes a CI smoke test that sets a 3s delay, verifies carrier stays
down during the delay, comes up after, and confirms PTP clock sync
still works.
@edcdavid edcdavid closed this May 28, 2026
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