Skip to content

Conversation

@christophefontaine
Copy link
Collaborator

@christophefontaine christophefontaine commented Nov 27, 2025

Similar to IFACE_POST_ADD / IFACE_ADD. As we don't order the event registration, on interface removal, we end up removing the control plane netdevice before the removing the ip addresses. While this is harmless, Grout still logs a warning:

WARN: GROUT: iface6_addr_del: delete addr fe80::c613:8fff:fe4f:6a22 on linux has failed (Cannot assign requested address)
WARN: GROUT: iface6_addr_del: delete addr 2345::1 on linux has failed (Cannot assign requested address)
INFO: GROUT: iface_port_fini: port 0 destroyed
WARN: GROUT: iface6_addr_del: delete addr fe80::de61:40ff:fe84:1655 on linux has failed (Cannot assign requested address)
WARN: GROUT: iface6_addr_del: delete addr 2346::1 on linux has failed (Cannot assign requested address)
INFO: GROUT: iface_port_fini: port 1 destroyed

Add a new event "GR_EVENT_IFACE_REMOVE" which should be consummed externally, while the "PRE_REMOVE" event is consummed internally.

Update FRR plugin as well.

Summary by CodeRabbit

  • Bug Fixes

    • Standardized interface-removal signaling so removal events are recognized and handled consistently during cleanup and lifecycle transitions.
  • User Interface

    • CLI and event output now distinguish pre-removal vs removal more clearly.
    • Event reporting/serialization expanded to include explicit removal events so logs and tools reflect the full interface-event set.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Nov 27, 2025

📝 Walkthrough

Walkthrough

The enum gr_event_iface_t adds GR_EVENT_IFACE_REMOVE at value 0x0004, shifting subsequent iface event values. Code references to GR_EVENT_IFACE_PRE_REMOVE were replaced with GR_EVENT_IFACE_REMOVE across multiple modules (zebra dataplane grout, infra iface serializer, CLI printer, control plane, iface lifecycle, and IPv6 router advertisement). Event subscription lists, serializers, printers, and handlers were updated to include and handle the new REMOVE event; textual mapping now distinguishes PRE_REMOVE ("pre del") and REMOVE ("del") where applicable.

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 Title directly and clearly describes the main change: adding a new GR_EVENT_IFACE_REMOVE event across the codebase.

📜 Recent 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 23c7187 and a959363.

📒 Files selected for processing (7)
  • frr/zebra_dplane_grout.c (3 hunks)
  • modules/infra/api/gr_infra.h (1 hunks)
  • modules/infra/api/iface.c (1 hunks)
  • modules/infra/cli/iface.c (2 hunks)
  • modules/infra/control/ctlplane.c (2 hunks)
  • modules/infra/control/iface.c (3 hunks)
  • modules/ip6/control/router_advert.c (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (5)
  • modules/ip6/control/router_advert.c
  • modules/infra/cli/iface.c
  • modules/infra/control/iface.c
  • modules/infra/api/iface.c
  • modules/infra/api/gr_infra.h
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{c,h}

⚙️ CodeRabbit configuration file

**/*.{c,h}: - gr_vec_*() functions cannot fail. No need to check their return value.

  • gr_vec_free(x) always sets x = NULL. There is no risk of double free.
  • ec_node_*() functions consume their ec_node arguments. No leaks on error.
  • rte_node->ctx is an uint8_t array of size 16, not a pointer.
  • Don't suggest to replace assert() with graceful error checking.
  • We compile with -std=gnu2x. Unnamed parameters in function definitions are valid.

Files:

  • frr/zebra_dplane_grout.c
  • modules/infra/control/ctlplane.c
🧠 Learnings (1)
📓 Common learnings
Learnt from: maxime-leroy
Repo: DPDK/grout PR: 372
File: smoke/cross_vrf_forward_test.sh:18-18
Timestamp: 2025-11-05T13:55:26.189Z
Learning: In the DPDK/grout codebase, VRF interfaces (named gr-vrf<id>) are automatically created when an interface is added to a non-existing VRF using port_add. The VRF creation is handled automatically by the event system in vrf_netlink.c, so no explicit VRF interface creation commands are needed in test scripts.
🔇 Additional comments (4)
frr/zebra_dplane_grout.c (3)

246-246: LGTM: Subscription correctly updated to new REMOVE event.

The FRR plugin now subscribes to GR_EVENT_IFACE_REMOVE as an external consumer, which aligns with the PR's intent to provide a public-facing interface removal event.


386-387: LGTM: Event-to-string mapping updated correctly.

The string conversion now handles GR_EVENT_IFACE_REMOVE, maintaining consistency with the subscription and handler updates.


446-446: LGTM: Event handler case updated correctly.

The switch case now handles GR_EVENT_IFACE_REMOVE, preserving the existing deletion logic.

modules/infra/control/ctlplane.c (1)

429-429: LGTM: Control plane correctly updated to use REMOVE event.

Both the event handler switch case and subscription array are consistently updated to GR_EVENT_IFACE_REMOVE. The control plane, as an external consumer, correctly uses the new public-facing removal event while preserving existing deletion logic.

Also applies to: 449-449


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.

GR_EVENT_IFACE_POST_RECONFIG = EVENT_TYPE(GR_INFRA_MODULE, 0x0004),
GR_EVENT_IFACE_STATUS_UP = EVENT_TYPE(GR_INFRA_MODULE, 0x0005),
GR_EVENT_IFACE_STATUS_DOWN = EVENT_TYPE(GR_INFRA_MODULE, 0x0006),
GR_EVENT_IFACE_REMOVE = EVENT_TYPE(GR_INFRA_MODULE, 0x0004),
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why not use 0x0007 for GR_EVENT_IFACE_REMOVE to preserve ABI?

Copy link
Collaborator Author

@christophefontaine christophefontaine Nov 27, 2025

Choose a reason for hiding this comment

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

There is no need: we don't guarantee any ABI compatibility, and the 2 customers (grcli and frr plugin) of this API are built as part of grout.
There is in fact a check on connection which rejects it if a wrong client tries to connect to grout.

Copy link
Collaborator

@aharivel aharivel left a comment

Choose a reason for hiding this comment

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

LGTM

Similar to IFACE_POST_ADD / IFACE_ADD.  As we don't order the event
registration, on interface removal, we end up removing the control plane
netdevice before the removing the ip addresses.  While this is harmless,
Grout still logs a warning:

WARN: GROUT: iface6_addr_del: delete addr fe80::c613:8fff:fe4f:6a22 on linux has failed (Cannot assign requested address)
WARN: GROUT: iface6_addr_del: delete addr 2345::1 on linux has failed (Cannot assign requested address)
INFO: GROUT: iface_port_fini: port 0 destroyed
WARN: GROUT: iface6_addr_del: delete addr fe80::de61:40ff:fe84:1655 on linux has failed (Cannot assign requested address)
WARN: GROUT: iface6_addr_del: delete addr 2346::1 on linux has failed (Cannot assign requested address)
INFO: GROUT: iface_port_fini: port 1 destroyed

Add a new event "GR_EVENT_IFACE_REMOVE" which should be consumed
externally, while the "PRE_REMOVE" event is consumed internally.

Update FRR plugin as well.

Signed-off-by: Christophe Fontaine <cfontain@redhat.com>
Reviewed-by: Anthony Harivel <aharivel@redhat.com>
@rjarry rjarry merged commit dd7e28e into DPDK:main Nov 27, 2025
6 of 7 checks passed
@christophefontaine christophefontaine deleted the iface_event_remove branch December 12, 2025 08:07
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.

3 participants