Lines Matching refs:num_nhops

78 static void sort_weightened_nhops(struct weightened_nhop *wn, int num_nhops);
81 struct weightened_nhop *wn, int num_nhops, uint32_t uidx, int *perror);
107 sort_weightened_nhops(struct weightened_nhop *wn, int num_nhops) in sort_weightened_nhops() argument
110 qsort(wn, num_nhops, sizeof(struct weightened_nhop), wn_cmp_idx); in sort_weightened_nhops()
214 get_nhgrp_alloc_size(uint32_t nhg_size, uint32_t num_nhops) in get_nhgrp_alloc_size() argument
221 sz += num_nhops * sizeof(struct weightened_nhop); in get_nhgrp_alloc_size()
279 alloc_nhgrp(struct weightened_nhop *wn, int num_nhops) in alloc_nhgrp() argument
285 nhgrp_size = calc_min_mpath_slots(wn, num_nhops); in alloc_nhgrp()
291 size_t sz = get_nhgrp_alloc_size(nhgrp_size, num_nhops); in alloc_nhgrp()
296 num_nhops, nhgrp_size); in alloc_nhgrp()
305 nhg_priv->nhg_nh_count = num_nhops; in alloc_nhgrp()
313 num_nhops * sizeof(struct weightened_nhop)); in alloc_nhgrp()
316 num_nhops, nhgrp_size); in alloc_nhgrp()
461 nhgrp_alloc(uint32_t fibnum, int family, struct weightened_nhop *wn, int num_nhops, in nhgrp_alloc() argument
475 if (num_nhops > RIB_MAX_MPATH_WIDTH) { in nhgrp_alloc()
489 sort_weightened_nhops(wn, num_nhops); in nhgrp_alloc()
491 for (int i = 0; i < num_nhops; i++) { in nhgrp_alloc()
503 if ((nhg_priv = alloc_nhgrp(wn, num_nhops)) == NULL) { in nhgrp_alloc()
565 get_nhgrp(struct nh_control *ctl, struct weightened_nhop *wn, int num_nhops, in get_nhgrp() argument
571 wn, num_nhops, perror); in get_nhgrp()
593 struct weightened_nhop *wn, int num_nhops, int *perror) in append_nhops() argument
607 sz = (src_priv->nhg_nh_count + num_nhops) * (sizeof(struct weightened_nhop)); in append_nhops()
622 memcpy(&pnhops[curr_nhops], wn, num_nhops * sizeof(struct weightened_nhop)); in append_nhops()
623 curr_nhops += num_nhops; in append_nhops()
645 nhgrp_get_group(struct rib_head *rh, struct weightened_nhop *wn, int num_nhops, in nhgrp_get_group() argument
652 nhg_priv = get_nhgrp(ctl, wn, num_nhops, uidx, &error); in nhgrp_get_group()
674 int error, i, num_nhops; in nhgrp_get_filtered_group() local
689 num_nhops = 0; in nhgrp_get_filtered_group()
693 memcpy(&pnhops[num_nhops++], &src_priv->nhg_nh_weights[i], in nhgrp_get_filtered_group()
697 if (num_nhops == 0) { in nhgrp_get_filtered_group()
700 } else if (num_nhops == 1) { in nhgrp_get_filtered_group()
706 mp_priv = get_nhgrp(ctl, pnhops, num_nhops, 0, &error); in nhgrp_get_filtered_group()