diff options
author | Stephen Worley <sworley@nvidia.com> | 2022-01-26 06:07:57 +0100 |
---|---|---|
committer | Stephen Worley <sworley@nvidia.com> | 2022-03-09 23:52:44 +0100 |
commit | 5d4141383344bf244c572f9d23c0175d9573f41d (patch) | |
tree | 9b0c897fd98627c3b9ee0591d8995b5567dcdd70 /zebra/zebra_dplane.h | |
parent | include: bump if_netlink.h version for protodown (diff) | |
download | frr-5d4141383344bf244c572f9d23c0175d9573f41d.tar.xz frr-5d4141383344bf244c572f9d23c0175d9573f41d.zip |
zebra: add support for protodown reason code
Add support for setting the protodown reason code.
https://github.com/torvalds/linux/commit/829eb208e80d6db95c0201cb8fa00c2f9ad87faf
These patches handle all our netlink code for setting the reason.
For protodown reason we only set `frr` as the reason externally
but internally we have more descriptive reasoning available via
`show interface IFNAME`. The kernel only provides a bitwidth of 32
that all userspace programs have to share so this makes the most sense.
Since this is new functionality, it needs to be added to the dplane
pthread instead. So these patches, also move the protodown setting we
were doing before into the dplane pthread. For this, we abstract it a
bit more to make it a general interface LINK update dplane API. This
API can be expanded to support gernal link creation/updating when/if
someone ever adds that code.
We also move a more common entrypoint for evpn-mh and from zapi clients
like vrrpd. They both call common code now to set our internal flags
for protodown and protodown reason.
Also add debugging code for dumping netlink packets with
protodown/protodown_reason.
Signed-off-by: Stephen Worley <sworley@nvidia.com>
Diffstat (limited to 'zebra/zebra_dplane.h')
-rw-r--r-- | zebra/zebra_dplane.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/zebra/zebra_dplane.h b/zebra/zebra_dplane.h index 29555d5b5..73acf0341 100644 --- a/zebra/zebra_dplane.h +++ b/zebra/zebra_dplane.h @@ -188,6 +188,11 @@ enum dplane_op_e { /* Incoming interface config events */ DPLANE_OP_INTF_NETCONFIG, + + /* Interface update */ + DPLANE_OP_INTF_INSTALL, + DPLANE_OP_INTF_UPDATE, + DPLANE_OP_INTF_DELETE, }; /* @@ -480,6 +485,10 @@ dplane_ctx_get_pw_backup_nhg(const struct zebra_dplane_ctx *ctx); /* Accessors for interface information */ uint32_t dplane_ctx_get_intf_metric(const struct zebra_dplane_ctx *ctx); void dplane_ctx_set_intf_metric(struct zebra_dplane_ctx *ctx, uint32_t metric); +uint32_t dplane_ctx_get_intf_r_bitfield(const struct zebra_dplane_ctx *ctx); +void dplane_ctx_set_intf_r_bitfield(struct zebra_dplane_ctx *ctx, + uint32_t r_bitfield); +bool dplane_ctx_intf_is_protodown(const struct zebra_dplane_ctx *ctx); /* Is interface addr p2p? */ bool dplane_ctx_intf_is_connected(const struct zebra_dplane_ctx *ctx); void dplane_ctx_intf_set_connected(struct zebra_dplane_ctx *ctx); @@ -677,6 +686,13 @@ enum zebra_dplane_result dplane_intf_addr_unset(const struct interface *ifp, const struct connected *ifc); /* + * Enqueue interface link changes for the dataplane. + */ +enum zebra_dplane_result dplane_intf_add(const struct interface *ifp); +enum zebra_dplane_result dplane_intf_update(const struct interface *ifp); +enum zebra_dplane_result dplane_intf_delete(const struct interface *ifp); + +/* * Link layer operations for the dataplane. */ enum zebra_dplane_result dplane_neigh_ip_update(enum dplane_op_e op, @@ -814,6 +830,10 @@ int dplane_ctx_route_init(struct zebra_dplane_ctx *ctx, enum dplane_op_e op, int dplane_ctx_nexthop_init(struct zebra_dplane_ctx *ctx, enum dplane_op_e op, struct nhg_hash_entry *nhe); +/* Encode interface information into data plane context. */ +int dplane_ctx_intf_init(struct zebra_dplane_ctx *ctx, enum dplane_op_e op, + const struct interface *ifp); + /* Retrieve the limit on the number of pending, unprocessed updates. */ uint32_t dplane_get_in_queue_limit(void); |