Lines Matching full:rh
200 static void set_algo_fixed(struct rib_head *rh);
201 static bool is_algo_fixed(struct rib_head *rh);
206 static struct fib_lookup_module *fib_check_best_algo(struct rib_head *rh,
1044 * Wipe all fd instances from the list matching rib specified by @rh.
1048 fib_cleanup_algo(struct rib_head *rh, bool keep_first, bool in_callout) in fib_cleanup_algo() argument
1056 if (fd->fd_rh == rh) { in fib_cleanup_algo()
1081 fib_destroy_rib(struct rib_head *rh) in fib_destroy_rib() argument
1089 fib_cleanup_algo(rh, false, false); in fib_destroy_rib()
1154 try_setup_fd_instance(struct fib_lookup_module *flm, struct rib_head *rh, in try_setup_fd_instance() argument
1165 RH_PRINTF(LOG_INFO, rh, "Unable to allocate fib_data structure"); in try_setup_fd_instance()
1172 fd->fd_rh = rh; in try_setup_fd_instance()
1173 fd->fd_family = rh->rib_family; in try_setup_fd_instance()
1174 fd->fd_fibnum = rh->rib_fibnum; in try_setup_fd_instance()
1175 callout_init_rm(&fd->fd_callout, &rh->rib_lock, 0); in try_setup_fd_instance()
1244 * Sets up algo @flm for table @rh and links it to the datapath.
1248 setup_fd_instance(struct fib_lookup_module *flm, struct rib_head *rh, in setup_fd_instance() argument
1255 RIB_WLOCK_ASSERT(rh); in setup_fd_instance()
1260 result = try_setup_fd_instance(flm, rh, prev_fd, &new_fd); in setup_fd_instance()
1274 RH_PRINTF(LOG_INFO, rh, "try %d: fib algo result: %s", i, in setup_fd_instance()
1287 RH_PRINTF(LOG_WARNING, rh, in setup_fd_instance()
1298 flm_error_add(flm, rh->rib_fibnum); in setup_fd_instance()
1460 struct rib_head *rh = NULL; in set_fib_algo() local
1475 rh = fd->fd_rh; in set_fib_algo()
1491 RH_PRINTF(LOG_INFO, rh, "unable to find algo %s", algo_name); in set_fib_algo()
1497 RIB_WLOCK(rh); in set_fib_algo()
1498 result = setup_fd_instance(flm, rh, NULL, &fd, true); in set_fib_algo()
1499 RIB_WUNLOCK(rh); in set_fib_algo()
1507 set_algo_fixed(rh); in set_fib_algo()
1510 fib_cleanup_algo(rh, true, false); in set_fib_algo()
1712 fib_get_rtable_info(struct rib_head *rh, struct rib_rtable_info *rinfo) in fib_get_rtable_info() argument
1716 rinfo->num_prefixes = rh->rnh_prefixes; in fib_get_rtable_info()
1717 rinfo->num_nhops = nhops_get_count(rh); in fib_get_rtable_info()
1719 rinfo->num_nhgrp = nhgrp_get_count(rh); in fib_get_rtable_info()
1865 set_algo_fixed(struct rib_head *rh) in set_algo_fixed() argument
1867 switch (rh->rib_family) { in set_algo_fixed()
1882 is_algo_fixed(struct rib_head *rh) in is_algo_fixed() argument
1885 switch (rh->rib_family) { in is_algo_fixed()
1899 * Runs the check on what would be the best algo for rib @rh, assuming
1906 fib_check_best_algo(struct rib_head *rh, struct fib_lookup_module *orig_flm) in fib_check_best_algo() argument
1913 fib_get_rtable_info(rh, &rinfo); in fib_check_best_algo()
1917 if (flm->flm_family != rh->rib_family) in fib_check_best_algo()
1922 if (!flm_error_check(flm, rh->rib_fibnum)) { in fib_check_best_algo()
1936 RH_PRINTF(LOG_DEBUG, rh, "candidate_algos: %d, curr: %s(%d) result: %s(%d)", in fib_check_best_algo()
1949 fib_select_algo_initial(struct rib_head *rh, struct fib_dp *dp) in fib_select_algo_initial() argument
1956 flm = fib_check_best_algo(rh, NULL); in fib_select_algo_initial()
1958 RH_PRINTF(LOG_CRIT, rh, "no algo selected"); in fib_select_algo_initial()
1961 RH_PRINTF(LOG_INFO, rh, "selected algo %s", flm->flm_name); in fib_select_algo_initial()
1964 RIB_WLOCK(rh); in fib_select_algo_initial()
1965 result = setup_fd_instance(flm, rh, NULL, &fd, false); in fib_select_algo_initial()
1966 RIB_WUNLOCK(rh); in fib_select_algo_initial()
1969 RH_PRINTF(LOG_DEBUG, rh, "result=%d fd=%p", result, fd); in fib_select_algo_initial()
1973 RH_PRINTF(LOG_CRIT, rh, "unable to setup algo %s", flm->flm_name); in fib_select_algo_initial()
1995 struct rib_head *rh = rt_tables_get_rnh(i, family); in fib_setup_family() local
1996 if (rh->rib_algo_init) in fib_setup_family()
1998 if (!fib_select_algo_initial(rh, &new_fdh->fdh_idx[i])) in fib_setup_family()
2001 rh->rib_algo_init = true; in fib_setup_family()