diff options
| author | Donald Sharp <sharpd@nvidia.com> | 2023-04-20 08:51:42 -0400 | 
|---|---|---|
| committer | Donald Sharp <sharpd@nvidia.com> | 2023-07-05 13:03:14 -0400 | 
| commit | a014450441aeb1bf3f335d98903eee41e955867e (patch) | |
| tree | 614da6a95d0c9fc6be3c7dbd567707856b10accf /zebra/zebra_dplane.h | |
| parent | 487a96a35f5428c205fe792f9bdded2c894bb5a0 (diff) | |
zebra: Add code to get/set interface to pass up from dplane
1) Add a bunch of get/set functions and associated data
structure in zebra_dplane to allow the setting and retrieval
of interface netlink data up into the master pthread.
2) Add a bit of code to breakup startup into stages.  This is
because FRR currently has a mix of dplane and non dplane interactions
and the code needs to be paused before continuing on.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Diffstat (limited to 'zebra/zebra_dplane.h')
| -rw-r--r-- | zebra/zebra_dplane.h | 115 | 
1 files changed, 114 insertions, 1 deletions
diff --git a/zebra/zebra_dplane.h b/zebra/zebra_dplane.h index e602a071ff..be18115939 100644 --- a/zebra/zebra_dplane.h +++ b/zebra/zebra_dplane.h @@ -87,6 +87,11 @@ enum zebra_dplane_result {  	ZEBRA_DPLANE_REQUEST_FAILURE,  }; +enum zebra_dplane_startup_notifications { +	ZEBRA_DPLANE_INTERFACES_READ, +	ZEBRA_DPLANE_TUNNELS_READ, +	ZEBRA_DPLANE_ADDRESSES_READ, +};  /*   * API between the zebra dataplane system and the main zebra processing   * context. @@ -188,7 +193,10 @@ enum dplane_op_e {  	DPLANE_OP_TC_CLASS_UPDATE,  	DPLANE_OP_TC_FILTER_ADD,  	DPLANE_OP_TC_FILTER_DELETE, -	DPLANE_OP_TC_FILTER_UPDATE +	DPLANE_OP_TC_FILTER_UPDATE, + +	/* Startup Control */ +	DPLANE_OP_STARTUP_STAGE,  };  /* @@ -323,6 +331,105 @@ const char *dplane_ctx_get_ifname(const struct zebra_dplane_ctx *ctx);  void dplane_ctx_set_ifname(struct zebra_dplane_ctx *ctx, const char *ifname);  ifindex_t dplane_ctx_get_ifindex(const struct zebra_dplane_ctx *ctx);  void dplane_ctx_set_ifindex(struct zebra_dplane_ctx *ctx, ifindex_t ifindex); +void dplane_ctx_set_ifp_bond_ifindex(struct zebra_dplane_ctx *ctx, +				     ifindex_t ifindex); +ifindex_t dplane_ctx_get_ifp_bond_ifindex(const struct zebra_dplane_ctx *ctx); +enum zebra_iftype +dplane_ctx_get_ifp_zif_type(const struct zebra_dplane_ctx *ctx); +void dplane_ctx_set_ifp_zif_type(struct zebra_dplane_ctx *ctx, +				 enum zebra_iftype zif_type); +void dplane_ctx_set_ifp_table_id(struct zebra_dplane_ctx *ctx, +				 uint32_t table_id); +uint32_t dplane_ctx_get_ifp_table_id(const struct zebra_dplane_ctx *ctx); +void dplane_ctx_set_ifp_hw_addr(struct zebra_dplane_ctx *ctx, +				int32_t hw_addr_len, uint8_t *hw_addr); +int32_t dplane_ctx_get_ifp_hw_addr_len(const struct zebra_dplane_ctx *ctx); +const uint8_t *dplane_ctx_get_ifp_hw_addr(const struct zebra_dplane_ctx *ctx); +struct zebra_l2info_bridge; +void dplane_ctx_set_ifp_bridge_info(struct zebra_dplane_ctx *ctx, +				    struct zebra_l2info_bridge *binfo); +const struct zebra_l2info_bridge * +dplane_ctx_get_ifp_bridge_info(const struct zebra_dplane_ctx *ctx); +struct zebra_l2info_vlan; +void dplane_ctx_set_ifp_vlan_info(struct zebra_dplane_ctx *ctx, +				  struct zebra_l2info_vlan *vinfo); +const struct zebra_l2info_vlan * +dplane_ctx_get_ifp_vlan_info(const struct zebra_dplane_ctx *ctx); +struct zebra_l2info_vxlan; +void dplane_ctx_set_ifp_vxlan_info(struct zebra_dplane_ctx *ctx, +				   struct zebra_l2info_vxlan *vxinfo); +const struct zebra_l2info_vxlan * +dplane_ctx_get_ifp_vxlan_info(const struct zebra_dplane_ctx *ctx); +struct zebra_l2info_gre; +void dplane_ctx_set_ifp_gre_info(struct zebra_dplane_ctx *ctx, +				 struct zebra_l2info_gre *greinfo); +const struct zebra_l2info_gre * +dplane_ctx_get_ifp_gre_info(const struct zebra_dplane_ctx *ctx); +void dplane_ctx_set_ifp_zltype(struct zebra_dplane_ctx *ctx, +			       enum zebra_link_type zlt); +enum zebra_link_type +dplane_ctx_get_ifp_zltype(const struct zebra_dplane_ctx *ctx); +void dplane_ctx_set_ifp_link_nsid(struct zebra_dplane_ctx *ctx, ns_id_t ns_id); +ns_id_t dplane_ctx_get_ifp_link_nsid(const struct zebra_dplane_ctx *ctx); +void dplane_ctx_set_ifp_desc(struct zebra_dplane_ctx *ctx, const char *desc); +char *dplane_ctx_get_ifp_desc(struct zebra_dplane_ctx *ctx); +void dplane_ctx_set_ifp_mtu(struct zebra_dplane_ctx *ctx, uint32_t mtu); +uint32_t dplane_ctx_get_ifp_mtu(const struct zebra_dplane_ctx *ctx); +void dplane_ctx_set_ifp_vrf_id(struct zebra_dplane_ctx *ctx, vrf_id_t vrf_id); +vrf_id_t dplane_ctx_get_ifp_vrf_id(const struct zebra_dplane_ctx *ctx); +enum zebra_slave_iftype; +void dplane_ctx_set_ifp_zif_slave_type(struct zebra_dplane_ctx *ctx, +				       enum zebra_slave_iftype zslave_type); +enum zebra_slave_iftype +dplane_ctx_get_ifp_zif_slave_type(const struct zebra_dplane_ctx *ctx); +void dplane_ctx_set_ifp_master_ifindex(struct zebra_dplane_ctx *ctx, +				       ifindex_t master_ifindex); +ifindex_t dplane_ctx_get_ifp_master_ifindex(const struct zebra_dplane_ctx *ctx); +void dplane_ctx_set_ifp_bridge_ifindex(struct zebra_dplane_ctx *ctx, +				       ifindex_t bridge_ifindex); +ifindex_t dplane_ctx_get_ifp_bridge_ifindex(const struct zebra_dplane_ctx *ctx); +void dplane_ctx_set_ifp_bypass(struct zebra_dplane_ctx *ctx, uint8_t bypass); +uint8_t dplane_ctx_get_ifp_bypass(const struct zebra_dplane_ctx *ctx); +void dplane_ctx_set_ifp_flags(struct zebra_dplane_ctx *ctx, uint64_t flags); +uint64_t dplane_ctx_get_ifp_flags(const struct zebra_dplane_ctx *ctx); +void dplane_ctx_set_ifp_protodown(struct zebra_dplane_ctx *ctx, bool protodown); +bool dplane_ctx_get_ifp_protodown(const struct zebra_dplane_ctx *ctx); +void dplane_ctx_set_ifp_startup(struct zebra_dplane_ctx *ctx, bool startup); +bool dplane_ctx_get_ifp_startup(const struct zebra_dplane_ctx *ctx); +void dplane_ctx_set_ifp_protodown_set(struct zebra_dplane_ctx *ctx, bool set); +bool dplane_ctx_get_ifp_protodown_set(const struct zebra_dplane_ctx *ctx); +void dplane_ctx_set_ifp_rc_bitfield(struct zebra_dplane_ctx *ctx, +				    uint32_t rc_bitfield); +uint32_t dplane_ctx_get_ifp_rc_bitfield(const struct zebra_dplane_ctx *ctx); +void dplane_ctx_set_ifp_link_ifindex(struct zebra_dplane_ctx *ctx, +				     ifindex_t link_ifindex); +ifindex_t dplane_ctx_get_ifp_link_ifindex(const struct zebra_dplane_ctx *ctx); +void dplane_ctx_set_ifp_family(struct zebra_dplane_ctx *ctx, uint8_t family); +uint8_t dplane_ctx_get_ifp_family(const struct zebra_dplane_ctx *ctx); +struct zebra_vxlan_vni_array; +void dplane_ctx_set_ifp_vxlan_vni_array(struct zebra_dplane_ctx *ctx, +					struct zebra_vxlan_vni_array *vniarray); +const struct zebra_vxlan_vni_array * +dplane_ctx_get_ifp_vxlan_vni_array(const struct zebra_dplane_ctx *ctx); +struct zebra_dplane_bridge_vlan_info { +	uint16_t flags; +	uint16_t vid; +}; +void dplane_ctx_set_ifp_bridge_vlan_info( +	struct zebra_dplane_ctx *ctx, +	struct zebra_dplane_bridge_vlan_info *bvinfo); +const struct zebra_dplane_bridge_vlan_info * +dplane_ctx_get_ifp_bridge_vlan_info(const struct zebra_dplane_ctx *ctx); + +struct zebra_dplane_bridge_vlan_info_array { +	int count; +	struct zebra_dplane_bridge_vlan_info array[0]; +}; +void dplane_ctx_set_ifp_bridge_vlan_info_array( +	struct zebra_dplane_ctx *ctx, +	struct zebra_dplane_bridge_vlan_info_array *bvarray); +const struct zebra_dplane_bridge_vlan_info_array * +dplane_ctx_get_ifp_bridge_vlan_info_array(const struct zebra_dplane_ctx *ctx);  /* Retrieve last/current provider id */  uint32_t dplane_ctx_get_provider(const struct zebra_dplane_ctx *ctx); @@ -1066,6 +1173,9 @@ void zebra_dplane_pre_finish(void);  void zebra_dplane_finish(void);  void zebra_dplane_shutdown(void); +void zebra_dplane_startup_stage(struct zebra_ns *zns, +				enum zebra_dplane_startup_notifications spot); +  /*   * decision point for sending a routing update through the old   * straight to zebra master pthread or through the dplane to @@ -1076,6 +1186,9 @@ void dplane_rib_add_multipath(afi_t afi, safi_t safi, struct prefix *p,  			      struct nexthop_group *ng, int startup,  			      struct zebra_dplane_ctx *ctx); +enum zebra_dplane_startup_notifications +dplane_ctx_get_startup_spot(struct zebra_dplane_ctx *ctx); +  #ifdef __cplusplus  }  #endif  | 
