Lines Matching +full:0 +full:xa
22 #define REG_STATE_NEW 0x0
23 #define REG_STATE_REGISTERED 0x1
24 #define REG_STATE_UNREGISTERED 0x2
25 #define REG_STATE_UNUSED 0x3
29 #define MEM_ID_MAX 0xFFFE
51 const struct xdp_mem_allocator *xa = ptr; in xdp_mem_id_cmp() local
54 return xa->mem.id != mem_id; in xdp_mem_id_cmp()
71 struct xdp_mem_allocator *xa; in __xdp_mem_allocator_rcu_free() local
73 xa = container_of(rcu, struct xdp_mem_allocator, rcu); in __xdp_mem_allocator_rcu_free()
76 ida_simple_remove(&mem_id_pool, xa->mem.id); in __xdp_mem_allocator_rcu_free()
78 kfree(xa); in __xdp_mem_allocator_rcu_free()
81 static void mem_xa_remove(struct xdp_mem_allocator *xa) in mem_xa_remove() argument
83 trace_mem_disconnect(xa); in mem_xa_remove()
85 if (!rhashtable_remove_fast(mem_id_ht, &xa->node, mem_id_rht_params)) in mem_xa_remove()
86 call_rcu(&xa->rcu, __xdp_mem_allocator_rcu_free); in mem_xa_remove()
91 struct xdp_mem_allocator *xa; in mem_allocator_disconnect() local
100 while ((xa = rhashtable_walk_next(&iter)) && !IS_ERR(xa)) { in mem_allocator_disconnect()
101 if (xa->allocator == allocator) in mem_allocator_disconnect()
102 mem_xa_remove(xa); in mem_allocator_disconnect()
107 } while (xa == ERR_PTR(-EAGAIN)); in mem_allocator_disconnect()
115 struct xdp_mem_allocator *xa; in xdp_unreg_mem_model() local
120 mem->id = 0; in xdp_unreg_mem_model()
121 mem->type = 0; in xdp_unreg_mem_model()
123 if (id == 0) in xdp_unreg_mem_model()
127 xa = rhashtable_lookup_fast(mem_id_ht, &id, mem_id_rht_params); in xdp_unreg_mem_model()
128 page_pool_destroy(xa->page_pool); in xdp_unreg_mem_model()
161 memset(xdp_rxq, 0, sizeof(*xdp_rxq)); in xdp_rxq_info_init()
164 /* Returns 0 on success, negative on failure */
189 return 0; in xdp_rxq_info_reg()
211 return 0; in __mem_id_init_hash_table()
218 if (ret < 0) { in __mem_id_init_hash_table()
226 return 0; in __mem_id_init_hash_table()
241 if (id < 0) { in __mem_id_cyclic_get()
292 if (ret < 0) in __xdp_reg_mem_model()
302 if (id < 0) { in __xdp_reg_mem_model()
314 mem->id = 0; in __xdp_reg_mem_model()
339 return 0; in xdp_reg_mem_model()
359 return 0; in xdp_rxq_info_reg_mem_model()
373 struct xdp_mem_allocator *xa; in __xdp_return() local
380 xa = rhashtable_lookup(mem_id_ht, &mem->id, mem_id_rht_params); in __xdp_return()
384 page_pool_put_full_page(xa->page_pool, page, napi_direct); in __xdp_return()
425 struct xdp_mem_allocator *xa; in __xdp_release_frame() local
429 xa = rhashtable_lookup(mem_id_ht, &mem->id, mem_id_rht_params); in __xdp_release_frame()
431 if (xa) in __xdp_release_frame()
432 page_pool_release_page(xa->page_pool, page); in __xdp_release_frame()
455 metasize = xdp_data_meta_unsupported(xdp) ? 0 : in xdp_convert_zc_to_xdp_frame()
468 memset(xdpf, 0, sizeof(*xdpf)); in xdp_convert_zc_to_xdp_frame()
476 xdpf->headroom = 0; in xdp_convert_zc_to_xdp_frame()