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

various nexthop group fixes #14885

Merged
merged 6 commits into from
Dec 4, 2023
Merged

Conversation

pguibert6WIND
Copy link
Member

various tiny fixes about nexthop group handling.

@pguibert6WIND
Copy link
Member Author

ci:rerun

zebra/zserv.h Outdated
@@ -185,6 +185,9 @@ struct zserv {
uint32_t local_es_evi_add_cnt;
uint32_t local_es_evi_del_cnt;
uint32_t error_cnt;
uint32_t l3nhg_add_cnt;
Copy link
Member

Choose a reason for hiding this comment

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

Can it be L2 nhg at all? Asking because what role does the L3 prefix play here.

Copy link
Member

Choose a reason for hiding this comment

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

It can be but I believe we are quibling a bit. I wouldn't worry about this at all.

Copy link
Member Author

@pguibert6WIND pguibert6WIND Nov 28, 2023

Choose a reason for hiding this comment

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

Can it be L2 nhg at all? Asking because what role does the L3 prefix play here.

mmm . actually a nexthop is a nexthop group made up of IP nexthops
I just try to stick with what the system offers.

unless you explain me what is a L2 nexthop..

Copy link
Member

Choose a reason for hiding this comment

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

it's a nexthop for type 1 evpn routes in the multihoming scenario. This api that you are adding here handles this for both l2 nexthops as well as l3 nexthops. I know this because I was involved in writing this code w/ Anuradha

Copy link
Member

Choose a reason for hiding this comment

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

It can be but I believe we are quibling a bit. I wouldn't worry about this at all.

Not sure I understood the comment correctly :) Does it mean we should keep l3nhg_* or use nhg_*?

Copy link
Member Author

Choose a reason for hiding this comment

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

updated with nhg_* as everyone can understand it as desired

When removing the last nexthop from a nexthop-group, the nexthop
group remains in the zebra contexts:

> ubuntu2204(config)# nexthop-group gdgd
> 2023/11/23 14:06:36 SHARP: [Q5NBA-GN1BG] NHG ID assigned: 179687502
> ubuntu2204(config-nh-group)# nexthop 192.0.2.7 loop1
> ubuntu2204(config-nh-group)# 2023/11/23 14:06:38 ZEBRA: [VNMVB-91G3G] _netlink_nexthop_build_group: ID (179687502): group 338
> 2023/11/23 14:06:38 ZEBRA: [R43C6-KYHWT] netlink_nexthop_msg_encode: RTM_NEWNEXTHOP, id=179687502
> 2023/11/23 14:06:38 ZEBRA: [HYEHE-CQZ9G] nl_batch_send: netlink-dp (NS 0), batch size=44, msg cnt=1
> 2023/11/23 14:06:38 SHARP: [JWRCN-N9K90] Installed nhg 179687502
>
> ubuntu2204(config-nh-group)# no nexthop 192.0.2.7 loop1
> 2023/11/23 14:06:47 SHARP: [Y2G2F-ZTW6M] nhg_add: nhg 179687502 not sent: no valid nexthops
> ubuntu2204(config-nh-group)# do show nexthop-group rib 179687502
> ID: 179687502 (sharp)
>      RefCnt: 1
>      Uptime: 00:00:23
>      VRF: default
>      Valid, Installed
>      Depends: (338)
>            via 192.0.2.7, loop1 (vrf default), weight 1

Fix this by sending an NHG_DEL message when no nexthops are attached,
and when the id was already installed.

Fixes: 5a9c093 ("sharpd: don't send invalid nexthop-groups to zebra")

Signed-off-by: Philippe Guibert <[email protected]>
Display a specific log message when the rt_nhe parameter is not
set at all.

Signed-off-by: Philippe Guibert <[email protected]>
Add three counters that account for the nhg operations
that are using the zebra API with the NHG_ADD and NHG_DEL
commands.

> # show zebra client
> [..]
> Type        Add         Update      Del
> ==================================================
> IPv4        100         0           0
> IPv6        0           0           0
> Redist:v4   0           0           0
> Redist:v6   0           0           0
> NHG         1           1           1
> VRF         3           0           0
> [..]

Signed-off-by: Philippe Guibert <[email protected]>
When allocating big protocol level identifiers, the number range is
big, and when pushing to netlink messages, the first nexthop group
is truncated, whereas the nexthop has been installed on the kernel.

> ubuntu2204(config)# nexthop-group A
> ubuntu2204(config-nh-group)# group 1
> ubuntu2204(config-nh-group)# group 2
> ubuntu2204(config-nh-group)# exi
> ubuntu2204(config)# nexthop-group 1
> ubuntu2204(config-nh-group)# nexthop 192.0.2.130 loop1 enable-proto-nhg-control
> ubuntu2204(config-nh-group)# exi
> ubuntu2204(config)# nexthop-group 2
> ubuntu2204(config-nh-group)# nexthop 192.0.2.131 loop1 enable-proto-nhg-control
> [..]
> 2023/11/24 16:47:40 ZEBRA: [VNMVB-91G3G] _netlink_nexthop_build_group: ID (179687500): group 17968/179687502

> # ip nexthop ls
> id 179687500 group 179687501/179687502 proto 194

Fix this by increasing the buffer size when appending the first number.

Fixes: 8d03bc5 ("zebra: Handle nhg_hash_entry encaps/more debugging")

Signed-off-by: Philippe Guibert <[email protected]>
The nexthop_group_active_nexthop_num_no_recurse() function is no more
used. Let us remove the function call.

Fixes: 148813c ("zebra: zebra_nhg check each nexthop for active, not just number")

Signed-off-by: Philippe Guibert <[email protected]>
When stopping a VRF, the linked list entries must be
removed too.

Fixes: 98cbbae ("lib: Handle if up/down and vrf enable/disable events")

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

ci:rerun

Copy link
Member

@ton31337 ton31337 left a comment

Choose a reason for hiding this comment

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

LGTM

@donaldsharp donaldsharp merged commit 6be9452 into FRRouting:master Dec 4, 2023
78 checks passed
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.

3 participants