Lines Matching refs:page

33 /* Number of RX buffers to recycle pages for.  When creating the RX page recycle
34 * ring, this number is divided by the number of buffers per page to calculate
35 * the number of pages to store in the RX page recycle ring.
62 return page_address(buf->page) + buf->page_offset;
108 /* Check the RX page recycle ring for a page that can be reused. */
109 static struct page *efx_reuse_page(struct efx_rx_queue *rx_queue)
112 struct page *page;
117 page = rx_queue->page_ring[index];
118 if (page == NULL)
126 /* If page_count is 1 then we hold the only reference to this page. */
127 if (page_count(page) == 1) {
129 return page;
131 state = page_address(page);
135 put_page(page);
143 * efx_init_rx_buffers - create EFX_RX_BATCH page-based RX buffers
149 * 0 on success. If a single page can be used for multiple buffers,
150 * then the page will either be inserted fully, or not at all.
156 struct page *page;
164 page = efx_reuse_page(rx_queue);
165 if (page == NULL) {
166 page = alloc_pages(__GFP_COLD | __GFP_COMP |
169 if (unlikely(page == NULL))
172 dma_map_page(&efx->pci_dev->dev, page, 0,
177 __free_pages(page, efx->rx_buffer_order);
180 state = page_address(page);
183 state = page_address(page);
194 rx_buf->page = page;
199 get_page(page);
210 /* Unmap a DMA-mapped page. This function is only called for the final RX
211 * buffer in a page.
216 struct page *page = rx_buf->page;
218 if (page) {
219 struct efx_rx_page_state *state = page_address(page);
229 if (rx_buf->page) {
230 put_page(rx_buf->page);
231 rx_buf->page = NULL;
235 /* Attempt to recycle the page if there is an RX recycle ring; the page can
242 struct page *page = rx_buf->page;
247 /* Only recycle the page after processing the final buffer. */
262 rx_queue->page_ring[index] = page;
268 put_page(rx_buf->page);
274 /* Release the page reference we hold for the buffer. */
275 if (rx_buf->page)
276 put_page(rx_buf->page);
278 /* If this is the last buffer in a page, unmap and free it. */
283 rx_buf->page = NULL;
435 put_page(rx_buf->page);
436 rx_buf->page = NULL;
450 rx_buf->page, rx_buf->page_offset,
452 rx_buf->page = NULL;
471 /* Allocate and construct an SKB around page fragments */
496 /* Append the remaining page(s) onto the frag list */
503 rx_buf->page, rx_buf->page_offset,
505 rx_buf->page = NULL;
514 __free_pages(rx_buf->page, efx->rx_buffer_order);
515 rx_buf->page = NULL;
798 struct page *page = rx_queue->page_ring[i];
801 if (page == NULL)
804 state = page_address(page);
808 put_page(page);