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
31 dst_release(dst_cache->dst); in dst_cache_per_cpu_dst_set()
35 dst_cache->cookie = cookie; in dst_cache_per_cpu_dst_set()
36 dst_cache->dst = dst; in dst_cache_per_cpu_dst_set()
39 static struct dst_entry *dst_cache_per_cpu_get(struct dst_cache *dst_cache, in dst_cache_per_cpu_get() argument
53 READ_ONCE(dst_cache->reset_ts)) || in dst_cache_per_cpu_get()
66 struct dst_entry *dst_cache_get(struct dst_cache *dst_cache) in dst_cache_get() argument
68 if (!dst_cache->cache) in dst_cache_get()
71 return dst_cache_per_cpu_get(dst_cache, this_cpu_ptr(dst_cache->cache)); in dst_cache_get()
75 struct rtable *dst_cache_get_ip4(struct dst_cache *dst_cache, __be32 *saddr) in dst_cache_get_ip4() argument
80 if (!dst_cache->cache) in dst_cache_get_ip4()
83 idst = this_cpu_ptr(dst_cache->cache); in dst_cache_get_ip4()
84 dst = dst_cache_per_cpu_get(dst_cache, idst); in dst_cache_get_ip4()
93 void dst_cache_set_ip4(struct dst_cache *dst_cache, struct dst_entry *dst, in dst_cache_set_ip4() argument
98 if (!dst_cache->cache) in dst_cache_set_ip4()
101 idst = this_cpu_ptr(dst_cache->cache); in dst_cache_set_ip4()
108 void dst_cache_set_ip6(struct dst_cache *dst_cache, struct dst_entry *dst, in dst_cache_set_ip6() argument
113 if (!dst_cache->cache) in dst_cache_set_ip6()
116 idst = this_cpu_ptr(dst_cache->cache); in dst_cache_set_ip6()
123 struct dst_entry *dst_cache_get_ip6(struct dst_cache *dst_cache, in dst_cache_get_ip6() argument
129 if (!dst_cache->cache) in dst_cache_get_ip6()
132 idst = this_cpu_ptr(dst_cache->cache); in dst_cache_get_ip6()
133 dst = dst_cache_per_cpu_get(dst_cache, idst); in dst_cache_get_ip6()
143 int dst_cache_init(struct dst_cache *dst_cache, gfp_t gfp) in dst_cache_init() argument
145 dst_cache->cache = alloc_percpu_gfp(struct dst_cache_pcpu, in dst_cache_init()
147 if (!dst_cache->cache) in dst_cache_init()
150 dst_cache_reset(dst_cache); in dst_cache_init()
155 void dst_cache_destroy(struct dst_cache *dst_cache) in dst_cache_destroy() argument
159 if (!dst_cache->cache) in dst_cache_destroy()
163 dst_release(per_cpu_ptr(dst_cache->cache, i)->dst); in dst_cache_destroy()
165 free_percpu(dst_cache->cache); in dst_cache_destroy()
169 void dst_cache_reset_now(struct dst_cache *dst_cache) in dst_cache_reset_now() argument
173 if (!dst_cache->cache) in dst_cache_reset_now()
176 dst_cache_reset(dst_cache); in dst_cache_reset_now()
178 struct dst_cache_pcpu *idst = per_cpu_ptr(dst_cache->cache, i); in dst_cache_reset_now()