summaryrefslogtreecommitdiff
path: root/zebra/interface.h
diff options
context:
space:
mode:
authorStephen Worley <sworley@nvidia.com>2022-01-26 00:07:57 -0500
committerStephen Worley <sworley@nvidia.com>2022-03-09 17:52:44 -0500
commit5d4141383344bf244c572f9d23c0175d9573f41d (patch)
tree9b0c897fd98627c3b9ee0591d8995b5567dcdd70 /zebra/interface.h
parent8e23507a638e4371618913d776e1e69c418e4995 (diff)
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/interface.h')
-rw-r--r--zebra/interface.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/zebra/interface.h b/zebra/interface.h
index 315a3170d8..2c3784ee15 100644
--- a/zebra/interface.h
+++ b/zebra/interface.h
@@ -403,7 +403,7 @@ struct zebra_if {
* in the dataplane. This results in a carrier/L1 down on the
* physical device.
*/
- enum protodown_reasons protodown_rc;
+ uint32_t protodown_rc;
/* list of zebra_mac entries using this interface as destination */
struct list *mac_list;
@@ -497,7 +497,8 @@ extern void if_handle_vrf_change(struct interface *ifp, vrf_id_t vrf_id);
extern void zebra_if_update_link(struct interface *ifp, ifindex_t link_ifindex,
ns_id_t ns_id);
extern void zebra_if_update_all_links(struct zebra_ns *zns);
-extern void zebra_if_set_protodown(struct interface *ifp, bool down);
+extern int zebra_if_set_protodown(struct interface *ifp, bool down,
+ enum protodown_reasons new_reason);
extern int if_ip_address_install(struct interface *ifp, struct prefix *prefix,
const char *label, struct prefix *pp);
extern int if_ipv6_address_install(struct interface *ifp, struct prefix *prefix,
@@ -521,10 +522,9 @@ extern bool if_nhg_dependents_is_empty(const struct interface *ifp);
extern void vrf_add_update(struct vrf *vrfp);
extern void zebra_l2_map_slave_to_bond(struct zebra_if *zif, vrf_id_t vrf);
extern void zebra_l2_unmap_slave_from_bond(struct zebra_if *zif);
-extern const char *zebra_protodown_rc_str(enum protodown_reasons protodown_rc,
- char *pd_buf, uint32_t pd_buf_len);
-void zebra_if_addr_update_ctx(struct zebra_dplane_ctx *ctx);
-int zebra_if_netconf_update_ctx(struct zebra_dplane_ctx *ctx);
+extern const char *zebra_protodown_rc_str(uint32_t protodown_rc, char *pd_buf,
+ uint32_t pd_buf_len);
+void zebra_if_dplane_result(struct zebra_dplane_ctx *ctx);
#ifdef HAVE_PROC_NET_DEV
extern void ifstat_update_proc(void);