Lines Matching refs:rcache

965 	struct iova_rcache *rcache;  in init_iova_rcaches()  local
970 rcache = &iovad->rcaches[i]; in init_iova_rcaches()
971 spin_lock_init(&rcache->lock); in init_iova_rcaches()
972 rcache->depot_size = 0; in init_iova_rcaches()
973 rcache->cpu_rcaches = __alloc_percpu(sizeof(*cpu_rcache), cache_line_size()); in init_iova_rcaches()
974 if (WARN_ON(!rcache->cpu_rcaches)) in init_iova_rcaches()
977 cpu_rcache = per_cpu_ptr(rcache->cpu_rcaches, cpu); in init_iova_rcaches()
992 struct iova_rcache *rcache, in __iova_rcache_insert() argument
1000 cpu_rcache = raw_cpu_ptr(rcache->cpu_rcaches); in __iova_rcache_insert()
1012 spin_lock(&rcache->lock); in __iova_rcache_insert()
1013 if (rcache->depot_size < MAX_GLOBAL_MAGS) { in __iova_rcache_insert()
1014 rcache->depot[rcache->depot_size++] = in __iova_rcache_insert()
1019 spin_unlock(&rcache->lock); in __iova_rcache_insert()
1055 static unsigned long __iova_rcache_get(struct iova_rcache *rcache, in __iova_rcache_get() argument
1063 cpu_rcache = raw_cpu_ptr(rcache->cpu_rcaches); in __iova_rcache_get()
1072 spin_lock(&rcache->lock); in __iova_rcache_get()
1073 if (rcache->depot_size > 0) { in __iova_rcache_get()
1075 cpu_rcache->loaded = rcache->depot[--rcache->depot_size]; in __iova_rcache_get()
1078 spin_unlock(&rcache->lock); in __iova_rcache_get()
1111 struct iova_rcache *rcache; in free_iova_rcaches() local
1117 rcache = &iovad->rcaches[i]; in free_iova_rcaches()
1119 cpu_rcache = per_cpu_ptr(rcache->cpu_rcaches, cpu); in free_iova_rcaches()
1123 free_percpu(rcache->cpu_rcaches); in free_iova_rcaches()
1124 for (j = 0; j < rcache->depot_size; ++j) in free_iova_rcaches()
1125 iova_magazine_free(rcache->depot[j]); in free_iova_rcaches()
1135 struct iova_rcache *rcache; in free_cpu_cached_iovas() local
1140 rcache = &iovad->rcaches[i]; in free_cpu_cached_iovas()
1141 cpu_rcache = per_cpu_ptr(rcache->cpu_rcaches, cpu); in free_cpu_cached_iovas()
1154 struct iova_rcache *rcache; in free_global_cached_iovas() local
1159 rcache = &iovad->rcaches[i]; in free_global_cached_iovas()
1160 spin_lock_irqsave(&rcache->lock, flags); in free_global_cached_iovas()
1161 for (j = 0; j < rcache->depot_size; ++j) { in free_global_cached_iovas()
1162 iova_magazine_free_pfns(rcache->depot[j], iovad); in free_global_cached_iovas()
1163 iova_magazine_free(rcache->depot[j]); in free_global_cached_iovas()
1164 rcache->depot[j] = NULL; in free_global_cached_iovas()
1166 rcache->depot_size = 0; in free_global_cached_iovas()
1167 spin_unlock_irqrestore(&rcache->lock, flags); in free_global_cached_iovas()