• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /freebsd-13-stable/sys/net/route/

Lines Matching defs:num_nhops

75 static void sort_weightened_nhops(struct weightened_nhop *wn, int num_nhops);
78 struct weightened_nhop *wn, int num_nhops, int *perror);
114 sort_weightened_nhops(struct weightened_nhop *wn, int num_nhops)
117 qsort(wn, num_nhops, sizeof(struct weightened_nhop), wn_cmp);
191 get_nhgrp_alloc_size(uint32_t nhg_size, uint32_t num_nhops)
198 sz += num_nhops * sizeof(struct weightened_nhop);
255 alloc_nhgrp(struct weightened_nhop *wn, int num_nhops)
262 nhgrp_size = calc_min_mpath_slots(wn, num_nhops);
268 size_t sz = get_nhgrp_alloc_size(nhgrp_size, num_nhops);
276 DPRINTF("new mpath group: num_nhops: %u", (uint32_t)nhgrp_size);
280 nhg_priv->nhg_nh_count = num_nhops;
288 num_nhops * sizeof(struct weightened_nhop));
427 * Creates or looks up an existing nexthop group based on @wn and @num_nhops.
432 get_nhgrp(struct nh_control *ctl, struct weightened_nhop *wn, int num_nhops,
437 if (num_nhops > RIB_MAX_MPATH_WIDTH) {
451 sort_weightened_nhops(wn, num_nhops);
453 for (int i = 0; i < num_nhops; i++) {
461 if ((key = alloc_nhgrp(wn, num_nhops)) == NULL) {
513 struct weightened_nhop *wn, int num_nhops, int *perror)
527 sz = (src_priv->nhg_nh_count + num_nhops) * (sizeof(struct weightened_nhop));
542 memcpy(&pnhops[curr_nhops], wn, num_nhops * sizeof(struct weightened_nhop));
543 curr_nhops += num_nhops;
558 * Creates/finds nexthop group based on @wn and @num_nhops.
565 nhgrp_get_group(struct rib_head *rh, struct weightened_nhop *wn, int num_nhops,
572 nhg_priv = get_nhgrp(ctl, wn, num_nhops, &error);
594 int error, i, num_nhops;
609 num_nhops = 0;
613 memcpy(&pnhops[num_nhops++], &src_priv->nhg_nh_weights[i],
617 if (num_nhops == 0) {
620 } else if (num_nhops == 1) {
626 mp_priv = get_nhgrp(ctl, pnhops, num_nhops, &error);