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

nexthop group extensions #15038

Closed
wants to merge 25 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
c28b6ae
zebra: rework zebra_nhg_proto_add() parameters
pguibert6WIND Dec 7, 2023
738de3f
sharpd, zebra, lib, doc: add recursive support for protocol nhid
pguibert6WIND Dec 8, 2023
9e4d0da
topotests: add nexthop-group allow-recursion test
pguibert6WIND Dec 8, 2023
dc0463e
sharpd, lib: add force-nexthop-config option to sharp in NHG
pguibert6WIND Dec 17, 2023
d5a61e0
lib, zebra, doc: extend ibgp support to nhg in zebra
pguibert6WIND Dec 15, 2023
f1b312f
lib: fix copy srte_color from zapi_nexthop structure
pguibert6WIND Dec 17, 2023
b5f7f06
*: add srte color support in nhg
pguibert6WIND Dec 15, 2023
9ea4a6c
zebra, lib, doc: add protocol-controlled command to nhg
pguibert6WIND Nov 23, 2023
2e4736a
*: move [backup_]nexthop from zapi_nhg into nhg_nexthop sub-structure
pguibert6WIND Aug 30, 2023
129a217
*: add nexthop_group group ids support, part 1
pguibert6WIND Aug 30, 2023
efd1001
zebra: factorise 'show nexthop-group rib' nexthops
pguibert6WIND Nov 24, 2023
755460b
zebra: move early rib_evpn_route_[add/delete]() function in early_ fu…
pguibert6WIND Nov 27, 2023
757aaa1
zebra: move route_entry_dump_nh() into route_entry_dump_nhg()
pguibert6WIND Nov 27, 2023
48fbc9c
lib, zebra: add nhg group ids support, part 2, add nhg ref
pguibert6WIND Dec 5, 2023
9fa19cc
zebra: add nexthop group ids support, part 3
pguibert6WIND Nov 23, 2023
9e88ee0
zebra: add nexthop group ids support, part 4, netlink
pguibert6WIND Nov 24, 2023
05c235b
zebra: rework show_nexthop_group_out_nexthop() separate function
pguibert6WIND Nov 24, 2023
d8d4c0f
zebra: rework 'vty_show_ip_route()' function
pguibert6WIND Nov 27, 2023
ad826b7
zebra: add nexthop group ids support, part 5, show
pguibert6WIND Nov 24, 2023
1393cfd
zebra: rework no nexthop available test
pguibert6WIND Nov 27, 2023
32eea72
zebra: rework mpls uninstall based on nexthop group
pguibert6WIND Nov 28, 2023
9d8b551
zebra: add support for 'mpls uninstall' of nexthop group dependencies
pguibert6WIND Nov 28, 2023
aab3273
zebra: rework zsend_redistribute_route() function with nhg
pguibert6WIND Nov 28, 2023
f3c50c0
zebra: add support for redistributed routes with nexthop groups
pguibert6WIND Nov 28, 2023
27d4fdc
topotests: all_protocol_startup, add nexthop-group test with nhg group
pguibert6WIND Nov 28, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions bgpd/bgp_evpn_mh.c
Original file line number Diff line number Diff line change
Expand Up @@ -2825,7 +2825,7 @@ static void bgp_evpn_l3nhg_zebra_add_v4_or_v6(struct bgp_evpn_es_vrf *es_vrf,
continue;

/* Don't overrun the zapi buffer. */
if (api_nhg.nexthop_num == MULTIPATH_NUM)
if (api_nhg.nhg_nexthop.nexthop_num == MULTIPATH_NUM)
break;

/* overwrite the gw */
Expand All @@ -2836,10 +2836,11 @@ static void bgp_evpn_l3nhg_zebra_add_v4_or_v6(struct bgp_evpn_es_vrf *es_vrf,
es_vtep->vtep_ip);

/* convert to zapi format */
api_nh = &api_nhg.nexthops[api_nhg.nexthop_num];
api_nh = &api_nhg.nhg_nexthop
.nexthops[api_nhg.nhg_nexthop.nexthop_num];
zapi_nexthop_from_nexthop(api_nh, &nh);

++api_nhg.nexthop_num;
++api_nhg.nhg_nexthop.nexthop_num;
if (BGP_DEBUG(evpn_mh, EVPN_MH_ES))
zlog_debug("nhg %u vtep %pI4 l3-svi %d", api_nhg.id,
&es_vtep->vtep_ip,
Expand All @@ -2848,7 +2849,7 @@ static void bgp_evpn_l3nhg_zebra_add_v4_or_v6(struct bgp_evpn_es_vrf *es_vrf,
frrtrace(3, frr_bgp, evpn_mh_nh_zsend, nhg_id, es_vtep, es_vrf);
}

if (!api_nhg.nexthop_num)
if (!api_nhg.nhg_nexthop.nexthop_num)
return;

zclient_nhg_send(zclient, ZEBRA_NHG_ADD, &api_nhg);
Expand Down
4 changes: 2 additions & 2 deletions bgpd/bgp_nhg.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ static void bgp_nhg_add_cb(const char *name)
{
}

static void bgp_nhg_modify_cb(const struct nexthop_group_cmd *nhgc)
static void bgp_nhg_modify_cb(const struct nexthop_group_cmd *nhgc, bool reset)
{
}

Expand Down Expand Up @@ -55,7 +55,7 @@ static void bgp_nhg_zebra_init(void)
bgp_nhg_start = zclient_get_nhg_start(ZEBRA_ROUTE_BGP);
nexthop_group_init(bgp_nhg_add_cb, bgp_nhg_modify_cb,
bgp_nhg_add_nexthop_cb, bgp_nhg_del_nexthop_cb,
bgp_nhg_del_cb);
bgp_nhg_del_cb, NULL);
}

void bgp_nhg_init(void)
Expand Down
32 changes: 31 additions & 1 deletion doc/user/nexthop_groups.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ listing of ECMP nexthops used to forward packets.
sub-mode where you can specify individual nexthops. To exit this mode type
exit or end as per normal conventions for leaving a sub-mode.

.. clicmd:: nexthop [A.B.C.D|X:X::X:XX] [interface [onlink]] [nexthop-vrf NAME] [label LABELS]
.. clicmd:: nexthop [A.B.C.D|X:X::X:XX] [interface [onlink]] [nexthop-vrf NAME] [label LABELS] [color (1-4294967295)]

Create a v4 or v6 nexthop. All normal rules for creating nexthops that you
are used to are allowed here. The syntax was intentionally kept the same as
Expand All @@ -27,3 +27,33 @@ listing of ECMP nexthops used to forward packets.
will be automatically re-assigned. This cli command must be the first
command entered currently. Additionally this command only works with linux 5.19
kernels or newer.

.. clicmd:: allow-recursion

Allow a next-hop to be resolved at zebra level. Instead of beig considered valid,
the next-hop is checked against route reachability at zebra level. This permits
sending an incomplete next-hop to zebra, whereas it was not authorised before.

.. clicmd:: force-nexthop-config

Allow a Nexthop Group to be configured in ZEBRA, even if the nexthop has neither
an interface configured and no `allow-recursion` set.

.. clicmd:: ibgp

Allow a Nexthop Group to be considered as an IBGP nexthop. When used in ZEBRA,
if `allow-recursion` is not used, some debug information is given.

.. clicmd:: protocol-controlled

Allow a Nexthop Group to be completely controlled at the protocol level, by preventing
ZEBRA from creating a dependent NHG at ZEBRA Level. This option is useful when
protocol considers Nexthop Groups with multiple paths.

.. clicmd:: group NAME

Append a Nexthop Group group dependency in the current nexthop group. When used with
the `protocol-controlled` option, the protocol daemon using it will ensure that the
dependent group is configured at the protocol level, and installed at ZEBRA level,
before installing the parent Nexthop Group. This option is very useful to consider
nexthop groups having multiple paths.
Loading
Loading