zebra: add debug in route install around nhg not ready - #21265
Merged
Conversation
Greptile SummaryThis PR adds observability instrumentation to the zebra dataplane route install path β specifically for the case where a kernel nexthop group (NHG) is not yet installed or queued when a route install/update is attempted. Changes:
Confidence Score: 5/5
Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[dplane_ctx_route_init called\nop = INSTALL or UPDATE] --> B{HAVE_NETLINK?}
B -- No --> E[Continue normal init]
B -- Yes --> C{kernel_nexthops_enabled\nAND op is INSTALL/UPDATE?}
C -- No --> E
C -- Yes --> D{NHG installed\nOR queued?}
D -- Yes --> E
D -- No --> F["frrtrace(dplane_ctx_route_kernel_nhg_not_ready)\n[NEW]"]
F --> G{"IS_ZEBRA_DEBUG_DPLANE_DETAIL\nOR IS_ZEBRA_DEBUG_RIB_DETAILED?\n[NEW]"}
G -- Yes --> H["zlog_debug: route/op/nhg id/flags/nh\n[NEW]"]
G -- No --> I[return ENOENT]
H --> I
E --> J[return AOK]
Prompt To Fix All With AIThis is a comment left during a code review.
Path: zebra/zebra_trace.h
Line: 465-479
Comment:
**Inconsistent indentation (spaces vs. tabs)**
The new `TRACEPOINT_EVENT` block uses 4-space indentation, while every other tracepoint event in this file uses tab indentation. Since the file has a `/* clang-format off */` directive at line 40, clang-format won't auto-correct this β the inconsistency will persist as-is. The block should use tabs to match the surrounding code.
```suggestion
TRACEPOINT_EVENT(
frr_zebra,
dplane_ctx_route_kernel_nhg_not_ready,
TP_ARGS(
enum dplane_op_e, op,
uint32_t, nhe_id,
uint32_t, nhe_flags,
vrf_id_t, vrf_id),
TP_FIELDS(
ctf_integer(uint32_t, op, op)
ctf_integer(uint32_t, nhe_id, nhe_id)
ctf_integer(uint32_t, nhe_flags, nhe_flags)
ctf_integer(vrf_id_t, vrf_id, vrf_id)
)
)
```
How can I resolve this? If you propose a fix, please make it concise.Last reviewed commit: "zebra: add debug rou..." |
chiragshah6
force-pushed
the
zdev
branch
2 times, most recently
from
March 19, 2026 21:15
41fd620 to
bd4091a
Compare
Ticket: #4929905
debug log:
2026/03/20 01:41:09.401823 ZEBRA: [ZSM84-3K06X] dplane_ctx_route_init
route 81.0.0.5/32 op ROUTE_UPDATE nhg id 225 flags 0x5 nh 27.0.0.1 if 4
vrfid 0 not installed nor queued
Tracepoint:
2026-03-20T01:35:06.111 frr_zebra:dplane_ctx_route_kernel_nhg_not_ready
{'op': 2, 'nhe_id': 141, 'nhe_flags': 515, 'vrf_id': 41}
2026-03-20T01:35:10.366 frr_zebra:dplane_ctx_route_kernel_nhg_not_ready
{'op': 2, 'nhe_id': 73529432, 'nhe_flags': 3, 'vrf_id': 31}
2026-03-20T01:35:10.366 frr_zebra:dplane_ctx_route_kernel_nhg_not_ready
{'op': 2, 'nhe_id': 73529444, 'nhe_flags': 3, 'vrf_id': 41}
Signed-off-by: Chirag Shah <chirag@nvidia.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
debug log:
Tracepoint: