* info. The flags values are public, in the dplane.h file...
*/
struct dplane_netconf_info {
- ns_id_t ns_id;
- ifindex_t ifindex;
enum dplane_netconf_status_e mpls_val;
enum dplane_netconf_status_e mcast_val;
+ enum dplane_netconf_status_e linkdown_val;
};
/*
return ctx->u.neightable.mcast_probes;
}
-ifindex_t dplane_ctx_get_netconf_ifindex(const struct zebra_dplane_ctx *ctx)
-{
- DPLANE_CTX_VALID(ctx);
-
- return ctx->u.netconf.ifindex;
-}
-
-ns_id_t dplane_ctx_get_netconf_ns_id(const struct zebra_dplane_ctx *ctx)
-{
- DPLANE_CTX_VALID(ctx);
-
- return ctx->u.netconf.ns_id;
-}
-
-void dplane_ctx_set_netconf_ifindex(struct zebra_dplane_ctx *ctx,
- ifindex_t ifindex)
-{
- DPLANE_CTX_VALID(ctx);
-
- ctx->u.netconf.ifindex = ifindex;
-}
-
-void dplane_ctx_set_netconf_ns_id(struct zebra_dplane_ctx *ctx, ns_id_t ns_id)
+enum dplane_netconf_status_e
+dplane_ctx_get_netconf_mpls(const struct zebra_dplane_ctx *ctx)
{
DPLANE_CTX_VALID(ctx);
- ctx->u.netconf.ns_id = ns_id;
+ return ctx->u.netconf.mpls_val;
}
enum dplane_netconf_status_e
-dplane_ctx_get_netconf_mpls(const struct zebra_dplane_ctx *ctx)
+dplane_ctx_get_netconf_mcast(const struct zebra_dplane_ctx *ctx)
{
DPLANE_CTX_VALID(ctx);
- return ctx->u.netconf.mpls_val;
+ return ctx->u.netconf.mcast_val;
}
enum dplane_netconf_status_e
-dplane_ctx_get_netconf_mcast(const struct zebra_dplane_ctx *ctx)
+dplane_ctx_get_netconf_linkdown(const struct zebra_dplane_ctx *ctx)
{
DPLANE_CTX_VALID(ctx);
- return ctx->u.netconf.mcast_val;
+ return ctx->u.netconf.linkdown_val;
}
void dplane_ctx_set_netconf_mpls(struct zebra_dplane_ctx *ctx,
ctx->u.netconf.mcast_val = val;
}
+void dplane_ctx_set_netconf_linkdown(struct zebra_dplane_ctx *ctx,
+ enum dplane_netconf_status_e val)
+{
+ DPLANE_CTX_VALID(ctx);
+
+ ctx->u.netconf.linkdown_val = val;
+}
+
+
/*
* Retrieve the limit on the number of pending, unprocessed updates.
*/
}
/* Check for available evpn encapsulations. */
- if (!CHECK_FLAG(re->flags, ZEBRA_FLAG_EVPN_ROUTE))
+ if (!CHECK_FLAG(nexthop->flags, NEXTHOP_FLAG_EVPN))
continue;
zl3vni = zl3vni_from_vrf(nexthop->vrf_id);
struct zebra_dplane_ctx *ctx;
int ret;
+ if ((op == DPLANE_OP_IPTABLE_ADD &&
+ CHECK_FLAG(iptable->internal_flags, IPTABLE_INSTALL_QUEUED)) ||
+ (op == DPLANE_OP_IPTABLE_DELETE &&
+ CHECK_FLAG(iptable->internal_flags, IPTABLE_UNINSTALL_QUEUED))) {
+ if (IS_ZEBRA_DEBUG_DPLANE_DETAIL)
+ zlog_debug(
+ "update dplane ctx %s: iptable %s already in progress",
+ dplane_op2str(op), iptable->ipset_name);
+ return result;
+ }
+
ctx = dplane_ctx_alloc();
ret = dplane_ctx_iptable_init(ctx, op, iptable);
atomic_fetch_add_explicit(&zdplane_info.dg_iptable_in, 1,
memory_order_relaxed);
- if (ret == AOK)
+ if (ret == AOK) {
result = ZEBRA_DPLANE_REQUEST_QUEUED;
- else {
+ if (op == DPLANE_OP_IPTABLE_ADD)
+ SET_FLAG(iptable->internal_flags,
+ IPTABLE_INSTALL_QUEUED);
+ else
+ SET_FLAG(iptable->internal_flags,
+ IPTABLE_UNINSTALL_QUEUED);
+ } else {
atomic_fetch_add_explicit(&zdplane_info.dg_iptable_errors, 1,
memory_order_relaxed);
dplane_ctx_free(&ctx);
}
-
return result;
}
case DPLANE_OP_INTF_NETCONFIG:
zlog_debug("%s: ifindex %d, mpls %d, mcast %d",
dplane_op2str(dplane_ctx_get_op(ctx)),
- dplane_ctx_get_netconf_ifindex(ctx),
+ dplane_ctx_get_ifindex(ctx),
dplane_ctx_get_netconf_mpls(ctx),
dplane_ctx_get_netconf_mcast(ctx));
break;