diff options
author | Donald Sharp <sharpd@nvidia.com> | 2022-10-03 21:28:48 +0200 |
---|---|---|
committer | Donald Sharp <sharpd@nvidia.com> | 2022-12-12 16:44:57 +0100 |
commit | 10388e99c490f4a3d76586d14ce13ac039ad43d1 (patch) | |
tree | c84cf6e9e29113c0c53d016d73ce41e3412d9444 | |
parent | zebra: Remove goto's that do not do anything special (diff) | |
download | frr-10388e99c490f4a3d76586d14ce13ac039ad43d1.tar.xz frr-10388e99c490f4a3d76586d14ce13ac039ad43d1.zip |
zebra: Add dplane_ctx_get|set_flags
Zebra needs the ability to pass this data around.
Add it to the dplanes ability to pass.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
zebra: Add a dplane_ctx_set_flags
The dplane_ctx_set_flags call is missing, we will need it. Add it.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
-rw-r--r-- | zebra/zebra_dplane.c | 17 | ||||
-rw-r--r-- | zebra/zebra_dplane.h | 2 |
2 files changed, 19 insertions, 0 deletions
diff --git a/zebra/zebra_dplane.c b/zebra/zebra_dplane.c index 698cda8b8..1deac4bff 100644 --- a/zebra/zebra_dplane.c +++ b/zebra/zebra_dplane.c @@ -135,6 +135,8 @@ struct dplane_route_info { uint32_t zd_mtu; uint32_t zd_nexthop_mtu; + uint32_t zd_flags; + /* Nexthop hash entry info */ struct dplane_nexthop_info nhe; @@ -1430,6 +1432,20 @@ uint16_t dplane_ctx_get_old_instance(const struct zebra_dplane_ctx *ctx) return ctx->u.rinfo.zd_old_instance; } +uint32_t dplane_ctx_get_flags(const struct zebra_dplane_ctx *ctx) +{ + DPLANE_CTX_VALID(ctx); + + return ctx->u.rinfo.zd_flags; +} + +void dplane_ctx_set_flags(struct zebra_dplane_ctx *ctx, uint32_t flags) +{ + DPLANE_CTX_VALID(ctx); + + ctx->u.rinfo.zd_flags = flags; +} + uint32_t dplane_ctx_get_metric(const struct zebra_dplane_ctx *ctx) { DPLANE_CTX_VALID(ctx); @@ -2806,6 +2822,7 @@ int dplane_ctx_route_init(struct zebra_dplane_ctx *ctx, enum dplane_op_e op, ctx->zd_table_id = re->table; + ctx->u.rinfo.zd_flags = re->flags; ctx->u.rinfo.zd_metric = re->metric; ctx->u.rinfo.zd_old_metric = re->metric; ctx->zd_vrf_id = re->vrf_id; diff --git a/zebra/zebra_dplane.h b/zebra/zebra_dplane.h index b9fd176de..60d920554 100644 --- a/zebra/zebra_dplane.h +++ b/zebra/zebra_dplane.h @@ -380,6 +380,8 @@ route_tag_t dplane_ctx_get_old_tag(const struct zebra_dplane_ctx *ctx); uint16_t dplane_ctx_get_instance(const struct zebra_dplane_ctx *ctx); void dplane_ctx_set_instance(struct zebra_dplane_ctx *ctx, uint16_t instance); uint16_t dplane_ctx_get_old_instance(const struct zebra_dplane_ctx *ctx); +uint32_t dplane_ctx_get_flags(const struct zebra_dplane_ctx *ctx); +void dplane_ctx_set_flags(struct zebra_dplane_ctx *ctx, uint32_t flags); uint32_t dplane_ctx_get_metric(const struct zebra_dplane_ctx *ctx); uint32_t dplane_ctx_get_old_metric(const struct zebra_dplane_ctx *ctx); uint32_t dplane_ctx_get_mtu(const struct zebra_dplane_ctx *ctx); |