Lines Matching refs:pgcache

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