From 1ac88792c0cb306bdb05f977f88f449fe7a1a1ea Mon Sep 17 00:00:00 2001 From: Igor Ryzhov Date: Tue, 2 Feb 2021 19:11:25 +0300 Subject: [PATCH] *: fix all backets Signed-off-by: Igor Ryzhov --- lib/hash.c | 8 ++++---- lib/hash.h | 2 +- lib/routemap.c | 4 ++-- ospfd/ospf_vty.c | 16 ++++++++-------- pimd/pim_cmd.c | 4 ++-- pimd/pim_vxlan.c | 22 +++++++++++----------- zebra/dplane_fpm_nl.c | 16 ++++++++-------- zebra/zebra_fpm.c | 10 +++++----- zebra/zebra_vxlan.c | 16 ++++++++-------- 9 files changed, 49 insertions(+), 49 deletions(-) diff --git a/lib/hash.c b/lib/hash.c index ed429b77d0..ec616ee724 100644 --- a/lib/hash.c +++ b/lib/hash.c @@ -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; diff --git a/lib/hash.h b/lib/hash.h index 23e93b6d7d..47d951a34b 100644 --- a/lib/hash.h +++ b/lib/hash.h @@ -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; diff --git a/lib/routemap.c b/lib/routemap.c index 360fd25cc9..7714086672 100644 --- a/lib/routemap.c +++ b/lib/routemap.c @@ -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; diff --git a/ospfd/ospf_vty.c b/ospfd/ospf_vty.c index 949582278f..4132452069 100644 --- a/ospfd/ospf_vty.c +++ b/ospfd/ospf_vty.c @@ -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", diff --git a/pimd/pim_cmd.c b/pimd/pim_cmd.c index ff85151839..e7c076c7ca 100644 --- a/pimd/pim_cmd.c +++ b/pimd/pim_cmd.c @@ -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); } diff --git a/pimd/pim_vxlan.c b/pimd/pim_vxlan.c index 380c97a97c..6a12c7fb13 100644 --- a/pimd/pim_vxlan.c +++ b/pimd/pim_vxlan.c @@ -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; diff --git a/zebra/dplane_fpm_nl.c b/zebra/dplane_fpm_nl.c index bf733e38f7..79a5d148a6 100644 --- a/zebra/dplane_fpm_nl.c +++ b/zebra/dplane_fpm_nl.c @@ -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); } diff --git a/zebra/zebra_fpm.c b/zebra/zebra_fpm.c index 18ccbb79fb..73534c4332 100644 --- a/zebra/zebra_fpm.c +++ b/zebra/zebra_fpm.c @@ -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); diff --git a/zebra/zebra_vxlan.c b/zebra/zebra_vxlan.c index 697a6eecf1..8a44d6cc02 100644 --- a/zebra/zebra_vxlan.c +++ b/zebra/zebra_vxlan.c @@ -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); -- 2.39.5