Merge pull request #14729 from donaldsharp/v6_rr_semantics_zrouter

V6 rr semantics zrouter
This commit is contained in:
Donatas Abraitis 2023-11-06 23:00:50 +02:00 committed by GitHub
commit f57763eaed
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 21 additions and 9 deletions

View file

@ -59,8 +59,6 @@ int retain_mode = 0;
int graceful_restart; int graceful_restart;
bool v6_rr_semantics = false;
/* Receive buffer size for kernel control sockets */ /* Receive buffer size for kernel control sockets */
#define RCVBUFSIZE_MIN 4194304 #define RCVBUFSIZE_MIN 4194304
#ifdef HAVE_NETLINK #ifdef HAVE_NETLINK
@ -385,7 +383,7 @@ int main(int argc, char **argv)
vrf_configure_backend(VRF_BACKEND_NETNS); vrf_configure_backend(VRF_BACKEND_NETNS);
break; break;
case OPTION_V6_RR_SEMANTICS: case OPTION_V6_RR_SEMANTICS:
v6_rr_semantics = true; zrouter.v6_rr_semantics = true;
break; break;
case OPTION_ASIC_OFFLOAD: case OPTION_ASIC_OFFLOAD:
if (!strcmp(optarg, "notify_on_offload")) if (!strcmp(optarg, "notify_on_offload"))

View file

@ -627,8 +627,6 @@ extern void zebra_vty_init(void);
extern pid_t pid; extern pid_t pid;
extern bool v6_rr_semantics;
extern uint32_t rt_table_main_id; extern uint32_t rt_table_main_id;
/* Name of hook calls */ /* Name of hook calls */

View file

@ -2209,7 +2209,8 @@ ssize_t netlink_route_multipath_msg_encode(int cmd, struct zebra_dplane_ctx *ctx
req->n.nlmsg_flags = NLM_F_CREATE | NLM_F_REQUEST; req->n.nlmsg_flags = NLM_F_CREATE | NLM_F_REQUEST;
if (((cmd == RTM_NEWROUTE) && if (((cmd == RTM_NEWROUTE) &&
((p->family == AF_INET) || v6_rr_semantics)) || ((p->family == AF_INET) || kernel_nexthops_supported() ||
zrouter.v6_rr_semantics)) ||
force_rr) force_rr)
req->n.nlmsg_flags |= NLM_F_REPLACE; req->n.nlmsg_flags |= NLM_F_REPLACE;
@ -3095,8 +3096,8 @@ netlink_put_route_update_msg(struct nl_batch *bth, struct zebra_dplane_ctx *ctx)
} else if (dplane_ctx_get_op(ctx) == DPLANE_OP_ROUTE_INSTALL) { } else if (dplane_ctx_get_op(ctx) == DPLANE_OP_ROUTE_INSTALL) {
cmd = RTM_NEWROUTE; cmd = RTM_NEWROUTE;
} else if (dplane_ctx_get_op(ctx) == DPLANE_OP_ROUTE_UPDATE) { } else if (dplane_ctx_get_op(ctx) == DPLANE_OP_ROUTE_UPDATE) {
if (p->family == AF_INET || kernel_nexthops_supported() ||
if (p->family == AF_INET || v6_rr_semantics) { zrouter.v6_rr_semantics) {
/* Single 'replace' operation */ /* Single 'replace' operation */
/* /*

View file

@ -209,6 +209,8 @@ struct zebra_router {
bool notify_on_ack; bool notify_on_ack;
bool v6_with_v4_nexthop; bool v6_with_v4_nexthop;
bool v6_rr_semantics;
/* /*
* If the asic is notifying us about successful nexthop * If the asic is notifying us about successful nexthop
* allocation/control. Some developers have made their * allocation/control. Some developers have made their

View file

@ -4028,6 +4028,17 @@ static int config_write_protocol(struct vty *vty)
return 1; return 1;
} }
static inline bool zebra_vty_v6_rr_semantics_used(void)
{
if (zebra_nhg_kernel_nexthops_enabled())
return true;
if (zrouter.v6_rr_semantics)
return true;
return false;
}
DEFUN (show_zebra, DEFUN (show_zebra,
show_zebra_cmd, show_zebra_cmd,
"show zebra", "show zebra",
@ -4047,7 +4058,9 @@ DEFUN (show_zebra,
ttable_add_row(table, "MPLS|%s", mpls_enabled ? "On" : "Off"); ttable_add_row(table, "MPLS|%s", mpls_enabled ? "On" : "Off");
ttable_add_row(table, "EVPN|%s", is_evpn_enabled() ? "On" : "Off"); ttable_add_row(table, "EVPN|%s", is_evpn_enabled() ? "On" : "Off");
ttable_add_row(table, "Kernel socket buffer size|%d", rcvbufsize); ttable_add_row(table, "Kernel socket buffer size|%d", rcvbufsize);
ttable_add_row(table, "v6 Route Replace Semantics|%s",
zebra_vty_v6_rr_semantics_used() ? "Replace"
: "Delete then Add");
#ifdef GNU_LINUX #ifdef GNU_LINUX
if (!vrf_is_backend_netns()) if (!vrf_is_backend_netns())