Lines Matching refs:iter
1076 struct fib6_info *iter = NULL; in fib6_add_rt2node() local
1094 for (iter = leaf; iter; in fib6_add_rt2node()
1095 iter = rcu_dereference_protected(iter->fib6_next, in fib6_add_rt2node()
1101 if (iter->fib6_metric == rt->fib6_metric) { in fib6_add_rt2node()
1111 if (rt_can_ecmp == rt6_qualify_for_ecmp(iter)) { in fib6_add_rt2node()
1119 if (rt6_duplicate_nexthop(iter, rt)) { in fib6_add_rt2node()
1122 if (!(iter->fib6_flags & RTF_EXPIRES)) in fib6_add_rt2node()
1125 fib6_clean_expires(iter); in fib6_add_rt2node()
1127 fib6_set_expires(iter, rt->expires); in fib6_add_rt2node()
1130 fib6_metric_set(iter, RTAX_MTU, in fib6_add_rt2node()
1146 rt6_qualify_for_ecmp(iter)) in fib6_add_rt2node()
1150 if (iter->fib6_metric > rt->fib6_metric) in fib6_add_rt2node()
1154 ins = &iter->fib6_next; in fib6_add_rt2node()
1162 iter = rcu_dereference_protected(*ins, in fib6_add_rt2node()
1250 rcu_assign_pointer(rt->fib6_next, iter); in fib6_add_rt2node()
1283 rt->fib6_next = iter->fib6_next; in fib6_add_rt2node()
1291 nsiblings = iter->fib6_nsiblings; in fib6_add_rt2node()
1292 iter->fib6_node = NULL; in fib6_add_rt2node()
1293 fib6_purge_rt(iter, fn, info->nl_net); in fib6_add_rt2node()
1294 if (rcu_access_pointer(fn->rr_ptr) == iter) in fib6_add_rt2node()
1296 fib6_info_release(iter); in fib6_add_rt2node()
1301 iter = rcu_dereference_protected(*ins, in fib6_add_rt2node()
1303 while (iter) { in fib6_add_rt2node()
1304 if (iter->fib6_metric > rt->fib6_metric) in fib6_add_rt2node()
1306 if (rt6_qualify_for_ecmp(iter)) { in fib6_add_rt2node()
1307 *ins = iter->fib6_next; in fib6_add_rt2node()
1308 iter->fib6_node = NULL; in fib6_add_rt2node()
1309 fib6_purge_rt(iter, fn, info->nl_net); in fib6_add_rt2node()
1310 if (rcu_access_pointer(fn->rr_ptr) == iter) in fib6_add_rt2node()
1312 fib6_info_release(iter); in fib6_add_rt2node()
1316 ins = &iter->fib6_next; in fib6_add_rt2node()
1318 iter = rcu_dereference_protected(*ins, in fib6_add_rt2node()
1788 int iter = 0; in fib6_repair_tree() local
1813 RT6_TRACE("fixing tree: plen=%d iter=%d\n", fn->fn_bit, iter); in fib6_repair_tree()
1814 iter++; in fib6_repair_tree()
2491 struct ipv6_route_iter *iter = seq->private; in ipv6_route_native_seq_show() local
2517 iter->w.leaf = NULL; in ipv6_route_native_seq_show()
2523 struct ipv6_route_iter *iter = w->args; in ipv6_route_yield() local
2525 if (!iter->skip) in ipv6_route_yield()
2529 iter->w.leaf = rcu_dereference_protected( in ipv6_route_yield()
2530 iter->w.leaf->fib6_next, in ipv6_route_yield()
2531 lockdep_is_held(&iter->tbl->tb6_lock)); in ipv6_route_yield()
2532 iter->skip--; in ipv6_route_yield()
2533 if (!iter->skip && iter->w.leaf) in ipv6_route_yield()
2535 } while (iter->w.leaf); in ipv6_route_yield()
2540 static void ipv6_route_seq_setup_walk(struct ipv6_route_iter *iter, in ipv6_route_seq_setup_walk() argument
2543 memset(&iter->w, 0, sizeof(iter->w)); in ipv6_route_seq_setup_walk()
2544 iter->w.func = ipv6_route_yield; in ipv6_route_seq_setup_walk()
2545 iter->w.root = &iter->tbl->tb6_root; in ipv6_route_seq_setup_walk()
2546 iter->w.state = FWS_INIT; in ipv6_route_seq_setup_walk()
2547 iter->w.node = iter->w.root; in ipv6_route_seq_setup_walk()
2548 iter->w.args = iter; in ipv6_route_seq_setup_walk()
2549 iter->sernum = READ_ONCE(iter->w.root->fn_sernum); in ipv6_route_seq_setup_walk()
2550 INIT_LIST_HEAD(&iter->w.lh); in ipv6_route_seq_setup_walk()
2551 fib6_walker_link(net, &iter->w); in ipv6_route_seq_setup_walk()
2575 static void ipv6_route_check_sernum(struct ipv6_route_iter *iter) in ipv6_route_check_sernum() argument
2577 int sernum = READ_ONCE(iter->w.root->fn_sernum); in ipv6_route_check_sernum()
2579 if (iter->sernum != sernum) { in ipv6_route_check_sernum()
2580 iter->sernum = sernum; in ipv6_route_check_sernum()
2581 iter->w.state = FWS_INIT; in ipv6_route_check_sernum()
2582 iter->w.node = iter->w.root; in ipv6_route_check_sernum()
2583 WARN_ON(iter->w.skip); in ipv6_route_check_sernum()
2584 iter->w.skip = iter->w.count; in ipv6_route_check_sernum()
2593 struct ipv6_route_iter *iter = seq->private; in ipv6_route_seq_next() local
2604 ipv6_route_check_sernum(iter); in ipv6_route_seq_next()
2605 spin_lock_bh(&iter->tbl->tb6_lock); in ipv6_route_seq_next()
2606 r = fib6_walk_continue(&iter->w); in ipv6_route_seq_next()
2607 spin_unlock_bh(&iter->tbl->tb6_lock); in ipv6_route_seq_next()
2609 return iter->w.leaf; in ipv6_route_seq_next()
2611 fib6_walker_unlink(net, &iter->w); in ipv6_route_seq_next()
2614 fib6_walker_unlink(net, &iter->w); in ipv6_route_seq_next()
2616 iter->tbl = ipv6_route_seq_next_table(iter->tbl, net); in ipv6_route_seq_next()
2617 if (!iter->tbl) in ipv6_route_seq_next()
2620 ipv6_route_seq_setup_walk(iter, net); in ipv6_route_seq_next()
2628 struct ipv6_route_iter *iter = seq->private; in ipv6_route_seq_start() local
2631 iter->tbl = ipv6_route_seq_next_table(NULL, net); in ipv6_route_seq_start()
2632 iter->skip = *pos; in ipv6_route_seq_start()
2634 if (iter->tbl) { in ipv6_route_seq_start()
2637 ipv6_route_seq_setup_walk(iter, net); in ipv6_route_seq_start()
2644 static bool ipv6_route_iter_active(struct ipv6_route_iter *iter) in ipv6_route_iter_active() argument
2646 struct fib6_walker *w = &iter->w; in ipv6_route_iter_active()
2654 struct ipv6_route_iter *iter = seq->private; in ipv6_route_native_seq_stop() local
2656 if (ipv6_route_iter_active(iter)) in ipv6_route_native_seq_stop()
2657 fib6_walker_unlink(net, &iter->w); in ipv6_route_native_seq_stop()
2676 struct ipv6_route_iter *iter = seq->private; in ipv6_route_seq_show() local
2687 iter->w.leaf = NULL; in ipv6_route_seq_show()