Skip to content

Commit 5f82e9d

Browse files
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 <rajasekarr@nvidia.com>
1 parent 1632988 commit 5f82e9d

12 files changed

Lines changed: 219 additions & 60 deletions

zebra/dpdk/zebra_dplane_dpdk.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -400,6 +400,7 @@ static void zd_dpdk_rule_update(struct zebra_dplane_ctx *ctx)
400400
case DPLANE_OP_INTF_INSTALL:
401401
case DPLANE_OP_INTF_UPDATE:
402402
case DPLANE_OP_INTF_DELETE:
403+
case DPLANE_OP_VLAN_INSTALL,
403404
break;
404405
}
405406
}
@@ -459,6 +460,7 @@ static void zd_dpdk_process_update(struct zebra_dplane_ctx *ctx)
459460
case DPLANE_OP_INTF_INSTALL:
460461
case DPLANE_OP_INTF_UPDATE:
461462
case DPLANE_OP_INTF_DELETE:
463+
case DPLANE_OP_VLAN_INSTALL,
462464
atomic_fetch_add_explicit(&dpdk_stat->ignored_updates, 1,
463465
memory_order_relaxed);
464466

zebra/dplane_fpm_nl.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1058,6 +1058,7 @@ static int fpm_nl_enqueue(struct fpm_nl_ctx *fnc, struct zebra_dplane_ctx *ctx)
10581058
case DPLANE_OP_SRV6_ENCAP_SRCADDR_SET:
10591059
case DPLANE_OP_NONE:
10601060
case DPLANE_OP_STARTUP_STAGE:
1061+
case DPLANE_OP_VLAN_INSTALL:
10611062
break;
10621063

10631064
}

zebra/if_netlink.c

Lines changed: 46 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@
6363
#include "zebra/zebra_l2.h"
6464
#include "zebra/netconf_netlink.h"
6565
#include "zebra/zebra_trace.h"
66-
#include "zebra/zebra_vxlan.h"
6766

6867
extern struct zebra_privs_t zserv_privs;
6968

@@ -1817,6 +1816,20 @@ int netlink_tunneldump_read(struct zebra_ns *zns)
18171816
return 0;
18181817
}
18191818

1819+
static uint8_t netlink_get_dplane_vlan_state(uint8_t state)
1820+
{
1821+
if (state == BR_STATE_LISTENING)
1822+
return ZEBRA_DPLANE_BR_STATE_LISTENING;
1823+
else if (state == BR_STATE_LEARNING)
1824+
return ZEBRA_DPLANE_BR_STATE_LEARNING;
1825+
else if (state == BR_STATE_FORWARDING)
1826+
return ZEBRA_DPLANE_BR_STATE_FORWARDING;
1827+
else if (state == BR_STATE_BLOCKING)
1828+
return ZEBRA_DPLANE_BR_STATE_BLOCKING;
1829+
1830+
return ZEBRA_DPLANE_BR_STATE_DISABLED;
1831+
}
1832+
18201833
/**
18211834
* netlink_vlan_change() - Read in change about vlans from the kernel
18221835
*
@@ -1829,14 +1842,16 @@ int netlink_tunneldump_read(struct zebra_ns *zns)
18291842
int netlink_vlan_change(struct nlmsghdr *h, ns_id_t ns_id, int startup)
18301843
{
18311844
int len, rem;
1832-
struct interface *ifp;
18331845
struct br_vlan_msg *bvm;
18341846
struct bridge_vlan_info *vinfo;
18351847
struct rtattr *vtb[BRIDGE_VLANDB_ENTRY_MAX + 1] = {};
18361848
struct rtattr *attr;
18371849
uint8_t state;
18381850
uint32_t vrange;
18391851
int type;
1852+
uint32_t count = 0;
1853+
struct zebra_dplane_ctx *ctx = NULL;
1854+
struct zebra_vxlan_vlan_array *vlan_array = NULL;
18401855

18411856
/* We only care about state changes for now */
18421857
if (!(h->nlmsg_type == RTM_NEWVLAN))
@@ -1856,25 +1871,10 @@ int netlink_vlan_change(struct nlmsghdr *h, ns_id_t ns_id, int startup)
18561871
if (bvm->family != AF_BRIDGE)
18571872
return 0;
18581873

1859-
ifp = if_lookup_by_index_per_ns(zebra_ns_lookup(ns_id), bvm->ifindex);
1860-
if (!ifp) {
1861-
zlog_debug("Cannot find bridge-vlan IF (%u) for vlan update",
1862-
bvm->ifindex);
1863-
return 0;
1864-
}
1865-
1866-
if (!IS_ZEBRA_IF_VXLAN(ifp)) {
1867-
if (IS_ZEBRA_DEBUG_KERNEL)
1868-
zlog_debug("Ignoring non-vxlan IF (%s) for vlan update",
1869-
ifp->name);
1870-
1871-
return 0;
1872-
}
1873-
1874-
if (IS_ZEBRA_DEBUG_KERNEL || IS_ZEBRA_DEBUG_VXLAN)
1875-
zlog_debug("%s %s IF %s NS %u",
1876-
nl_msg_type_to_str(h->nlmsg_type),
1877-
nl_family_to_str(bvm->family), ifp->name, ns_id);
1874+
ctx = dplane_ctx_alloc();
1875+
dplane_ctx_set_ns_id(ctx, ns_id);
1876+
dplane_ctx_set_op(ctx, DPLANE_OP_VLAN_INSTALL);
1877+
dplane_ctx_set_vlan_ifindex(ctx, bvm->ifindex);
18781878

18791879
/* Loop over "ALL" BRIDGE_VLANDB_ENTRY */
18801880
rem = len;
@@ -1905,26 +1905,39 @@ int netlink_vlan_change(struct nlmsghdr *h, ns_id_t ns_id, int startup)
19051905
if (!vtb[BRIDGE_VLANDB_ENTRY_STATE])
19061906
continue;
19071907

1908+
count++;
1909+
vlan_array =
1910+
XREALLOC(MTYPE_VLAN_CHANGE_ARR, vlan_array,
1911+
sizeof(struct zebra_vxlan_vlan_array) +
1912+
count * sizeof(struct zebra_vxlan_vlan));
1913+
1914+
memset(&vlan_array->vlans[count - 1], 0,
1915+
sizeof(struct zebra_vxlan_vlan));
1916+
19081917
state = *(uint8_t *)RTA_DATA(vtb[BRIDGE_VLANDB_ENTRY_STATE]);
19091918

19101919
if (vtb[BRIDGE_VLANDB_ENTRY_RANGE])
19111920
vrange = *(uint32_t *)RTA_DATA(
19121921
vtb[BRIDGE_VLANDB_ENTRY_RANGE]);
19131922

1914-
if (IS_ZEBRA_DEBUG_KERNEL || IS_ZEBRA_DEBUG_VXLAN) {
1915-
if (vrange)
1916-
zlog_debug("VLANDB_ENTRY: VID (%u-%u) state=%s",
1917-
vinfo->vid, vrange,
1918-
port_state2str(state));
1919-
else
1920-
zlog_debug("VLANDB_ENTRY: VID (%u) state=%s",
1921-
vinfo->vid, port_state2str(state));
1922-
}
1923-
1924-
vlan_id_range_state_change(
1925-
ifp, vinfo->vid, (vrange ? vrange : vinfo->vid), state);
1923+
vlan_array->vlans[count - 1].state =
1924+
netlink_get_dplane_vlan_state(state);
1925+
vlan_array->vlans[count - 1].vid = vinfo->vid;
1926+
vlan_array->vlans[count - 1].vrange = vrange;
19261927
}
19271928

1929+
if (count) {
1930+
vlan_array->count = count;
1931+
dplane_ctx_set_vxlan_vlan_array(ctx, vlan_array);
1932+
if (IS_ZEBRA_DEBUG_KERNEL || IS_ZEBRA_DEBUG_VXLAN)
1933+
zlog_debug("RTM_NEWVLAN for ifindex %u NS %u, enqueuing for zebra main",
1934+
bvm->ifindex, ns_id);
1935+
1936+
dplane_provider_enqueue_to_zebra(ctx);
1937+
} else
1938+
dplane_ctx_fini(&ctx);
1939+
1940+
19281941
return 0;
19291942
}
19301943

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
}
@@ -1621,6 +1623,7 @@ static enum netlink_msg_status nl_put_msg(struct nl_batch *bth,
16211623
case DPLANE_OP_IPSET_ENTRY_ADD:
16221624
case DPLANE_OP_IPSET_ENTRY_DELETE:
16231625
case DPLANE_OP_STARTUP_STAGE:
1626+
case DPLANE_OP_VLAN_INSTALL:
16241627
return FRR_NETLINK_ERROR;
16251628

16261629
case DPLANE_OP_GRE_SET:
@@ -1862,8 +1865,8 @@ void kernel_init(struct zebra_ns *zns)
18621865
* setsockopt multicast group subscriptions that don't fit in nl_groups
18631866
*/
18641867
grp = RTNLGRP_BRVLAN;
1865-
ret = setsockopt(zns->netlink.sock, SOL_NETLINK, NETLINK_ADD_MEMBERSHIP,
1866-
&grp, sizeof(grp));
1868+
ret = setsockopt(zns->netlink_dplane_in.sock, SOL_NETLINK,
1869+
NETLINK_ADD_MEMBERSHIP, &grp, sizeof(grp));
18671870

18681871
if (ret < 0)
18691872
zlog_notice(

zebra/kernel_socket.c

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

zebra/zebra_dplane.c

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

38+
DEFINE_MTYPE(ZEBRA, VLAN_CHANGE_ARR, "Vlan Change Array");
39+
3840
#ifndef AOK
3941
# define AOK 0
4042
#endif
@@ -370,6 +372,14 @@ struct dplane_srv6_encap_ctx {
370372
struct in6_addr srcaddr;
371373
};
372374

375+
/*
376+
* VLAN info for the dataplane
377+
*/
378+
struct dplane_vlan_info {
379+
ifindex_t ifindex;
380+
struct zebra_vxlan_vlan_array *vlan_array;
381+
};
382+
373383
/*
374384
* The context block used to exchange info about route updates across
375385
* the boundary between the zebra main context (and pthread) and the
@@ -416,6 +426,7 @@ struct zebra_dplane_ctx {
416426
struct dplane_pw_info pw;
417427
struct dplane_br_port_info br_port;
418428
struct dplane_intf_info intf;
429+
struct dplane_vlan_info vlan_info;
419430
struct dplane_mac_info macinfo;
420431
struct dplane_neigh_info neigh;
421432
struct dplane_rule_info rule;
@@ -885,6 +896,11 @@ static void dplane_ctx_free_internal(struct zebra_dplane_ctx *ctx)
885896
case DPLANE_OP_STARTUP_STAGE:
886897
case DPLANE_OP_SRV6_ENCAP_SRCADDR_SET:
887898
break;
899+
case DPLANE_OP_VLAN_INSTALL:
900+
if (ctx->u.vlan_info.vlan_array)
901+
XFREE(MTYPE_VLAN_CHANGE_ARR,
902+
ctx->u.vlan_info.vlan_array);
903+
break;
888904
}
889905
}
890906

@@ -1219,6 +1235,10 @@ const char *dplane_op2str(enum dplane_op_e op)
12191235
case DPLANE_OP_SRV6_ENCAP_SRCADDR_SET:
12201236
ret = "SRV6_ENCAP_SRCADDR_SET";
12211237
break;
1238+
1239+
case DPLANE_OP_VLAN_INSTALL:
1240+
ret = "NEW_VLAN";
1241+
break;
12221242
}
12231243

12241244
return ret;
@@ -3321,6 +3341,39 @@ uint32_t dplane_get_in_queue_len(void)
33213341
memory_order_seq_cst);
33223342
}
33233343

3344+
void dplane_ctx_set_vlan_ifindex(struct zebra_dplane_ctx *ctx, ifindex_t ifindex)
3345+
{
3346+
DPLANE_CTX_VALID(ctx);
3347+
ctx->u.vlan_info.ifindex = ifindex;
3348+
}
3349+
3350+
ifindex_t dplane_ctx_get_vlan_ifindex(struct zebra_dplane_ctx *ctx)
3351+
{
3352+
DPLANE_CTX_VALID(ctx);
3353+
3354+
return ctx->u.vlan_info.ifindex;
3355+
}
3356+
3357+
/*
3358+
* Here ctx takes over the memory allocated by vlan_array which gets
3359+
* freed in dplane_ctx_free_internal()
3360+
*/
3361+
void dplane_ctx_set_vxlan_vlan_array(struct zebra_dplane_ctx *ctx,
3362+
struct zebra_vxlan_vlan_array *vlan_array)
3363+
{
3364+
DPLANE_CTX_VALID(ctx);
3365+
3366+
ctx->u.vlan_info.vlan_array = vlan_array;
3367+
}
3368+
3369+
const struct zebra_vxlan_vlan_array *
3370+
dplane_ctx_get_vxlan_vlan_array(struct zebra_dplane_ctx *ctx)
3371+
{
3372+
DPLANE_CTX_VALID(ctx);
3373+
3374+
return ctx->u.vlan_info.vlan_array;
3375+
}
3376+
33243377
/*
33253378
* Internal helper that copies information from a zebra ns object; this is
33263379
* called in the zebra main pthread context as part of dplane ctx init.
@@ -6720,6 +6773,12 @@ static void kernel_dplane_log_detail(struct zebra_dplane_ctx *ctx)
67206773
dplane_op2str(dplane_ctx_get_op(ctx)),
67216774
&ctx->u.srv6_encap.srcaddr);
67226775
break;
6776+
6777+
case DPLANE_OP_VLAN_INSTALL:
6778+
zlog_debug("Dplane %s on idx %u",
6779+
dplane_op2str(dplane_ctx_get_op(ctx)),
6780+
dplane_ctx_get_vlan_ifindex(ctx));
6781+
break;
67236782
}
67246783
}
67256784

@@ -6888,6 +6947,7 @@ static void kernel_dplane_handle_result(struct zebra_dplane_ctx *ctx)
68886947
case DPLANE_OP_INTF_ADDR_ADD:
68896948
case DPLANE_OP_INTF_ADDR_DEL:
68906949
case DPLANE_OP_INTF_NETCONFIG:
6950+
case DPLANE_OP_VLAN_INSTALL:
68916951
break;
68926952

68936953
case DPLANE_OP_SRV6_ENCAP_SRCADDR_SET:

zebra/zebra_dplane.h

Lines changed: 21 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,13 +206,23 @@ 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

210215
/* Source address for SRv6 encapsulation */
211216
DPLANE_OP_SRV6_ENCAP_SRCADDR_SET,
212217
};
213218

219+
/* Operational status of Bridge Ports */
220+
#define ZEBRA_DPLANE_BR_STATE_DISABLED 0x01
221+
#define ZEBRA_DPLANE_BR_STATE_LISTENING 0x02
222+
#define ZEBRA_DPLANE_BR_STATE_LEARNING 0x04
223+
#define ZEBRA_DPLANE_BR_STATE_FORWARDING 0x08
224+
#define ZEBRA_DPLANE_BR_STATE_BLOCKING 0x10
225+
214226
/*
215227
* The vxlan/evpn neighbor management code needs some values to use
216228
* when programming neighbor changes. Offer some platform-neutral values
@@ -1078,6 +1090,15 @@ void dplane_set_in_queue_limit(uint32_t limit, bool set);
10781090
/* Retrieve the current queue depth of incoming, unprocessed updates */
10791091
uint32_t dplane_get_in_queue_len(void);
10801092

1093+
void dplane_ctx_set_vlan_ifindex(struct zebra_dplane_ctx *ctx,
1094+
ifindex_t ifindex);
1095+
ifindex_t dplane_ctx_get_vlan_ifindex(struct zebra_dplane_ctx *ctx);
1096+
struct zebra_vxlan_vlan_array;
1097+
void dplane_ctx_set_vxlan_vlan_array(struct zebra_dplane_ctx *ctx,
1098+
struct zebra_vxlan_vlan_array *vlan_array);
1099+
const struct zebra_vxlan_vlan_array *
1100+
dplane_ctx_get_vxlan_vlan_array(struct zebra_dplane_ctx *ctx);
1101+
10811102
/*
10821103
* Vty/cli apis
10831104
*/

zebra/zebra_l2.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,17 @@ union zebra_l2if_info {
146146
struct zebra_l2info_gre gre;
147147
};
148148

149+
struct zebra_vxlan_vlan {
150+
uint8_t state;
151+
uint32_t vrange;
152+
vlanid_t vid;
153+
};
154+
155+
struct zebra_vxlan_vlan_array {
156+
uint16_t count;
157+
struct zebra_vxlan_vlan vlans[0];
158+
};
159+
149160
/* NOTE: These macros are to be invoked only in the "correct" context.
150161
* IOW, the macro VNI_FROM_ZEBRA_IF() will assume the interface is
151162
* of type ZEBRA_IF_VXLAN.

0 commit comments

Comments
 (0)