]> git.puffer.fish Git - mirror/frr.git/commitdiff
*: fix all backets 8002/head
authorIgor Ryzhov <iryzhov@nfware.com>
Tue, 2 Feb 2021 16:11:25 +0000 (19:11 +0300)
committerIgor Ryzhov <iryzhov@nfware.com>
Tue, 2 Feb 2021 16:11:25 +0000 (19:11 +0300)
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
lib/hash.c
lib/hash.h
lib/routemap.c
ospfd/ospf_vty.c
pimd/pim_cmd.c
pimd/pim_vxlan.c
zebra/dplane_fpm_nl.c
zebra/zebra_fpm.c
zebra/zebra_vxlan.c

index ed429b77d079a2dbe54346dde93cf0108067d801..ec616ee724b9a1d559a99c6aa76c57b00f3a461f 100644 (file)
@@ -32,7 +32,7 @@
 #include "libfrr_trace.h"
 
 DEFINE_MTYPE_STATIC(LIB, HASH, "Hash")
-DEFINE_MTYPE_STATIC(LIB, HASH_BACKET, "Hash Bucket")
+DEFINE_MTYPE_STATIC(LIB, HASH_BUCKET, "Hash Bucket")
 DEFINE_MTYPE_STATIC(LIB, HASH_INDEX, "Hash Index")
 
 static pthread_mutex_t _hashes_mtx = PTHREAD_MUTEX_INITIALIZER;
@@ -168,7 +168,7 @@ void *hash_get(struct hash *hash, void *data, void *(*alloc_func)(void *))
                        index = key & (hash->size - 1);
                }
 
-               bucket = XCALLOC(MTYPE_HASH_BACKET, sizeof(struct hash_bucket));
+               bucket = XCALLOC(MTYPE_HASH_BUCKET, sizeof(struct hash_bucket));
                bucket->data = newdata;
                bucket->key = key;
                bucket->next = hash->index[index];
@@ -239,7 +239,7 @@ void *hash_release(struct hash *hash, void *data)
                        hash_update_ssq(hash, oldlen, newlen);
 
                        ret = bucket->data;
-                       XFREE(MTYPE_HASH_BACKET, bucket);
+                       XFREE(MTYPE_HASH_BUCKET, bucket);
                        hash->count--;
                        break;
                }
@@ -302,7 +302,7 @@ void hash_clean(struct hash *hash, void (*free_func)(void *))
                        if (free_func)
                                (*free_func)(hb->data);
 
-                       XFREE(MTYPE_HASH_BACKET, hb);
+                       XFREE(MTYPE_HASH_BUCKET, hb);
                        hash->count--;
                }
                hash->index[i] = NULL;
index 23e93b6d7d6eb89c65a26b26c20852a6cdf6fdc0..47d951a34b2a6eb9a2525e890b243663a53116c0 100644 (file)
@@ -76,7 +76,7 @@ struct hash {
        /* Data compare function. */
        bool (*hash_cmp)(const void *, const void *);
 
-       /* Backet alloc. */
+       /* Bucket alloc. */
        unsigned long count;
 
        struct hashstats stats;
index 360fd25cc9e7b747cb1074c5c77ade5a6059609e..77140866723f2858f019ef0d702011f334fe3422 100644 (file)
@@ -2240,7 +2240,7 @@ static void route_map_pentry_update(route_map_event_t event,
        }
 }
 
-static void route_map_pentry_process_dependency(struct hash_bucket *backet,
+static void route_map_pentry_process_dependency(struct hash_bucket *bucket,
                                                void *data)
 {
        char *rmap_name = NULL;
@@ -2253,7 +2253,7 @@ static void route_map_pentry_process_dependency(struct hash_bucket *backet,
                (struct route_map_pentry_dep *)data;
        unsigned char family = pentry_dep->pentry->prefix.family;
 
-       dep_data = (struct route_map_dep_data *)backet->data;
+       dep_data = (struct route_map_dep_data *)bucket->data;
        if (!dep_data)
                return;
 
index 949582278fdacb803585000ad515a77b03bee977..413245206952900a9540b982694e974498b42261 100644 (file)
@@ -9922,10 +9922,10 @@ DEFPY(no_ospf_gr_helper_planned_only,
        return CMD_SUCCESS;
 }
 
-static int ospf_print_vty_helper_dis_rtr_walkcb(struct hash_bucket *backet,
+static int ospf_print_vty_helper_dis_rtr_walkcb(struct hash_bucket *bucket,
                                                void *arg)
 {
-       struct advRtr *rtr = backet->data;
+       struct advRtr *rtr = bucket->data;
        struct vty *vty = (struct vty *)arg;
        static unsigned int count;
 
@@ -11243,10 +11243,10 @@ static const char *const ospf_abr_type_str[] = {
 static const char *const ospf_shortcut_mode_str[] = {
        "default", "enable", "disable"
 };
-static int ospf_vty_external_rt_walkcb(struct hash_bucket *backet,
+static int ospf_vty_external_rt_walkcb(struct hash_bucket *bucket,
                                        void *arg)
 {
-       struct external_info *ei = backet->data;
+       struct external_info *ei = bucket->data;
        struct vty *vty = (struct vty *)arg;
        static unsigned int count;
 
@@ -11262,10 +11262,10 @@ static int ospf_vty_external_rt_walkcb(struct hash_bucket *backet,
        return HASHWALK_CONTINUE;
 }
 
-static int ospf_json_external_rt_walkcb(struct hash_bucket *backet,
+static int ospf_json_external_rt_walkcb(struct hash_bucket *bucket,
                                        void *arg)
 {
-       struct external_info *ei = backet->data;
+       struct external_info *ei = bucket->data;
        struct json_object *json = (struct json_object *)arg;
        char buf[PREFIX2STR_BUFFER];
        char exnalbuf[20];
@@ -12034,10 +12034,10 @@ static int config_write_ospf_redistribute(struct vty *vty, struct ospf *ospf)
        return 0;
 }
 
-static int ospf_cfg_write_helper_dis_rtr_walkcb(struct hash_bucket *backet,
+static int ospf_cfg_write_helper_dis_rtr_walkcb(struct hash_bucket *bucket,
                                                void *arg)
 {
-       struct advRtr *rtr = backet->data;
+       struct advRtr *rtr = bucket->data;
        struct vty *vty = (struct vty *)arg;
 
        vty_out(vty, " graceful-restart helper-only %pI4\n",
index ff85151839444fb7a2c8334eba24eb9bea7d56ed..e7c076c7cac6c19d58182e18c022c33fb191962c 100644 (file)
@@ -11022,9 +11022,9 @@ static void pim_show_vxlan_sg_entry(struct pim_vxlan_sg *vxlan_sg,
        }
 }
 
-static void pim_show_vxlan_sg_hash_entry(struct hash_bucket *backet, void *arg)
+static void pim_show_vxlan_sg_hash_entry(struct hash_bucket *bucket, void *arg)
 {
-       pim_show_vxlan_sg_entry((struct pim_vxlan_sg *)backet->data,
+       pim_show_vxlan_sg_entry((struct pim_vxlan_sg *)bucket->data,
                                (struct pim_sg_cache_walk_data *)arg);
 }
 
index 380c97a97c0bb335e22186953ed6c1bfad477ab0..6a12c7fb13df772f2b0a1bea809423437b743529 100644 (file)
@@ -497,10 +497,10 @@ static void pim_vxlan_orig_mr_del(struct pim_vxlan_sg *vxlan_sg)
        pim_vxlan_orig_mr_up_del(vxlan_sg);
 }
 
-static void pim_vxlan_orig_mr_iif_update(struct hash_bucket *backet, void *arg)
+static void pim_vxlan_orig_mr_iif_update(struct hash_bucket *bucket, void *arg)
 {
        struct interface *ifp;
-       struct pim_vxlan_sg *vxlan_sg = (struct pim_vxlan_sg *)backet->data;
+       struct pim_vxlan_sg *vxlan_sg = (struct pim_vxlan_sg *)bucket->data;
        struct interface *old_iif = vxlan_sg->iif;
 
        if (!pim_vxlan_is_orig_mroute(vxlan_sg))
@@ -812,11 +812,11 @@ bool pim_vxlan_do_mlag_reg(void)
  * to the MLAG peer which may mroute it over the underlay if there are any
  * interested receivers.
  */
-static void pim_vxlan_sg_peerlink_oif_update(struct hash_bucket *backet,
+static void pim_vxlan_sg_peerlink_oif_update(struct hash_bucket *bucket,
                                             void *arg)
 {
        struct interface *new_oif = (struct interface *)arg;
-       struct pim_vxlan_sg *vxlan_sg = (struct pim_vxlan_sg *)backet->data;
+       struct pim_vxlan_sg *vxlan_sg = (struct pim_vxlan_sg *)bucket->data;
 
        if (!pim_vxlan_is_orig_mroute(vxlan_sg))
                return;
@@ -950,10 +950,10 @@ static void pim_vxlan_up_cost_update(struct pim_instance *pim,
        }
 }
 
-static void pim_vxlan_term_mr_cost_update(struct hash_bucket *backet, void *arg)
+static void pim_vxlan_term_mr_cost_update(struct hash_bucket *bucket, void *arg)
 {
        struct interface *old_peerlink_rif = (struct interface *)arg;
-       struct pim_vxlan_sg *vxlan_sg = (struct pim_vxlan_sg *)backet->data;
+       struct pim_vxlan_sg *vxlan_sg = (struct pim_vxlan_sg *)bucket->data;
        struct pim_upstream *up;
        struct listnode *listnode;
        struct pim_upstream *child;
@@ -975,11 +975,11 @@ static void pim_vxlan_term_mr_cost_update(struct hash_bucket *backet, void *arg)
                                old_peerlink_rif);
 }
 
-static void pim_vxlan_sg_peerlink_rif_update(struct hash_bucket *backet,
+static void pim_vxlan_sg_peerlink_rif_update(struct hash_bucket *bucket,
                                             void *arg)
 {
-       pim_vxlan_orig_mr_iif_update(backet, NULL);
-       pim_vxlan_term_mr_cost_update(backet, arg);
+       pim_vxlan_orig_mr_iif_update(bucket, NULL);
+       pim_vxlan_term_mr_cost_update(bucket, arg);
 }
 
 static void pim_vxlan_set_peerlink_rif(struct pim_instance *pim,
@@ -1032,10 +1032,10 @@ static void pim_vxlan_set_peerlink_rif(struct pim_instance *pim,
        }
 }
 
-static void pim_vxlan_term_mr_oif_update(struct hash_bucket *backet, void *arg)
+static void pim_vxlan_term_mr_oif_update(struct hash_bucket *bucket, void *arg)
 {
        struct interface *ifp = (struct interface *)arg;
-       struct pim_vxlan_sg *vxlan_sg = (struct pim_vxlan_sg *)backet->data;
+       struct pim_vxlan_sg *vxlan_sg = (struct pim_vxlan_sg *)bucket->data;
 
        if (pim_vxlan_is_orig_mroute(vxlan_sg))
                return;
index bf733e38f7b7caa312aaa2966b625031536ee32d..79a5d148a6732ed2610e257dde63a8ec6a9d8440 100644 (file)
@@ -1052,10 +1052,10 @@ struct fpm_rmac_arg {
        bool complete;
 };
 
-static void fpm_enqueue_rmac_table(struct hash_bucket *backet, void *arg)
+static void fpm_enqueue_rmac_table(struct hash_bucket *bucket, void *arg)
 {
        struct fpm_rmac_arg *fra = arg;
-       zebra_mac_t *zrmac = backet->data;
+       zebra_mac_t *zrmac = bucket->data;
        struct zebra_if *zif = fra->zl3vni->vxlan_if->info;
        const struct zebra_l2info_vxlan *vxl = &zif->l2info.vxl;
        struct zebra_if *br_zif;
@@ -1084,10 +1084,10 @@ static void fpm_enqueue_rmac_table(struct hash_bucket *backet, void *arg)
        }
 }
 
-static void fpm_enqueue_l3vni_table(struct hash_bucket *backet, void *arg)
+static void fpm_enqueue_l3vni_table(struct hash_bucket *bucket, void *arg)
 {
        struct fpm_rmac_arg *fra = arg;
-       zebra_l3vni_t *zl3vni = backet->data;
+       zebra_l3vni_t *zl3vni = bucket->data;
 
        fra->zl3vni = zl3vni;
        hash_iterate(zl3vni->rmac_table, fpm_enqueue_rmac_table, zl3vni);
@@ -1188,16 +1188,16 @@ static int fpm_rib_reset(struct thread *t)
 /*
  * The next three function will handle RMAC table reset.
  */
-static void fpm_unset_rmac_table(struct hash_bucket *backet, void *arg)
+static void fpm_unset_rmac_table(struct hash_bucket *bucket, void *arg)
 {
-       zebra_mac_t *zrmac = backet->data;
+       zebra_mac_t *zrmac = bucket->data;
 
        UNSET_FLAG(zrmac->flags, ZEBRA_MAC_FPM_SENT);
 }
 
-static void fpm_unset_l3vni_table(struct hash_bucket *backet, void *arg)
+static void fpm_unset_l3vni_table(struct hash_bucket *bucket, void *arg)
 {
-       zebra_l3vni_t *zl3vni = backet->data;
+       zebra_l3vni_t *zl3vni = bucket->data;
 
        hash_iterate(zl3vni->rmac_table, fpm_unset_rmac_table, zl3vni);
 }
index 18ccbb79fba37ab3107e1b36cc2ac610cb60ae85..73534c4332c08afee48362197c96ad7e1f51fc6d 100644 (file)
@@ -70,7 +70,7 @@ DEFINE_MTYPE_STATIC(ZEBRA, FPM_MAC_INFO, "FPM_MAC_INFO");
 #define ZFPM_STATS_IVL_SECS        10
 #define FPM_MAX_MAC_MSG_LEN 512
 
-static void zfpm_iterate_rmac_table(struct hash_bucket *backet, void *args);
+static void zfpm_iterate_rmac_table(struct hash_bucket *bucket, void *args);
 
 /*
  * Structure that holds state for iterating over all route_node
@@ -1635,10 +1635,10 @@ static int zfpm_trigger_rmac_update(zebra_mac_t *rmac, zebra_l3vni_t *zl3vni,
  * Iterate over all the RMAC entries for the given L3VNI
  * and enqueue the RMAC for FPM processing.
  */
-static void zfpm_trigger_rmac_update_wrapper(struct hash_bucket *backet,
+static void zfpm_trigger_rmac_update_wrapper(struct hash_bucket *bucket,
                                             void *args)
 {
-       zebra_mac_t *zrmac = (zebra_mac_t *)backet->data;
+       zebra_mac_t *zrmac = (zebra_mac_t *)bucket->data;
        zebra_l3vni_t *zl3vni = (zebra_l3vni_t *)args;
 
        zfpm_trigger_rmac_update(zrmac, zl3vni, false, "RMAC added");
@@ -1649,9 +1649,9 @@ static void zfpm_trigger_rmac_update_wrapper(struct hash_bucket *backet,
  * This function iterates over all the L3VNIs to trigger
  * FPM updates for RMACs currently available.
  */
-static void zfpm_iterate_rmac_table(struct hash_bucket *backet, void *args)
+static void zfpm_iterate_rmac_table(struct hash_bucket *bucket, void *args)
 {
-       zebra_l3vni_t *zl3vni = (zebra_l3vni_t *)backet->data;
+       zebra_l3vni_t *zl3vni = (zebra_l3vni_t *)bucket->data;
 
        hash_iterate(zl3vni->rmac_table, zfpm_trigger_rmac_update_wrapper,
                     (void *)zl3vni);
index 697a6eecf14a3fd7ba375593fd8ed1e4ea09bfbf..8a44d6cc029564f5d3c794b56bb9675a9bf37f23 100644 (file)
@@ -6115,9 +6115,9 @@ static void zebra_vxlan_sg_ref(struct in_addr local_vtep_ip,
        zebra_vxlan_sg_do_ref(zvrf, local_vtep_ip, mcast_grp);
 }
 
-static void zebra_vxlan_xg_pre_cleanup(struct hash_bucket *backet, void *arg)
+static void zebra_vxlan_xg_pre_cleanup(struct hash_bucket *bucket, void *arg)
 {
-       zebra_vxlan_sg_t *vxlan_sg = (zebra_vxlan_sg_t *)backet->data;
+       zebra_vxlan_sg_t *vxlan_sg = (zebra_vxlan_sg_t *)bucket->data;
 
        /* increment the ref count against (*,G) to prevent them from being
         * deleted
@@ -6126,9 +6126,9 @@ static void zebra_vxlan_xg_pre_cleanup(struct hash_bucket *backet, void *arg)
                ++vxlan_sg->ref_cnt;
 }
 
-static void zebra_vxlan_xg_post_cleanup(struct hash_bucket *backet, void *arg)
+static void zebra_vxlan_xg_post_cleanup(struct hash_bucket *bucket, void *arg)
 {
-       zebra_vxlan_sg_t *vxlan_sg = (zebra_vxlan_sg_t *)backet->data;
+       zebra_vxlan_sg_t *vxlan_sg = (zebra_vxlan_sg_t *)bucket->data;
 
        /* decrement the dummy ref count against (*,G) to delete them */
        if (vxlan_sg->sg.src.s_addr == INADDR_ANY) {
@@ -6139,9 +6139,9 @@ static void zebra_vxlan_xg_post_cleanup(struct hash_bucket *backet, void *arg)
        }
 }
 
-static void zebra_vxlan_sg_cleanup(struct hash_bucket *backet, void *arg)
+static void zebra_vxlan_sg_cleanup(struct hash_bucket *bucket, void *arg)
 {
-       zebra_vxlan_sg_t *vxlan_sg = (zebra_vxlan_sg_t *)backet->data;
+       zebra_vxlan_sg_t *vxlan_sg = (zebra_vxlan_sg_t *)bucket->data;
 
        zebra_vxlan_sg_del(vxlan_sg);
 }
@@ -6159,9 +6159,9 @@ static void zebra_vxlan_cleanup_sg_table(struct zebra_vrf *zvrf)
        hash_iterate(zvrf->vxlan_sg_table, zebra_vxlan_xg_post_cleanup, NULL);
 }
 
-static void zebra_vxlan_sg_replay_send(struct hash_bucket *backet, void *arg)
+static void zebra_vxlan_sg_replay_send(struct hash_bucket *bucket, void *arg)
 {
-       zebra_vxlan_sg_t *vxlan_sg = (zebra_vxlan_sg_t *)backet->data;
+       zebra_vxlan_sg_t *vxlan_sg = (zebra_vxlan_sg_t *)bucket->data;
 
        zebra_vxlan_sg_send(vxlan_sg->zvrf, &vxlan_sg->sg,
                        vxlan_sg->sg_str, ZEBRA_VXLAN_SG_ADD);