Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

zebra: remove proto nhid from system, when NHG_DEL is sent #14946

Closed

Conversation

pguibert6WIND
Copy link
Member

@pguibert6WIND pguibert6WIND commented Dec 5, 2023

When suppressing a nexthop group, the proto nhid is still present in the system:

ubuntu2204(config)# nexthop-group LL
2023/12/04 21:23:44 SHARP: [Q5NBA-GN1BG] NHG ID assigned: 179687510
ubuntu2204(config-nh-group)# nexthop 192.0.2.43 loop1
ubuntu2204(config-nh-group)# no nexthop 192.0.2.43 loop1
2023/12/04 21:23:56 ZEBRA: [RY75W-058E9] zebra_nhg_proto_del: deleted nhe 0x55edc18eb870 (179687510[260]), vrf 0, type sharp
2023/12/04 21:23:56 ZEBRA: [WDEB1-93HCZ] zebra_nhg_decrement_ref: nhe 0x55edc18eb870 (179687510[260]) 1 => 0
2023/12/04 21:23:56 SHARP: [H3QKG-WH8ZV] Removed nhg 179687510
ubuntu2204(config-nh-group)#
ubuntu2204(config-nh-group)# exi
ubuntu2204(config)#
////////// linux nexthop list (ip nexthop ls)
id 179687510 group 260 proto 194
id 260 via 192.0.2.43 dev loop1 scope link proto 194

There is no need to keep nexthop group from protocol levels if there are no references to that nexthop group. Fix this by forcing the system removal only if it is a protocol nhid.

Fixes: 35729f3 ("zebra: Add a timer to nexthop group deletion")

When suppressing a nexthop group, the proto nhid is still present
in the system:
> ubuntu2204(config)# nexthop-group LL
> 2023/12/04 21:23:44 SHARP: [Q5NBA-GN1BG] NHG ID assigned: 179687510
> ubuntu2204(config-nh-group)# nexthop 192.0.2.43 loop1
> ubuntu2204(config-nh-group)# no  nexthop 192.0.2.43 loop1
> 2023/12/04 21:23:56 ZEBRA: [RY75W-058E9] zebra_nhg_proto_del: deleted nhe 0x55edc18eb870 (179687510[260]), vrf 0, type sharp
> 2023/12/04 21:23:56 ZEBRA: [WDEB1-93HCZ] zebra_nhg_decrement_ref: nhe 0x55edc18eb870 (179687510[260]) 1 => 0
> 2023/12/04 21:23:56 SHARP: [H3QKG-WH8ZV] Removed nhg 179687510
> ubuntu2204(config-nh-group)#
> ubuntu2204(config-nh-group)# exi
> ubuntu2204(config)# <Ctrl-D>
> # ip nexthop ls
> id 179687510 group 260 proto 194
> id 260 via 192.0.2.43 dev loop1 scope link proto 194

There is no need to keep nexthop group from protocol levels if there
are no references to that nexthop group. Fix this by forcing the system
removal only if it is a protocol nhid.

Fixes: 35729f3 ("zebra: Add a timer to nexthop group deletion")

Signed-off-by: Philippe Guibert <[email protected]>
@donaldsharp
Copy link
Member

I really don't see the point of this. The code that keeps nexthop groups around for a specified amount of time is working as intended. What meta problem are you fixing?

@pguibert6WIND
Copy link
Member Author

you are right. I did not see the 'zebra nexthop keep' command.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants