summaryrefslogtreecommitdiff
path: root/zebra/zebra_dplane.c
diff options
context:
space:
mode:
authorStephen Worley <sworley@nvidia.com>2022-01-21 04:03:01 -0500
committerStephen Worley <sworley@nvidia.com>2022-03-09 17:52:44 -0500
commit71ef5cbb9563e09a76996448a7f34cec37ed3c15 (patch)
tree31a6044851e4b37f692e849b1a079025efdb33fb /zebra/zebra_dplane.c
parentc40e1b1cfbbf8db7b03f9faa51afbea8cda722c3 (diff)
zebra: add enum set/unset states for queing
Add enums for set/unset of prodown state to handle the mainthread knowing an update is already queued without actually marking it as complete. This is to make the logic confirm a bit more with other parts of the code where we queue dplane updates and not update our internal structs until success callback is received. Signed-off-by: Stephen Worley <sworley@nvidia.com>
Diffstat (limited to 'zebra/zebra_dplane.c')
-rw-r--r--zebra/zebra_dplane.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/zebra/zebra_dplane.c b/zebra/zebra_dplane.c
index abafa6f8fe..f60951cac4 100644
--- a/zebra/zebra_dplane.c
+++ b/zebra/zebra_dplane.c
@@ -2694,6 +2694,7 @@ int dplane_ctx_intf_init(struct zebra_dplane_ctx *ctx, enum dplane_op_e op,
struct zebra_ns *zns = NULL;
struct zebra_if *zif = NULL;
int ret = EINVAL;
+ bool set_pdown, unset_pdown;
if (!ctx || !ifp)
goto done;
@@ -2717,8 +2718,22 @@ int dplane_ctx_intf_init(struct zebra_dplane_ctx *ctx, enum dplane_op_e op,
zif = (struct zebra_if *)ifp->info;
if (zif) {
+ set_pdown = !!(zif->flags & ZIF_FLAG_SET_PROTODOWN);
+ unset_pdown = !!(zif->flags & ZIF_FLAG_UNSET_PROTODOWN);
+
ctx->u.intf.r_bitfield = zif->protodown_rc;
- ctx->u.intf.protodown = !!(zif->flags & ZIF_FLAG_PROTODOWN);
+
+ /*
+ * See if we have new protodown state to set, otherwise keep
+ * current state
+ */
+ if (set_pdown)
+ ctx->u.intf.protodown = true;
+ else if (unset_pdown)
+ ctx->u.intf.protodown = false;
+ else
+ ctx->u.intf.protodown =
+ !!(zif->flags & ZIF_FLAG_PROTODOWN);
}
dplane_ctx_ns_init(ctx, zns, (op == DPLANE_OP_INTF_UPDATE));