]> git.puffer.fish Git - mirror/frr.git/commitdiff
pimd: Setup hash names appropriately
authorDonald Sharp <sharpd@cumulusnetworks.com>
Tue, 25 Jul 2017 13:45:03 +0000 (09:45 -0400)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Tue, 25 Jul 2017 18:22:15 +0000 (14:22 -0400)
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
pimd/pim_iface.c
pimd/pim_igmp.c
pimd/pim_instance.c
pimd/pim_msdp.c
pimd/pim_nht.c
pimd/pim_oil.c
pimd/pim_upstream.c

index 3cf8f678cace48d484b4e333fef74ab5b1f55927..7f623c429cd81ac918ede538a6e24e8be2beab0a 100644 (file)
@@ -100,6 +100,7 @@ static void *if_list_clean(struct pim_interface *pim_ifp)
 struct pim_interface *pim_if_new(struct interface *ifp, int igmp, int pim)
 {
        struct pim_interface *pim_ifp;
+       char hash_name[64];
 
        zassert(ifp);
        zassert(!ifp->info);
@@ -182,8 +183,11 @@ struct pim_interface *pim_if_new(struct interface *ifp, int igmp, int pim)
        pim_ifp->pim_ifchannel_list->cmp =
                (int (*)(void *, void *))pim_ifchannel_compare;
 
+       snprintf(hash_name, 64, "Pim Interface %s hash",
+                ifp->name);
        pim_ifp->pim_ifchannel_hash =
-               hash_create(pim_ifchannel_hash_key, pim_ifchannel_equal, NULL);
+               hash_create(pim_ifchannel_hash_key, pim_ifchannel_equal,
+                           hash_name);
 
        ifp->info = pim_ifp;
 
index c693f30ac291c1198312c544834eb0e3839e7561..ea8eff4d59064b4ea5fdbd73cf0d05717f33a054 100644 (file)
@@ -812,6 +812,7 @@ static struct igmp_sock *igmp_sock_new(int fd, struct in_addr ifaddr,
 {
        struct pim_interface *pim_ifp;
        struct igmp_sock *igmp;
+       char hash_name[64];
 
        pim_ifp = ifp->info;
 
@@ -836,8 +837,10 @@ static struct igmp_sock *igmp_sock_new(int fd, struct in_addr ifaddr,
        }
        igmp->igmp_group_list->del = (void (*)(void *))igmp_group_free;
 
-       igmp->igmp_group_hash =
-               hash_create(igmp_group_hash_key, igmp_group_hash_equal, NULL);
+       snprintf(hash_name, 64, "IGMP %s hash", ifp->name);
+       igmp->igmp_group_hash = hash_create(igmp_group_hash_key,
+                                           igmp_group_hash_equal,
+                                           hash_name);
 
        igmp->fd = fd;
        igmp->interface = ifp;
index 883720942ee5ab859de6216aa3ab4ee4257d6174..fc25f352b96fcb8abf60ab22a481d9c9caa87373 100644 (file)
@@ -66,6 +66,7 @@ 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));
        if (!pim)
@@ -81,8 +82,9 @@ static struct pim_instance *pim_instance_init(struct vrf *vrf)
 
        pim_msdp_init(pim, master);
 
-       pim->rpf_hash =
-               hash_create_size(256, pim_rpf_hash_key, pim_rpf_equal, NULL);
+       snprintf(hash_name, 64, "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 ", __PRETTY_FUNCTION__);
index 57f54102a957719982a7706c8a2fb8e5cd935de1..c0f74945fdf81fac580506f1fb2e168cf940da8f 100644 (file)
@@ -1591,15 +1591,18 @@ static void pim_msdp_enable(struct pim_instance *pim)
 void pim_msdp_init(struct pim_instance *pim, struct thread_master *master)
 {
        pim->msdp.master = master;
+       char hash_name[64];
 
+       snprintf(hash_name, 64, "PIM %s MSDP Peer Hash", pim->vrf->name);
        pim->msdp.peer_hash = hash_create(pim_msdp_peer_hash_key_make,
-                                         pim_msdp_peer_hash_eq, NULL);
+                                         pim_msdp_peer_hash_eq, hash_name);
        pim->msdp.peer_list = list_new();
        pim->msdp.peer_list->del = (void (*)(void *))pim_msdp_peer_free;
        pim->msdp.peer_list->cmp = (int (*)(void *, void *))pim_msdp_peer_comp;
 
+       snprintf(hash_name, 64, "PIM %s MSDP SA Hash", pim->vrf->name);
        pim->msdp.sa_hash = hash_create(pim_msdp_sa_hash_key_make,
-                                       pim_msdp_sa_hash_eq, NULL);
+                                       pim_msdp_sa_hash_eq, hash_name);
        pim->msdp.sa_list = list_new();
        pim->msdp.sa_list->del = (void (*)(void *))pim_msdp_sa_free;
        pim->msdp.sa_list->cmp = (int (*)(void *, void *))pim_msdp_sa_comp;
index 01342eb58fc30f079a561e5ac9fc8399063594ec..e91d251060e046cf6d656c59729afabf619860d3 100644 (file)
@@ -113,6 +113,8 @@ static struct pim_nexthop_cache *pim_nexthop_cache_add(struct pim_instance *pim,
                                                       struct pim_rpf *rpf_addr)
 {
        struct pim_nexthop_cache *pnc;
+       char hash_name[64];
+       char buf1[64];
 
        pnc = XCALLOC(MTYPE_PIM_NEXTHOP_CACHE,
                      sizeof(struct pim_nexthop_cache));
@@ -130,9 +132,12 @@ static struct pim_nexthop_cache *pim_nexthop_cache_add(struct pim_instance *pim,
        pnc->rp_list = list_new();
        pnc->rp_list->cmp = pim_rp_list_cmp;
 
+       snprintf(hash_name, 64, "PNC %s(%s) Upstream Hash",
+                prefix2str(&pnc->rpf.rpf_addr, buf1, 64),
+                pim->vrf->name);
        pnc->upstream_hash = hash_create_size(8192, pim_upstream_hash_key,
                                              pim_upstream_equal,
-                                             "PNC Upstream Hash");
+                                             hash_name);
 
        return pnc;
 }
index 582fb42f39fb055b349ab2d2b5ed6bc92b6c8d76..b3bd94dc2a3921152e2a5ae93062425888b1d0cb 100644 (file)
@@ -101,8 +101,13 @@ static unsigned int pim_oil_hash_key(void *arg)
 
 void pim_oil_init(struct pim_instance *pim)
 {
-       pim->channel_oil_hash =
-               hash_create_size(8192, pim_oil_hash_key, pim_oil_equal, NULL);
+       char hash_name[64];
+
+       snprintf(hash_name, 64, "PIM %s Oil Hash", pim->vrf->name);
+       pim->channel_oil_hash = hash_create_size(8192,
+                                               pim_oil_hash_key,
+                                               pim_oil_equal,
+                                               hash_name);
 
        pim->channel_oil_list = list_new();
        if (!pim->channel_oil_list) {
index c7262d64ba425938a386c8a91509d6161a06e782..96aaff09b0bc51b1e57cd4aec8da2009da7a1295 100644 (file)
@@ -1752,11 +1752,16 @@ void pim_upstream_remove_lhr_star_pimreg(struct pim_instance *pim,
 
 void pim_upstream_init(struct pim_instance *pim)
 {
+       char hash_name[64];
+
        pim->upstream_sg_wheel =
                wheel_init(master, 31000, 100, pim_upstream_hash_key,
                           pim_upstream_sg_running);
+
+       snprintf(hash_name, 64, "PIM %s Upstream Hash",
+                pim->vrf->name);
        pim->upstream_hash = hash_create_size(8192, pim_upstream_hash_key,
-                                             pim_upstream_equal, NULL);
+                                             pim_upstream_equal, hash_name);
 
        pim->upstream_list = list_new();
        pim->upstream_list->del = (void (*)(void *))pim_upstream_free;