Skip to content

Commit 7a05e11

Browse files
raja-rajasekarchiragshah6
authored andcommitted
zebra: vlan to dplane Offload from main
Trigger: Zebra core seen when we convert l2vni to l3vni and back BackTrace: /usr/lib/x86_64-linux-gnu/frr/libfrr.so.0(_zlog_assert_failed+0xe9) [0x7f4af96989d9] /usr/lib/frr/zebra(zebra_vxlan_if_vni_up+0x250) [0x5561022ae030] /usr/lib/frr/zebra(netlink_vlan_change+0x2f4) [0x5561021fd354] /usr/lib/frr/zebra(netlink_parse_info+0xff) [0x55610220d37f] /usr/lib/frr/zebra(+0xc264a) [0x55610220d64a] /usr/lib/x86_64-linux-gnu/frr/libfrr.so.0(thread_call+0x7d) [0x7f4af967e96d] /usr/lib/x86_64-linux-gnu/frr/libfrr.so.0(frr_run+0xe8) [0x7f4af9637588] /usr/lib/frr/zebra(main+0x402) [0x5561021f4d32] /lib/x86_64-linux-gnu/libc.so.6(+0x2724a) [0x7f4af932624a] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0x85) [0x7f4af9326305] /usr/lib/frr/zebra(_start+0x21) [0x5561021f72f1] Root Cause: In working case, - We get a RTM_NEWLINK whose ctx is enqueued by zebra dplane and dequeued by zebra main and processed i.e. (102000 is deleted from vxlan99) before we handle RTM_NEWVLAN. - So in handling of NEWVLAN (vxlan99) we bail out since find with vlan id 703 does not exist. root@leaf2:mgmt:/var/log/frr# cat ~/raja_logs/working/nocras.log | grep "RTM_NEWLINK\|QUEUED\|vxlan99\|in thread" 2024/07/18 23:09:33.741105 ZEBRA: [KMXEB-K771Y] netlink_parse_info: netlink-dp-in (NS 0) type RTM_NEWLINK(16), len=616, seq=0, pid=0 2024/07/18 23:09:33.744061 ZEBRA: [K8FXY-V65ZJ] Intf dplane ctx 0x7f2244000cf0, op INTF_INSTALL, ifindex (65), result QUEUED 2024/07/18 23:09:33.767240 ZEBRA: [KMXEB-K771Y] netlink_parse_info: netlink-dp-in (NS 0) type RTM_NEWLINK(16), len=508, seq=0, pid=0 2024/07/18 23:09:33.767380 ZEBRA: [K8FXY-V65ZJ] Intf dplane ctx 0x7f2244000cf0, op INTF_INSTALL, ifindex (73), result QUEUED 2024/07/18 23:09:33.767389 ZEBRA: [NVFT0-HS1EX] INTF_INSTALL for vxlan99(73) 2024/07/18 23:09:33.767404 ZEBRA: [TQR2A-H2RFY] Vlan-Vni(1186:1186-6000002:6000002) update for VxLAN IF vxlan99(73) 2024/07/18 23:09:33.767422 ZEBRA: [TP4VP-XZ627] Del L2-VNI 102000 intf vxlan99(73) 2024/07/18 23:09:33.767858 ZEBRA: [QYXB9-6RNNK] RTM_NEWVLAN bridge IF vxlan99 NS 0 2024/07/18 23:09:33.767866 ZEBRA: [KKZGZ-8PCDW] Cannot find VNI for VID (703) IF vxlan99 for vlan state update >>>>BAIL OUT In failure case, - The NEWVLAN is received first even before processing RTM_NEWLINK. - Since the vxlan id 102000 is not removed from the vxlan99, the find with vlan id 703 returns the 102000 one and we invoke zebra_vxlan_if_vni_up where the interfaces don't match and assert. root@leaf2:mgmt:/var/log/frr# cat ~/raja_logs/noworking/crash.log | grep "RTM_NEWLINK\|QUEUED\|vxlan99\|in thread" 2024/07/18 22:26:43.829370 ZEBRA: [KMXEB-K771Y] netlink_parse_info: netlink-dp-in (NS 0) type RTM_NEWLINK(16), len=616, seq=0, pid=0 2024/07/18 22:26:43.829646 ZEBRA: [K8FXY-V65ZJ] Intf dplane ctx 0x7fe07c026d30, op INTF_INSTALL, ifindex (65), result QUEUED 2024/07/18 22:26:43.853930 ZEBRA: [QYXB9-6RNNK] RTM_NEWVLAN bridge IF vxlan99 NS 0 2024/07/18 22:26:43.853949 ZEBRA: [K61WJ-XQQ3X] Intf vxlan99(73) L2-VNI 102000 is UP >>> VLAN PROCESSED BEFORE INTF EVENT 2024/07/18 22:26:43.853951 ZEBRA: [SPV50-BX2RP] RAJA zevpn_vxlanif vxlan48 and ifp vxlan99 2024/07/18 22:26:43.854005 ZEBRA: [KMXEB-K771Y] netlink_parse_info: netlink-dp-in (NS 0) type RTM_NEWLINK(16), len=508, seq=0, pid=0 2024/07/18 22:26:43.854241 ZEBRA: [KMXEB-K771Y] netlink_parse_info: netlink-dp-in (NS 0) type RTM_NEWLINK(16), len=516, seq=0, pid=0 2024/07/18 22:26:43.854251 ZEBRA: [KMXEB-K771Y] netlink_parse_info: netlink-dp-in (NS 0) type RTM_NEWLINK(16), len=544, seq=0, pid=0 ZEBRA: in thread kernel_read scheduled from zebra/kernel_netlink.c:505 kernel_read() Fix: Similar to FRRouting#13396, where link change handling was offloaded to dplane, same is being done for vlan events. Note: Prior to this change, zebra main thread was interested in the RTNLGRP_BRVLAN. So all the kernel events pertaining to vlan was handled by zebra main. With this change change as well the handling of vlan events is still with Zebra main. However we offload it via Dplane thread. Ticket :#3878175 Signed-off-by: Rajasekar Raja <[email protected]>
1 parent 15e5385 commit 7a05e11

12 files changed

Lines changed: 226 additions & 62 deletions

zebra/dpdk/zebra_dplane_dpdk.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -407,6 +407,7 @@ static void zd_dpdk_rule_update(struct zebra_dplane_ctx *ctx)
407407
case DPLANE_OP_INTF_UPDATE:
408408
case DPLANE_OP_INTF_DELETE:
409409
case DPLANE_OP_ROUTE_LAST:
410+
case DPLANE_OP_VLAN_INSTALL,
410411
break;
411412
}
412413
}
@@ -467,6 +468,7 @@ static void zd_dpdk_process_update(struct zebra_dplane_ctx *ctx)
467468
case DPLANE_OP_INTF_UPDATE:
468469
case DPLANE_OP_INTF_DELETE:
469470
case DPLANE_OP_ROUTE_LAST:
471+
case DPLANE_OP_VLAN_INSTALL,
470472
atomic_fetch_add_explicit(&dpdk_stat->ignored_updates, 1,
471473
memory_order_relaxed);
472474

zebra/dplane_fpm_nl.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -990,6 +990,7 @@ static int fpm_nl_enqueue(struct fpm_nl_ctx *fnc, struct zebra_dplane_ctx *ctx)
990990
case DPLANE_OP_SRV6_ENCAP_SRCADDR_SET:
991991
case DPLANE_OP_NONE:
992992
case DPLANE_OP_STARTUP_STAGE:
993+
case DPLANE_OP_VLAN_INSTALL:
993994
break;
994995

995996
}

zebra/if_netlink.c

Lines changed: 46 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@
6464
#include "zebra/netconf_netlink.h"
6565
#include "zebra/zebra_trace.h"
6666
#include "zebra/zebra_evpn_arp_nd.h"
67-
#include "zebra/zebra_trace.h"
6867

6968
extern struct zebra_privs_t zserv_privs;
7069

@@ -1907,6 +1906,20 @@ int netlink_tunneldump_read(struct zebra_ns *zns)
19071906
return 0;
19081907
}
19091908

1909+
static uint8_t netlink_get_dplane_vlan_state(uint8_t state)
1910+
{
1911+
if (state == BR_STATE_LISTENING)
1912+
return ZEBRA_DPLANE_BR_STATE_LISTENING;
1913+
else if (state == BR_STATE_LEARNING)
1914+
return ZEBRA_DPLANE_BR_STATE_LEARNING;
1915+
else if (state == BR_STATE_FORWARDING)
1916+
return ZEBRA_DPLANE_BR_STATE_FORWARDING;
1917+
else if (state == BR_STATE_BLOCKING)
1918+
return ZEBRA_DPLANE_BR_STATE_BLOCKING;
1919+
1920+
return ZEBRA_DPLANE_BR_STATE_DISABLED;
1921+
}
1922+
19101923
/**
19111924
* netlink_vlan_change() - Read in change about vlans from the kernel
19121925
*
@@ -1919,14 +1932,16 @@ int netlink_tunneldump_read(struct zebra_ns *zns)
19191932
int netlink_vlan_change(struct nlmsghdr *h, ns_id_t ns_id, int startup)
19201933
{
19211934
int len, rem;
1922-
struct interface *ifp;
19231935
struct br_vlan_msg *bvm;
19241936
struct bridge_vlan_info *vinfo;
19251937
struct rtattr *vtb[BRIDGE_VLANDB_ENTRY_MAX + 1] = {};
19261938
struct rtattr *attr;
19271939
uint8_t state;
19281940
uint32_t vrange;
19291941
int type;
1942+
uint32_t count = 0;
1943+
struct zebra_dplane_ctx *ctx = NULL;
1944+
struct zebra_vxlan_vlan_array *vlan_array = NULL;
19301945

19311946
/* We only care about state changes for now */
19321947
if (!(h->nlmsg_type == RTM_NEWVLAN))
@@ -1946,27 +1961,10 @@ int netlink_vlan_change(struct nlmsghdr *h, ns_id_t ns_id, int startup)
19461961
if (bvm->family != AF_BRIDGE)
19471962
return 0;
19481963

1949-
ifp = if_lookup_by_index_per_ns(zebra_ns_lookup(ns_id), bvm->ifindex);
1950-
if (!ifp) {
1951-
zlog_debug("Cannot find bridge-vlan IF (%u) for vlan update",
1952-
bvm->ifindex);
1953-
frrtrace(3, frr_zebra, netlink_intf_err, INTF_INVALID_NAME, bvm->ifindex, 4);
1954-
return 0;
1955-
}
1956-
1957-
if (!IS_ZEBRA_IF_VXLAN(ifp)) {
1958-
if (IS_ZEBRA_DEBUG_KERNEL)
1959-
zlog_debug("Ignoring non-vxlan IF (%s) for vlan update",
1960-
ifp->name);
1961-
1962-
frrtrace(3, frr_zebra, netlink_intf_err, ifp->name, INTF_INVALID_INDEX, 5);
1963-
return 0;
1964-
}
1965-
1966-
if (IS_ZEBRA_DEBUG_KERNEL || IS_ZEBRA_DEBUG_VXLAN)
1967-
zlog_debug("%s %s IF %s NS %u",
1968-
nl_msg_type_to_str(h->nlmsg_type),
1969-
nl_family_to_str(bvm->family), ifp->name, ns_id);
1964+
ctx = dplane_ctx_alloc();
1965+
dplane_ctx_set_ns_id(ctx, ns_id);
1966+
dplane_ctx_set_op(ctx, DPLANE_OP_VLAN_INSTALL);
1967+
dplane_ctx_set_vlan_ifindex(ctx, bvm->ifindex);
19701968

19711969
/* Loop over "ALL" BRIDGE_VLANDB_ENTRY */
19721970
rem = len;
@@ -1997,28 +1995,39 @@ int netlink_vlan_change(struct nlmsghdr *h, ns_id_t ns_id, int startup)
19971995
if (!vtb[BRIDGE_VLANDB_ENTRY_STATE])
19981996
continue;
19991997

1998+
count++;
1999+
vlan_array =
2000+
XREALLOC(MTYPE_VLAN_CHANGE_ARR, vlan_array,
2001+
sizeof(struct zebra_vxlan_vlan_array) +
2002+
count * sizeof(struct zebra_vxlan_vlan));
2003+
2004+
memset(&vlan_array->vlans[count - 1], 0,
2005+
sizeof(struct zebra_vxlan_vlan));
2006+
20002007
state = *(uint8_t *)RTA_DATA(vtb[BRIDGE_VLANDB_ENTRY_STATE]);
20012008

20022009
if (vtb[BRIDGE_VLANDB_ENTRY_RANGE])
20032010
vrange = *(uint32_t *)RTA_DATA(
20042011
vtb[BRIDGE_VLANDB_ENTRY_RANGE]);
20052012

2006-
if (IS_ZEBRA_DEBUG_KERNEL || IS_ZEBRA_DEBUG_VXLAN) {
2007-
if (vrange)
2008-
zlog_debug("VLANDB_ENTRY: VID (%u-%u) state=%s",
2009-
vinfo->vid, vrange,
2010-
port_state2str(state));
2011-
else
2012-
zlog_debug("VLANDB_ENTRY: VID (%u) state=%s",
2013-
vinfo->vid, port_state2str(state));
2014-
}
2015-
if (vinfo)
2016-
frrtrace(7, frr_zebra, netlink_vlan_change, h, bvm, ns_id, vinfo, vrange,
2017-
state, ifp);
2018-
vlan_id_range_state_change(
2019-
ifp, vinfo->vid, (vrange ? vrange : vinfo->vid), state);
2013+
vlan_array->vlans[count - 1].state =
2014+
netlink_get_dplane_vlan_state(state);
2015+
vlan_array->vlans[count - 1].vid = vinfo->vid;
2016+
vlan_array->vlans[count - 1].vrange = vrange;
20202017
}
20212018

2019+
if (count) {
2020+
vlan_array->count = count;
2021+
dplane_ctx_set_vxlan_vlan_array(ctx, vlan_array);
2022+
if (IS_ZEBRA_DEBUG_KERNEL || IS_ZEBRA_DEBUG_VXLAN)
2023+
zlog_debug("RTM_NEWVLAN for ifindex %u NS %u, enqueuing for zebra main",
2024+
bvm->ifindex, ns_id);
2025+
2026+
dplane_provider_enqueue_to_zebra(ctx);
2027+
} else
2028+
dplane_ctx_fini(&ctx);
2029+
2030+
20222031
return 0;
20232032
}
20242033

zebra/kernel_netlink.c

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -430,10 +430,6 @@ static int netlink_information_fetch(struct nlmsghdr *h, ns_id_t ns_id,
430430
case RTM_NEWTFILTER:
431431
case RTM_DELTFILTER:
432432
return netlink_tfilter_change(h, ns_id, startup);
433-
case RTM_NEWVLAN:
434-
return netlink_vlan_change(h, ns_id, startup);
435-
case RTM_DELVLAN:
436-
return netlink_vlan_change(h, ns_id, startup);
437433

438434
/* Messages we may receive, but ignore */
439435
case RTM_NEWCHAIN:
@@ -449,6 +445,8 @@ static int netlink_information_fetch(struct nlmsghdr *h, ns_id_t ns_id,
449445
case RTM_NEWTUNNEL:
450446
case RTM_DELTUNNEL:
451447
case RTM_GETTUNNEL:
448+
case RTM_NEWVLAN:
449+
case RTM_DELVLAN:
452450
return 0;
453451
default:
454452
/*
@@ -492,6 +490,10 @@ static int dplane_netlink_information_fetch(struct nlmsghdr *h, ns_id_t ns_id,
492490
case RTM_DELLINK:
493491
return netlink_link_change(h, ns_id, startup);
494492

493+
case RTM_NEWVLAN:
494+
case RTM_DELVLAN:
495+
return netlink_vlan_change(h, ns_id, startup);
496+
495497
default:
496498
break;
497499
}
@@ -1642,6 +1644,7 @@ static enum netlink_msg_status nl_put_msg(struct nl_batch *bth,
16421644
case DPLANE_OP_IPSET_ENTRY_ADD:
16431645
case DPLANE_OP_IPSET_ENTRY_DELETE:
16441646
case DPLANE_OP_STARTUP_STAGE:
1647+
case DPLANE_OP_VLAN_INSTALL:
16451648
return FRR_NETLINK_ERROR;
16461649

16471650
case DPLANE_OP_GRE_SET:
@@ -1883,8 +1886,8 @@ void kernel_init(struct zebra_ns *zns)
18831886
* setsockopt multicast group subscriptions that don't fit in nl_groups
18841887
*/
18851888
grp = RTNLGRP_BRVLAN;
1886-
ret = setsockopt(zns->netlink.sock, SOL_NETLINK, NETLINK_ADD_MEMBERSHIP,
1887-
&grp, sizeof(grp));
1889+
ret = setsockopt(zns->netlink_dplane_in.sock, SOL_NETLINK,
1890+
NETLINK_ADD_MEMBERSHIP, &grp, sizeof(grp));
18881891

18891892
if (ret < 0)
18901893
zlog_notice(

zebra/kernel_socket.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1626,6 +1626,7 @@ void kernel_update_multi(struct dplane_ctx_list_head *ctx_list)
16261626
case DPLANE_OP_INTF_ADDR_DEL:
16271627
case DPLANE_OP_STARTUP_STAGE:
16281628
case DPLANE_OP_SRV6_ENCAP_SRCADDR_SET:
1629+
case DPLANE_OP_VLAN_INSTALL:
16291630
zlog_err("Unhandled dplane data for %s",
16301631
dplane_op2str(dplane_ctx_get_op(ctx)));
16311632
res = ZEBRA_DPLANE_REQUEST_FAILURE;

zebra/zebra_dplane.c

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ DEFINE_MTYPE_STATIC(ZEBRA, DP_PROV, "Zebra DPlane Provider");
3636
DEFINE_MTYPE_STATIC(ZEBRA, DP_NETFILTER, "Zebra Netfilter Internal Object");
3737
DEFINE_MTYPE_STATIC(ZEBRA, DP_NS, "DPlane NSes");
3838

39+
DEFINE_MTYPE(ZEBRA, VLAN_CHANGE_ARR, "Vlan Change Array");
40+
3941
#ifndef AOK
4042
# define AOK 0
4143
#endif
@@ -375,6 +377,14 @@ struct dplane_srv6_encap_ctx {
375377
struct in6_addr srcaddr;
376378
};
377379

380+
/*
381+
* VLAN info for the dataplane
382+
*/
383+
struct dplane_vlan_info {
384+
ifindex_t ifindex;
385+
struct zebra_vxlan_vlan_array *vlan_array;
386+
};
387+
378388
/*
379389
* The context block used to exchange info about route updates across
380390
* the boundary between the zebra main context (and pthread) and the
@@ -421,6 +431,7 @@ struct zebra_dplane_ctx {
421431
struct dplane_pw_info pw;
422432
struct dplane_br_port_info br_port;
423433
struct dplane_intf_info intf;
434+
struct dplane_vlan_info vlan_info;
424435
struct dplane_mac_info macinfo;
425436
struct dplane_neigh_info neigh;
426437
struct dplane_rule_info rule;
@@ -893,6 +904,11 @@ static void dplane_ctx_free_internal(struct zebra_dplane_ctx *ctx)
893904
case DPLANE_OP_STARTUP_STAGE:
894905
case DPLANE_OP_SRV6_ENCAP_SRCADDR_SET:
895906
break;
907+
case DPLANE_OP_VLAN_INSTALL:
908+
if (ctx->u.vlan_info.vlan_array)
909+
XFREE(MTYPE_VLAN_CHANGE_ARR,
910+
ctx->u.vlan_info.vlan_array);
911+
break;
896912
}
897913
}
898914

@@ -1245,6 +1261,10 @@ const char *dplane_op2str(enum dplane_op_e op)
12451261
case DPLANE_OP_SRV6_ENCAP_SRCADDR_SET:
12461262
ret = "SRV6_ENCAP_SRCADDR_SET";
12471263
break;
1264+
1265+
case DPLANE_OP_VLAN_INSTALL:
1266+
ret = "NEW_VLAN";
1267+
break;
12481268
}
12491269

12501270
return ret;
@@ -3399,6 +3419,35 @@ uint32_t dplane_get_in_queue_len(void)
33993419
memory_order_seq_cst);
34003420
}
34013421

3422+
void dplane_ctx_set_vlan_ifindex(struct zebra_dplane_ctx *ctx, ifindex_t ifindex)
3423+
{
3424+
DPLANE_CTX_VALID(ctx);
3425+
ctx->u.vlan_info.ifindex = ifindex;
3426+
}
3427+
3428+
ifindex_t dplane_ctx_get_vlan_ifindex(struct zebra_dplane_ctx *ctx)
3429+
{
3430+
DPLANE_CTX_VALID(ctx);
3431+
3432+
return ctx->u.vlan_info.ifindex;
3433+
}
3434+
3435+
void dplane_ctx_set_vxlan_vlan_array(struct zebra_dplane_ctx *ctx,
3436+
struct zebra_vxlan_vlan_array *vlan_array)
3437+
{
3438+
DPLANE_CTX_VALID(ctx);
3439+
3440+
ctx->u.vlan_info.vlan_array = vlan_array;
3441+
}
3442+
3443+
const struct zebra_vxlan_vlan_array *
3444+
dplane_ctx_get_vxlan_vlan_array(struct zebra_dplane_ctx *ctx)
3445+
{
3446+
DPLANE_CTX_VALID(ctx);
3447+
3448+
return ctx->u.vlan_info.vlan_array;
3449+
}
3450+
34023451
/*
34033452
* Internal helper that copies information from a zebra ns object; this is
34043453
* called in the zebra main pthread context as part of dplane ctx init.
@@ -6868,6 +6917,12 @@ static void kernel_dplane_log_detail(struct zebra_dplane_ctx *ctx)
68686917
dplane_op2str(dplane_ctx_get_op(ctx)),
68696918
&ctx->u.srv6_encap.srcaddr);
68706919
break;
6920+
6921+
case DPLANE_OP_VLAN_INSTALL:
6922+
zlog_debug("Dplane %s on idx %u",
6923+
dplane_op2str(dplane_ctx_get_op(ctx)),
6924+
dplane_ctx_get_vlan_ifindex(ctx));
6925+
break;
68716926
}
68726927
}
68736928

@@ -7042,6 +7097,7 @@ static void kernel_dplane_handle_result(struct zebra_dplane_ctx *ctx)
70427097
case DPLANE_OP_INTF_ADDR_ADD:
70437098
case DPLANE_OP_INTF_ADDR_DEL:
70447099
case DPLANE_OP_INTF_NETCONFIG:
7100+
case DPLANE_OP_VLAN_INSTALL:
70457101
break;
70467102

70477103
case DPLANE_OP_SRV6_ENCAP_SRCADDR_SET:

zebra/zebra_dplane.h

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424
extern "C" {
2525
#endif
2626

27+
DECLARE_MTYPE(VLAN_CHANGE_ARR);
28+
2729
/* Retrieve the dataplane API version number; see libfrr.h to decode major,
2830
* minor, sub version values.
2931
* Plugins should pay attention to the major version number, at least, to
@@ -204,6 +206,9 @@ enum dplane_op_e {
204206
DPLANE_OP_TC_FILTER_DELETE,
205207
DPLANE_OP_TC_FILTER_UPDATE,
206208

209+
/* VLAN update */
210+
DPLANE_OP_VLAN_INSTALL,
211+
207212
/* Startup Control */
208213
DPLANE_OP_STARTUP_STAGE,
209214

@@ -213,6 +218,13 @@ enum dplane_op_e {
213218
DPLANE_OP_ROUTE_LAST,
214219
};
215220

221+
/* Operational status of Bridge Ports */
222+
#define ZEBRA_DPLANE_BR_STATE_DISABLED 0x01
223+
#define ZEBRA_DPLANE_BR_STATE_LISTENING 0x02
224+
#define ZEBRA_DPLANE_BR_STATE_LEARNING 0x04
225+
#define ZEBRA_DPLANE_BR_STATE_FORWARDING 0x08
226+
#define ZEBRA_DPLANE_BR_STATE_BLOCKING 0x10
227+
216228
/*
217229
* The vxlan/evpn neighbor management code needs some values to use
218230
* when programming neighbor changes. Offer some platform-neutral values
@@ -1094,6 +1106,26 @@ void dplane_set_in_queue_limit(uint32_t limit, bool set);
10941106
/* Retrieve the current queue depth of incoming, unprocessed updates */
10951107
uint32_t dplane_get_in_queue_len(void);
10961108

1109+
void dplane_ctx_set_vlan_ifindex(struct zebra_dplane_ctx *ctx,
1110+
ifindex_t ifindex);
1111+
ifindex_t dplane_ctx_get_vlan_ifindex(struct zebra_dplane_ctx *ctx);
1112+
struct zebra_vxlan_vlan_array;
1113+
1114+
/*
1115+
* In netlink_vlan_change(), the memory allocated for vlan_array is freed
1116+
* in two cases
1117+
* 1) Inline free in netlink_vlan_change() when there are no new
1118+
* vlans to process i.e. nothing is enqueued to main thread.
1119+
* 2) Dplane-ctx takes over the vlan memory which gets freed in
1120+
* rib_process_dplane_results() after handling the vlan install
1121+
*
1122+
* Note: MTYPE of interest for this purpose is MTYPE_VLAN_CHANGE_ARR
1123+
*/
1124+
void dplane_ctx_set_vxlan_vlan_array(struct zebra_dplane_ctx *ctx,
1125+
struct zebra_vxlan_vlan_array *vlan_array);
1126+
const struct zebra_vxlan_vlan_array *
1127+
dplane_ctx_get_vxlan_vlan_array(struct zebra_dplane_ctx *ctx);
1128+
10971129
/*
10981130
* Vty/cli apis
10991131
*/

0 commit comments

Comments
 (0)