summaryrefslogtreecommitdiff
path: root/zebra/zebra_nhg.h
diff options
context:
space:
mode:
authorAnuradha Karuppiah <anuradhak@cumulusnetworks.com>2020-05-14 17:00:10 -0700
committerAnuradha Karuppiah <anuradhak@nvidia.com>2020-12-01 09:46:28 -0800
commit4f9bb78eca97fdb86e80b11f9234ac9b9786e235 (patch)
tree34f86861ba8775e8bfff496d794719999fa583a3 /zebra/zebra_nhg.h
parent5de10c37052a32bb20a077194a7544f4153c7734 (diff)
zebra: change the L2 NHG id format to co-exist with the L3NHG ids
It is now 4bits of type and 28bits of value - 1. type=0 is for L3 NHG 2. type=1 is for L2 NH 3. type=2 is for L2 NHG Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
Diffstat (limited to 'zebra/zebra_nhg.h')
-rw-r--r--zebra/zebra_nhg.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/zebra/zebra_nhg.h b/zebra/zebra_nhg.h
index b2ef88bb61..9382b8c65d 100644
--- a/zebra/zebra_nhg.h
+++ b/zebra/zebra_nhg.h
@@ -126,6 +126,14 @@ struct nhg_hash_entry {
#define NEXTHOP_GROUP_FPM (1 << 6)
};
+/* Upper 4 bits of the NHG are reserved for indicating the NHG type */
+#define NHG_ID_TYPE_POS 28
+enum nhg_type {
+ NHG_TYPE_L3 = 0,
+ NHG_TYPE_L2_NH, /* NHs in a L2 NHG used as a MAC/FDB dest */
+ NHG_TYPE_L2, /* L2 NHG used as a MAC/FDB dest */
+};
+
/* Was this one we created, either this session or previously? */
#define ZEBRA_NHG_CREATED(NHE) \
(((NHE->type) <= ZEBRA_ROUTE_MAX) && (NHE->type != ZEBRA_ROUTE_KERNEL))