Lines Matching refs:bucket
1460 static void rt6_remove_exception(struct rt6_exception_bucket *bucket, in rt6_remove_exception() argument
1466 if (!bucket || !rt6_ex) in rt6_remove_exception()
1482 WARN_ON_ONCE(!bucket->depth); in rt6_remove_exception()
1483 bucket->depth--; in rt6_remove_exception()
1489 static void rt6_exception_remove_oldest(struct rt6_exception_bucket *bucket) in rt6_exception_remove_oldest() argument
1493 if (!bucket) in rt6_exception_remove_oldest()
1496 hlist_for_each_entry(rt6_ex, &bucket->chain, hlist) { in rt6_exception_remove_oldest()
1500 rt6_remove_exception(bucket, oldest); in rt6_exception_remove_oldest()
1532 __rt6_find_exception_spinlock(struct rt6_exception_bucket **bucket, in __rt6_find_exception_spinlock() argument
1539 if (!(*bucket) || !daddr) in __rt6_find_exception_spinlock()
1543 *bucket += hval; in __rt6_find_exception_spinlock()
1545 hlist_for_each_entry(rt6_ex, &(*bucket)->chain, hlist) { in __rt6_find_exception_spinlock()
1565 __rt6_find_exception_rcu(struct rt6_exception_bucket **bucket, in __rt6_find_exception_rcu() argument
1574 if (!(*bucket) || !daddr) in __rt6_find_exception_rcu()
1578 *bucket += hval; in __rt6_find_exception_rcu()
1580 hlist_for_each_entry_rcu(rt6_ex, &(*bucket)->chain, hlist) { in __rt6_find_exception_rcu()
1627 struct rt6_exception_bucket *bucket; in fib6_nh_get_excptn_bucket() local
1630 bucket = rcu_dereference_protected(nh->rt6i_exception_bucket, in fib6_nh_get_excptn_bucket()
1633 bucket = rcu_dereference(nh->rt6i_exception_bucket); in fib6_nh_get_excptn_bucket()
1636 if (bucket) { in fib6_nh_get_excptn_bucket()
1637 unsigned long p = (unsigned long)bucket; in fib6_nh_get_excptn_bucket()
1640 bucket = (struct rt6_exception_bucket *)p; in fib6_nh_get_excptn_bucket()
1643 return bucket; in fib6_nh_get_excptn_bucket()
1646 static bool fib6_nh_excptn_bucket_flushed(struct rt6_exception_bucket *bucket) in fib6_nh_excptn_bucket_flushed() argument
1648 unsigned long p = (unsigned long)bucket; in fib6_nh_excptn_bucket_flushed()
1657 struct rt6_exception_bucket *bucket; in fib6_nh_excptn_bucket_set_flushed() local
1660 bucket = rcu_dereference_protected(nh->rt6i_exception_bucket, in fib6_nh_excptn_bucket_set_flushed()
1663 p = (unsigned long)bucket; in fib6_nh_excptn_bucket_set_flushed()
1665 bucket = (struct rt6_exception_bucket *)p; in fib6_nh_excptn_bucket_set_flushed()
1666 rcu_assign_pointer(nh->rt6i_exception_bucket, bucket); in fib6_nh_excptn_bucket_set_flushed()
1673 struct rt6_exception_bucket *bucket; in rt6_insert_exception() local
1683 bucket = rcu_dereference_protected(nh->rt6i_exception_bucket, in rt6_insert_exception()
1685 if (!bucket) { in rt6_insert_exception()
1686 bucket = kcalloc(FIB6_EXCEPTION_BUCKET_SIZE, sizeof(*bucket), in rt6_insert_exception()
1688 if (!bucket) { in rt6_insert_exception()
1692 rcu_assign_pointer(nh->rt6i_exception_bucket, bucket); in rt6_insert_exception()
1693 } else if (fib6_nh_excptn_bucket_flushed(bucket)) { in rt6_insert_exception()
1717 rt6_ex = __rt6_find_exception_spinlock(&bucket, &nrt->rt6i_dst.addr, in rt6_insert_exception()
1720 rt6_remove_exception(bucket, rt6_ex); in rt6_insert_exception()
1729 hlist_add_head_rcu(&rt6_ex->hlist, &bucket->chain); in rt6_insert_exception()
1730 bucket->depth++; in rt6_insert_exception()
1735 while (bucket->depth > max_depth) in rt6_insert_exception()
1736 rt6_exception_remove_oldest(bucket); in rt6_insert_exception()
1754 struct rt6_exception_bucket *bucket; in fib6_nh_flush_exceptions() local
1761 bucket = fib6_nh_get_excptn_bucket(nh, &rt6_exception_lock); in fib6_nh_flush_exceptions()
1762 if (!bucket) in fib6_nh_flush_exceptions()
1770 hlist_for_each_entry_safe(rt6_ex, tmp, &bucket->chain, hlist) { in fib6_nh_flush_exceptions()
1773 rt6_remove_exception(bucket, rt6_ex); in fib6_nh_flush_exceptions()
1775 WARN_ON_ONCE(!from && bucket->depth); in fib6_nh_flush_exceptions()
1776 bucket++; in fib6_nh_flush_exceptions()
1808 struct rt6_exception_bucket *bucket; in rt6_find_cached_rt() local
1828 bucket = fib6_nh_get_excptn_bucket(res->nh, NULL); in rt6_find_cached_rt()
1829 rt6_ex = __rt6_find_exception_rcu(&bucket, daddr, src_key); in rt6_find_cached_rt()
1850 struct rt6_exception_bucket *bucket; in fib6_nh_remove_exception() local
1858 bucket = fib6_nh_get_excptn_bucket(nh, &rt6_exception_lock); in fib6_nh_remove_exception()
1870 rt6_ex = __rt6_find_exception_spinlock(&bucket, in fib6_nh_remove_exception()
1874 rt6_remove_exception(bucket, rt6_ex); in fib6_nh_remove_exception()
1934 struct rt6_exception_bucket *bucket; in fib6_nh_update_exception() local
1937 bucket = fib6_nh_get_excptn_bucket(nh, NULL); in fib6_nh_update_exception()
1948 rt6_ex = __rt6_find_exception_rcu(&bucket, &rt->rt6i_dst.addr, src_key); in fib6_nh_update_exception()
2031 struct rt6_exception_bucket *bucket; in rt6_exceptions_update_pmtu() local
2035 bucket = fib6_nh_get_excptn_bucket(nh, &rt6_exception_lock); in rt6_exceptions_update_pmtu()
2036 if (!bucket) in rt6_exceptions_update_pmtu()
2040 hlist_for_each_entry(rt6_ex, &bucket->chain, hlist) { in rt6_exceptions_update_pmtu()
2051 bucket++; in rt6_exceptions_update_pmtu()
2060 struct rt6_exception_bucket *bucket; in fib6_nh_exceptions_clean_tohost() local
2069 bucket = fib6_nh_get_excptn_bucket(nh, &rt6_exception_lock); in fib6_nh_exceptions_clean_tohost()
2070 if (bucket) { in fib6_nh_exceptions_clean_tohost()
2073 &bucket->chain, hlist) { in fib6_nh_exceptions_clean_tohost()
2080 rt6_remove_exception(bucket, rt6_ex); in fib6_nh_exceptions_clean_tohost()
2083 bucket++; in fib6_nh_exceptions_clean_tohost()
2090 static void rt6_age_examine_exception(struct rt6_exception_bucket *bucket, in rt6_age_examine_exception() argument
2106 rt6_remove_exception(bucket, rt6_ex); in rt6_age_examine_exception()
2111 rt6_remove_exception(bucket, rt6_ex); in rt6_age_examine_exception()
2126 rt6_remove_exception(bucket, rt6_ex); in rt6_age_examine_exception()
2138 struct rt6_exception_bucket *bucket; in fib6_nh_age_exceptions() local
2148 bucket = fib6_nh_get_excptn_bucket(nh, &rt6_exception_lock); in fib6_nh_age_exceptions()
2149 if (bucket) { in fib6_nh_age_exceptions()
2152 &bucket->chain, hlist) { in fib6_nh_age_exceptions()
2153 rt6_age_examine_exception(bucket, rt6_ex, in fib6_nh_age_exceptions()
2156 bucket++; in fib6_nh_age_exceptions()
3556 struct rt6_exception_bucket *bucket; in fib6_nh_release() local
3561 bucket = fib6_nh_get_excptn_bucket(fib6_nh, NULL); in fib6_nh_release()
3562 if (bucket) { in fib6_nh_release()
3564 kfree(bucket); in fib6_nh_release()
5644 struct rt6_exception_bucket *bucket; in rt6_nh_dump_exceptions() local
5648 bucket = fib6_nh_get_excptn_bucket(nh, NULL); in rt6_nh_dump_exceptions()
5649 if (!bucket) in rt6_nh_dump_exceptions()
5653 hlist_for_each_entry(rt6_ex, &bucket->chain, hlist) { in rt6_nh_dump_exceptions()
5685 bucket++; in rt6_nh_dump_exceptions()