Lines Matching refs:nhg

242 	dst = dst_priv->nhg;  in compile_nhgrp()
282 struct nhgrp_object *nhg; in alloc_nhgrp() local
292 nhg = malloc(sz, M_NHOP, M_NOWAIT | M_ZERO); in alloc_nhgrp()
293 if (nhg == NULL) { in alloc_nhgrp()
301 nhg->nhg_size = nhgrp_size; in alloc_nhgrp()
302 nhg->nhg_flags = MPF_MULTIPATH; in alloc_nhgrp()
304 nhg_priv = NHGRP_PRIV(nhg); in alloc_nhgrp()
311 nhg_priv->nhg = nhg; in alloc_nhgrp()
318 compile_nhgrp(nhg_priv, wn, nhg->nhg_size); in alloc_nhgrp()
324 nhgrp_ref_object(struct nhgrp_object *nhg) in nhgrp_ref_object() argument
329 nhg_priv = NHGRP_PRIV(nhg); in nhgrp_ref_object()
331 KASSERT(old > 0, ("%s: nhgrp object %p has 0 refs", __func__, nhg)); in nhgrp_ref_object()
335 nhgrp_free(struct nhgrp_object *nhg) in nhgrp_free() argument
341 nhg_priv = NHGRP_PRIV(nhg); in nhgrp_free()
397 free(nhg_priv->nhg, M_NHOP); in destroy_nhgrp_int()
406 "destroying %s", nhgrp_print_buf(nhg_priv->nhg, in destroy_nhgrp()
510 return (nhg_priv->nhg); in nhgrp_alloc()
518 nhgrp_get_nhgrp(struct nhgrp_object *nhg, int *perror) in nhgrp_get_nhgrp() argument
520 struct nhgrp_priv *nhg_priv, *key = NHGRP_PRIV(nhg); in nhgrp_get_nhgrp()
532 return (nhg_priv->nhg); in nhgrp_get_nhgrp()
553 return (nhg); in nhgrp_get_nhgrp()
568 struct nhgrp_object *nhg; in get_nhgrp() local
570 nhg = nhgrp_alloc(ctl->ctl_rh->rib_fibnum, ctl->ctl_rh->rib_family, in get_nhgrp()
572 if (nhg == NULL) in get_nhgrp()
574 nhgrp_set_uidx(nhg, uidx); in get_nhgrp()
575 nhg = nhgrp_get_nhgrp(nhg, perror); in get_nhgrp()
576 if (nhg != NULL) in get_nhgrp()
577 return (NHGRP_PRIV(nhg)); in get_nhgrp()
654 *pnhg = nhg_priv->nhg; in nhgrp_get_group()
708 rnd->rnd_nhgrp = mp_priv->nhg; in nhgrp_get_filtered_group()
756 rnd_new->rnd_nhgrp = nhg_priv->nhg; in nhgrp_get_addition_group()
767 nhgrp_get_nhops(const struct nhgrp_object *nhg, uint32_t *pnum_nhops) in nhgrp_get_nhops() argument
771 KASSERT(((nhg->nhg_flags & MPF_MULTIPATH) != 0), ("nhop is not mpath")); in nhgrp_get_nhops()
773 nhg_priv = NHGRP_PRIV_CONST(nhg); in nhgrp_get_nhops()
780 nhgrp_set_uidx(struct nhgrp_object *nhg, uint32_t uidx) in nhgrp_set_uidx() argument
784 KASSERT(((nhg->nhg_flags & MPF_MULTIPATH) != 0), ("nhop is not mpath")); in nhgrp_set_uidx()
786 nhg_priv = NHGRP_PRIV(nhg); in nhgrp_set_uidx()
792 nhgrp_get_uidx(const struct nhgrp_object *nhg) in nhgrp_get_uidx() argument
796 KASSERT(((nhg->nhg_flags & MPF_MULTIPATH) != 0), ("nhop is not mpath")); in nhgrp_get_uidx()
798 nhg_priv = NHGRP_PRIV_CONST(nhg); in nhgrp_get_uidx()
808 nhgrp_print_buf(const struct nhgrp_object *nhg, char *buf, size_t bufsize) in nhgrp_print_buf() argument
810 const struct nhgrp_priv *nhg_priv = NHGRP_PRIV_CONST(nhg); in nhgrp_print_buf()
840 const struct nhgrp_object *nhg; in dump_nhgrp_entry() local
845 nhg = nhg_priv->nhg; in dump_nhgrp_entry()
853 sz += sizeof(struct nhgrp_nhop_external) * nhg->nhg_size; in dump_nhgrp_entry()
888 nhgc->nhgc_len += sizeof(struct nhgrp_nhop_external) * nhg->nhg_size; in dump_nhgrp_entry()
889 nhgc->nhgc_count = nhg->nhg_size; in dump_nhgrp_entry()
892 for (int i = 0; i < nhg->nhg_size; i++) { in dump_nhgrp_entry()
893 ext[i].nh_idx = nhg->nhops[i]->nh_priv->nh_idx; in dump_nhgrp_entry()
903 nhgrp_get_idx(const struct nhgrp_object *nhg) in nhgrp_get_idx() argument
907 nhg_priv = NHGRP_PRIV_CONST(nhg); in nhgrp_get_idx()
912 nhgrp_get_origin(const struct nhgrp_object *nhg) in nhgrp_get_origin() argument
914 return (NHGRP_PRIV_CONST(nhg)->nhg_origin); in nhgrp_get_origin()
918 nhgrp_set_origin(struct nhgrp_object *nhg, uint8_t origin) in nhgrp_set_origin() argument
920 NHGRP_PRIV(nhg)->nhg_origin = origin; in nhgrp_set_origin()