Lines Matching defs:pgcache
93 static inline struct pgcache *nicvf_alloc_page(struct nicvf *nic,
98 struct pgcache *pgcache, *next;
101 pgcache = &rbdr->pgcache[rbdr->pgidx];
102 page = pgcache->page;
112 if (ref_count == pgcache->ref_count)
113 pgcache->ref_count--;
136 pgcache->page = page;
137 pgcache->dma_addr = 0;
138 pgcache->ref_count = 0;
151 if (!pgcache->ref_count) {
152 pgcache->ref_count = XDP_PAGE_REFCNT_REFILL;
167 next = &rbdr->pgcache[rbdr->pgidx];
172 return pgcache;
179 struct pgcache *pgcache = NULL;
194 pgcache = nicvf_alloc_page(nic, rbdr, gfp);
195 if (!pgcache && !nic->rb_page) {
207 if (pgcache)
208 nic->rb_page = pgcache->page;
210 if (rbdr->is_xdp && pgcache && pgcache->dma_addr) {
211 *rbuf = pgcache->dma_addr;
224 if (pgcache)
225 pgcache->dma_addr = *rbuf + XDP_PACKET_HEADROOM;
292 rbdr->pgcache = kcalloc(rbdr->pgcnt, sizeof(*rbdr->pgcache),
294 if (!rbdr->pgcache)
323 struct pgcache *pgcache;
363 pgcache = &rbdr->pgcache[head];
364 if (pgcache->page && page_ref_count(pgcache->page) != 0) {
366 page_ref_sub(pgcache->page,
367 pgcache->ref_count - 1);
369 put_page(pgcache->page);