Lines Matching refs:mem
45 BUILD_BUG_ON(sizeof_field(struct xdp_mem_allocator, mem.id) in xdp_mem_id_hashfn()
58 return xa->mem.id != mem_id; in xdp_mem_id_cmp()
64 .key_offset = offsetof(struct xdp_mem_allocator, mem.id),
65 .key_len = sizeof_field(struct xdp_mem_allocator, mem.id),
80 ida_free(&mem_id_pool, xa->mem.id); in __xdp_mem_allocator_rcu_free()
117 void xdp_unreg_mem_model(struct xdp_mem_info *mem) in xdp_unreg_mem_model() argument
120 int type = mem->type; in xdp_unreg_mem_model()
121 int id = mem->id; in xdp_unreg_mem_model()
124 mem->id = 0; in xdp_unreg_mem_model()
125 mem->type = 0; in xdp_unreg_mem_model()
144 xdp_unreg_mem_model(&xdp_rxq->mem); in xdp_rxq_info_unreg_mem_model()
271 static struct xdp_mem_allocator *__xdp_reg_mem_model(struct xdp_mem_info *mem, in __xdp_reg_mem_model() argument
283 mem->type = type; in __xdp_reg_mem_model()
310 mem->id = id; in __xdp_reg_mem_model()
311 xdp_alloc->mem = *mem; in __xdp_reg_mem_model()
317 ida_free(&mem_id_pool, mem->id); in __xdp_reg_mem_model()
318 mem->id = 0; in __xdp_reg_mem_model()
324 page_pool_use_xdp_mem(allocator, mem_allocator_disconnect, mem); in __xdp_reg_mem_model()
335 int xdp_reg_mem_model(struct xdp_mem_info *mem, in xdp_reg_mem_model() argument
340 xdp_alloc = __xdp_reg_mem_model(mem, type, allocator); in xdp_reg_mem_model()
357 xdp_alloc = __xdp_reg_mem_model(&xdp_rxq->mem, type, allocator); in xdp_rxq_info_reg_mem_model()
383 struct xdp_mem_info mem; in xdp_reg_page_pool() local
385 return xdp_reg_mem_model(&mem, MEM_TYPE_PAGE_POOL, pool); in xdp_reg_page_pool()
398 struct xdp_mem_info mem = { in xdp_unreg_page_pool() local
403 xdp_unreg_mem_model(&mem); in xdp_unreg_page_pool()
418 struct xdp_mem_info mem = { in xdp_rxq_info_attach_page_pool() local
423 xdp_rxq_info_attach_mem_model(xdp_rxq, &mem); in xdp_rxq_info_attach_page_pool()
545 __xdp_return(netmem, xdp->rxq->mem.type, true, NULL); in xdp_return_frag()
559 xdp->rxq->mem.type, true, xdp); in xdp_return_buff()
562 __xdp_return(virt_to_netmem(xdp->data), xdp->rxq->mem.type, true, xdp); in xdp_return_buff()
657 if (rxq->mem.type == MEM_TYPE_PAGE_POOL) in xdp_build_skb_from_buff()