Skip to content

Conversation

@rjarry
Copy link
Collaborator

@rjarry rjarry commented Sep 26, 2025

When {,re}configuring a vlan interface, replicate the state of its parent port. Otherwise, if its parent port is already running, the vlan interface will never appear running unless we set the port down and then up manually.

Summary by CodeRabbit

  • Bug Fixes
    • VLAN interfaces now synchronize their operational state with the parent interface during reconfiguration (in addition to MTU), ensuring consistent status after parent changes.
    • Resolves cases where VLANs could appear incorrectly up/down, improving reliability for monitoring and automation tools.
    • Enhances stability during network updates without requiring configuration changes or impacting other attributes (e.g., VRF, MAC, flags).

When {,re}configuring a vlan interface, replicate the state of its
parent port. Otherwise, if its parent port is already running, the vlan
interface will never appear running unless we set the port down and then
up manually.

Signed-off-by: Robin Jarry <[email protected]>
@coderabbitai
Copy link

coderabbitai bot commented Sep 26, 2025

📝 Walkthrough

Walkthrough

The change modifies iface_vlan_reconfig in modules/infra/control/vlan.c to also synchronize iface->state with its parent interface during VLAN reconfiguration. Previously, the function updated mtu from the parent; it now assigns iface->state = parent->state as well. No other attributes or control flow are altered. Existing handling for VRF, MAC, flags, and event dispatch after reconfiguration remains unchanged. No public or exported declarations are modified.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Pre-merge checks

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title accurately summarizes the main change by indicating that VLAN interfaces now inherit the parent interface state, which aligns directly with the code modifications. It is concise and focuses on the key update without extraneous detail. The phrasing clearly conveys the purpose of the pull request to any reviewer scanning through history.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
modules/infra/control/vlan.c (1)

129-131: Reuse the already-fetched parent pointer.

next_parent is already validated above, so we can copy MTU and state from it directly instead of doing two extra iface_from_id() lookups. Keeps the hot path leaner.

Apply this diff:

-	iface->mtu = iface_from_id(cur->parent_id)->mtu;
-	iface->state = iface_from_id(cur->parent_id)->state;
+	iface->mtu = next_parent->mtu;
+	iface->state = next_parent->state;
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5f998b4 and ddc98e3.

📒 Files selected for processing (1)
  • modules/infra/control/vlan.c (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
modules/infra/control/vlan.c (3)
modules/infra/control/gr_iface.h (1)
  • iface (16-22)
modules/infra/control/iface.c (1)
  • iface_from_id (215-222)
modules/infra/control/worker_test.c (1)
  • iface_from_id (40-42)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (8)
  • GitHub Check: build-and-tests (gcc-14, address, debug, ubuntu-24.04, -Dfrr=enabled, true)
  • GitHub Check: build-and-tests (clang-18, none, debugoptimized, ubuntu-24.04, false)
  • GitHub Check: build-and-tests (clang-16, none, debugoptimized, ubuntu-24.04, false)
  • GitHub Check: build-and-tests (gcc-13, none, debugoptimized, ubuntu-24.04, -Dfrr=enabled, false)
  • GitHub Check: build-and-tests (clang-15, none, debugoptimized, ubuntu-22.04, false)
  • GitHub Check: build-cross-aarch64
  • GitHub Check: deb
  • GitHub Check: rpm

@christophefontaine christophefontaine merged commit f0efe47 into DPDK:main Sep 26, 2025
12 checks passed
@rjarry rjarry deleted the vlan-running branch October 4, 2025 19:42
@coderabbitai coderabbitai bot mentioned this pull request Oct 9, 2025
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.

2 participants