diff options
| author | Nathan Bahr <nbahr@atcorp.com> | 2024-10-23 19:00:31 +0000 |
|---|---|---|
| committer | Nathan Bahr <nbahr@atcorp.com> | 2024-12-13 17:36:34 +0000 |
| commit | 6d30c8f6b53a7d453f455e28615a57a6aadc0660 (patch) | |
| tree | bb65b88b096b170b9fb757f2c797ce5174c9b8a1 /pimd/pim_instance.c | |
| parent | cc865c0192a121856636552f74c7df2e389b4a5c (diff) | |
pimd: Refactor pim NHT
Refactor the next hop tracking in PIM to fully support the configured RPF lookup mode.
Moved many NHT related functions to pim_nht.h/c
NHT now tracks both MRIB and URIB tables and makes nexthop decisions based on the configured lookup mode.
Signed-off-by: Nathan Bahr <nbahr@atcorp.com>
Diffstat (limited to 'pimd/pim_instance.c')
| -rw-r--r-- | pimd/pim_instance.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/pimd/pim_instance.c b/pimd/pim_instance.c index 5649e49835..3945c5923d 100644 --- a/pimd/pim_instance.c +++ b/pimd/pim_instance.c @@ -15,6 +15,7 @@ #include "pim_ssm.h" #include "pim_rpf.h" #include "pim_rp.h" +#include "pim_nht.h" #include "pim_mroute.h" #include "pim_oil.h" #include "pim_static.h" @@ -46,8 +47,7 @@ static void pim_instance_terminate(struct pim_instance *pim) pim_bsm_proc_free(pim); - /* Traverse and cleanup rpf_hash */ - hash_clean_and_free(&pim->rpf_hash, (void *)pim_rp_list_hash_clean); + pim_nht_terminate(pim); pim_if_terminate(pim); @@ -75,7 +75,6 @@ static void pim_instance_terminate(struct pim_instance *pim) static struct pim_instance *pim_instance_init(struct vrf *vrf) { struct pim_instance *pim; - char hash_name[64]; pim = XCALLOC(MTYPE_PIM_PIM_INSTANCE, sizeof(struct pim_instance)); @@ -98,12 +97,7 @@ static struct pim_instance *pim_instance_init(struct vrf *vrf) #endif /* PIM_IPV == 4 */ pim_vxlan_init(pim); - snprintf(hash_name, sizeof(hash_name), "PIM %s RPF Hash", vrf->name); - pim->rpf_hash = hash_create_size(256, pim_rpf_hash_key, pim_rpf_equal, - hash_name); - - if (PIM_DEBUG_ZEBRA) - zlog_debug("%s: NHT rpf hash init ", __func__); + pim_nht_init(pim); pim->ssm_info = pim_ssm_init(); |
