Lines Matching refs:dst_cache

27 static void dst_cache_per_cpu_dst_set(struct dst_cache_pcpu *dst_cache,  in dst_cache_per_cpu_dst_set()  argument
30 dst_release(dst_cache->dst); in dst_cache_per_cpu_dst_set()
34 dst_cache->cookie = cookie; in dst_cache_per_cpu_dst_set()
35 dst_cache->dst = dst; in dst_cache_per_cpu_dst_set()
38 static struct dst_entry *dst_cache_per_cpu_get(struct dst_cache *dst_cache, in dst_cache_per_cpu_get() argument
50 if (unlikely(!time_after(idst->refresh_ts, dst_cache->reset_ts) || in dst_cache_per_cpu_get()
63 struct dst_entry *dst_cache_get(struct dst_cache *dst_cache) in dst_cache_get() argument
65 if (!dst_cache->cache) in dst_cache_get()
68 return dst_cache_per_cpu_get(dst_cache, this_cpu_ptr(dst_cache->cache)); in dst_cache_get()
72 struct rtable *dst_cache_get_ip4(struct dst_cache *dst_cache, __be32 *saddr) in dst_cache_get_ip4() argument
77 if (!dst_cache->cache) in dst_cache_get_ip4()
80 idst = this_cpu_ptr(dst_cache->cache); in dst_cache_get_ip4()
81 dst = dst_cache_per_cpu_get(dst_cache, idst); in dst_cache_get_ip4()
90 void dst_cache_set_ip4(struct dst_cache *dst_cache, struct dst_entry *dst, in dst_cache_set_ip4() argument
95 if (!dst_cache->cache) in dst_cache_set_ip4()
98 idst = this_cpu_ptr(dst_cache->cache); in dst_cache_set_ip4()
105 void dst_cache_set_ip6(struct dst_cache *dst_cache, struct dst_entry *dst, in dst_cache_set_ip6() argument
110 if (!dst_cache->cache) in dst_cache_set_ip6()
113 idst = this_cpu_ptr(dst_cache->cache); in dst_cache_set_ip6()
114 dst_cache_per_cpu_dst_set(this_cpu_ptr(dst_cache->cache), dst, in dst_cache_set_ip6()
120 struct dst_entry *dst_cache_get_ip6(struct dst_cache *dst_cache, in dst_cache_get_ip6() argument
126 if (!dst_cache->cache) in dst_cache_get_ip6()
129 idst = this_cpu_ptr(dst_cache->cache); in dst_cache_get_ip6()
130 dst = dst_cache_per_cpu_get(dst_cache, idst); in dst_cache_get_ip6()
140 int dst_cache_init(struct dst_cache *dst_cache, gfp_t gfp) in dst_cache_init() argument
142 dst_cache->cache = alloc_percpu_gfp(struct dst_cache_pcpu, in dst_cache_init()
144 if (!dst_cache->cache) in dst_cache_init()
147 dst_cache_reset(dst_cache); in dst_cache_init()
152 void dst_cache_destroy(struct dst_cache *dst_cache) in dst_cache_destroy() argument
156 if (!dst_cache->cache) in dst_cache_destroy()
160 dst_release(per_cpu_ptr(dst_cache->cache, i)->dst); in dst_cache_destroy()
162 free_percpu(dst_cache->cache); in dst_cache_destroy()
166 void dst_cache_reset_now(struct dst_cache *dst_cache) in dst_cache_reset_now() argument
170 if (!dst_cache->cache) in dst_cache_reset_now()
173 dst_cache->reset_ts = jiffies; in dst_cache_reset_now()
175 struct dst_cache_pcpu *idst = per_cpu_ptr(dst_cache->cache, i); in dst_cache_reset_now()