summaryrefslogtreecommitdiff
path: root/lib/zclient.h
diff options
context:
space:
mode:
authorStephen Worley <sworley@cumulusnetworks.com>2020-05-13 14:32:13 -0400
committerStephen Worley <sworley@cumulusnetworks.com>2020-09-28 12:40:59 -0400
commit54c89c9377685e32010ab1f788b2a19c0bc3531b (patch)
tree0c3e604646bd67b9230d151058fdcb9a9358197f /lib/zclient.h
parent16b20ad0628ee98537c79ae7e018303ad1de8aca (diff)
zebra: NHG ID bounds macros
Determine the NHG ID spacing and lower bound with ZEBRA_ROUTE_MAX in macros. Directly set the upperbound to be the lower 28bits of the uint32_t ID space (the top 4 are reserved for l2-NHGs). Round that number down a bit to make it more even. Convert all former lower_bound calls to just use the macro. Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
Diffstat (limited to 'lib/zclient.h')
-rw-r--r--lib/zclient.h15
1 files changed, 11 insertions, 4 deletions
diff --git a/lib/zclient.h b/lib/zclient.h
index db5e1ce5b9..3ac9ca9456 100644
--- a/lib/zclient.h
+++ b/lib/zclient.h
@@ -686,13 +686,20 @@ struct zclient_options {
extern struct zclient_options zclient_options_default;
/*
+ * We reserve the top 4 bits for l2-NHG, everything else
+ * is for zebra/proto l3-NHG.
+ *
* Each client is going to get it's own nexthop group space
- * and we'll separate them by 50 million, we'll figure out where
- * to start based upon the route_types.h
+ * and we'll separate them, we'll figure out where to start based upon
+ * the route_types.h
*/
-#define ZEBRA_NHG_SPACING 50000000
+#define ZEBRA_NHG_PROTO_UPPER \
+ ((uint32_t)250000000) /* Bottom 28 bits then rounded down */
+#define ZEBRA_NHG_PROTO_SPACING (ZEBRA_NHG_PROTO_UPPER / ZEBRA_ROUTE_MAX)
+#define ZEBRA_NHG_PROTO_LOWER \
+ (ZEBRA_NHG_PROTO_SPACING * (ZEBRA_ROUTE_CONNECT + 1))
+
extern uint32_t zclient_get_nhg_start(uint32_t proto);
-extern uint32_t zclient_get_nhg_lower_bound(void);
extern struct zclient *zclient_new(struct thread_master *m,
struct zclient_options *opt);